From fa9e4ea45d75e3e6c72ab51aa6e19b212e25ff60 Mon Sep 17 00:00:00 2001 From: hellekin Date: Sun, 31 Jan 2021 13:42:33 +0100 Subject: Add scale information to the map --- app/javascript/controllers/map_controller.js | 3 +++ 1 file changed, 3 insertions(+) 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. -- cgit v1.2.3