diff options
author | hellekin <hellekin@cepheide.org> | 2021-01-31 13:42:33 +0100 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2021-01-31 13:42:33 +0100 |
commit | fa9e4ea45d75e3e6c72ab51aa6e19b212e25ff60 (patch) | |
tree | 8b3fe010fb2c46e4a076e6f58dd5ff0649076b2b | |
parent | cec576546e1344ee43163fda21d803e6c38615a1 (diff) | |
download | incommon-map-fa9e4ea45d75e3e6c72ab51aa6e19b212e25ff60.tar.gz |
Add scale information to the map
-rw-r--r-- | app/javascript/controllers/map_controller.js | 3 |
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. |