From d85f4b8dd0f99b6444378f389654caee7df84dbb Mon Sep 17 00:00:00 2001 From: kwod Date: Sat, 4 Jul 2026 18:53:23 +0200 Subject: [PATCH] Add Leaflet scale control to real maps --- src/map/map.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/map/map.ts b/src/map/map.ts index 545eb2b..3c826b1 100644 --- a/src/map/map.ts +++ b/src/map/map.ts @@ -186,6 +186,15 @@ export abstract class BaseMap extends Events implements BaseMapDefinition { ? { fullscreenControl: true } : {}) }); + + if (!this.options.noUI && L.control?.scale) { + L.control.scale({ + position: "bottomleft", + metric: true, + imperial: false + }).addTo(this.leafletInstance); + } + this.leafletInstance.createPane("base-layer"); this.leafletInstance.createPane("geojson"); this.leafletInstance.createPane("gpx");