diff --git a/src/partials/editor.html b/src/partials/editor.html index 63c474e..6e118fe 100644 --- a/src/partials/editor.html +++ b/src/partials/editor.html @@ -45,6 +45,7 @@
Map Visual Options
+
Map Data Options
diff --git a/src/worldmap.ts b/src/worldmap.ts index 341f9a6..55f9ea0 100644 --- a/src/worldmap.ts +++ b/src/worldmap.ts @@ -45,6 +45,7 @@ export default class WorldMap { zoom: parseInt(this.ctrl.panel.initialZoom, 10) || 1, }); this.setMouseWheelZoom(); + this.setDragging(); const selectedTileServer = tileServers[this.ctrl.tileServer]; (window).L.tileLayer(selectedTileServer.url, { @@ -241,6 +242,14 @@ export default class WorldMap { } } + setDragging() { + if (!this.ctrl.panel.dragging) { + this.map.dragging.disable(); + } else { + this.map.dragging.enable(); + } + } + addCircles(circles) { return (window).L.layerGroup(circles).addTo(this.map); } diff --git a/src/worldmap_ctrl.ts b/src/worldmap_ctrl.ts index 4aa746c..ddce0b3 100644 --- a/src/worldmap_ctrl.ts +++ b/src/worldmap_ctrl.ts @@ -29,6 +29,7 @@ const panelDefaults = { unitPlural: "", showLegend: true, mouseWheelZoom: false, + dragging: false, esMetric: "Count", decimals: 0, hideEmpty: false, @@ -265,6 +266,11 @@ export default class WorldmapCtrl extends MetricsPanelCtrl { this.render(); } + toggleDragging() { + this.map.setDragging(); + this.render(); + } + toggleStickyLabels() { this.map.clearCircles(); this.render();