aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2021-01-31 13:42:33 +0100
committerhellekin <hellekin@cepheide.org>2021-01-31 13:42:33 +0100
commitfa9e4ea45d75e3e6c72ab51aa6e19b212e25ff60 (patch)
tree8b3fe010fb2c46e4a076e6f58dd5ff0649076b2b
parentcec576546e1344ee43163fda21d803e6c38615a1 (diff)
downloadincommon-map-fa9e4ea45d75e3e6c72ab51aa6e19b212e25ff60.tar.gz
Add scale information to the map
-rw-r--r--app/javascript/controllers/map_controller.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/javascript/controllers/map_controller.js b/app/javascript/controllers/map_controller.js
index 9770cf4..005599e 100644
--- a/app/javascript/controllers/map_controller.js
+++ b/app/javascript/controllers/map_controller.js
@@ -60,6 +60,9 @@ export default class extends Controller {
L.control.layers(tilemaps, overlays).addTo(this.map)
+ /* Show current scale in meters or kilometers */
+ L.control.scale({ imperial: false }).addTo(this.map);
+
L.DomEvent.on(window, 'hashchange', this.doSomethingCool);
// Allow calling the mapController from elsewhere.