diff --git a/frontend/src/lib/components/leaflet-map/leaflet-map-components.ts b/frontend/src/lib/components/leaflet-map/leaflet-map-components.ts index dd165708..953f1865 100644 --- a/frontend/src/lib/components/leaflet-map/leaflet-map-components.ts +++ b/frontend/src/lib/components/leaflet-map/leaflet-map-components.ts @@ -205,7 +205,7 @@ function useLocateControl(map: Ref, context: FacilMapContext): Ref, context: FacilMapContext): Ref, context: FacilMapContext): Ref, context: FacilMapContext): Ref { active.value = false; + locateControl.options.keepCurrentZoomLevel = false; }; map.on("locateactivate", handleActivate); map.on("locatedeactivate", handleDeactivate); diff --git a/frontend/src/type-fixup.d.ts b/frontend/src/type-fixup.d.ts index ee18382d..4f32b148 100644 --- a/frontend/src/type-fixup.d.ts +++ b/frontend/src/type-fixup.d.ts @@ -36,6 +36,10 @@ declare module "leaflet" { namespace Control { const Heightgraph: any; + + interface Locate { + options: LocateOptions; + } } namespace Draggable {