Skip to content

Commit

Permalink
Fix eslint for plugins/zoom-slider.js
Browse files Browse the repository at this point in the history
  • Loading branch information
modos189 committed Oct 1, 2024
1 parent 10f2e1a commit 506ab8a
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions plugins/zoom-slider.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// @author fragger
// @name Zoom slider
// @category Controls
// @version 0.2.2
// @version 0.2.3
// @description Show a zoom slider on the map instead of the zoom buttons.

/* exported setup, changelog --eslint */
/* global L -- eslint */

var changelog = [
{
version: '0.2.3',
changes: ['Refactoring: fix eslint'],
},
{
version: '0.2.2',
changes: ['Version upgrade due to a change in the wrapper: added plugin icon'],
Expand All @@ -19,15 +24,13 @@ window.plugin.zoomSlider = zoomSlider;

zoomSlider.options = {
// Height of zoom-slider.png in px
//stepHeight: 8,

// stepHeight: 8,
// Height of the knob div in px (including border)
//knobHeight: 6,

//styleNS: 'leaflet-control-zoomslider'
// knobHeight: 6,
// styleNS: 'leaflet-control-zoomslider'
};

function setup () {
function setup() {
loadLeafletZoomslider();

var map = window.map;
Expand All @@ -40,17 +43,15 @@ function setup () {
// which makes zoomslider not aligning with other leaflet controls
// Here we are trying to unset it (make the same as general `.leaflet-control`)
// (adapted from https://github.com/kartena/Leaflet.zoomslider/pull/74)
$('<style>')
.html('.leaflet-touch .leaflet-control-zoomslider { border: 2px solid rgba(0,0,0,0.2) }')
.appendTo('head');
$('<style>').html('.leaflet-touch .leaflet-control-zoomslider { border: 2px solid rgba(0,0,0,0.2) }').appendTo('head');
}

function loadLeafletZoomslider () {
function loadLeafletZoomslider() {
try {
// https://github.com/kartena/Leaflet.zoomslider
// eslint-disable-next-line
'@include_raw:external/L.Control.Zoomslider.js@';
$('<style>').html('@include_string:external/L.Control.Zoomslider.css@').appendTo('head');

} catch (e) {
console.error('L.Control.Zoomslider.js loading failed');
throw e;
Expand Down

0 comments on commit 506ab8a

Please sign in to comment.