adds geolocation to map

This commit is contained in:
Christian Beutel
2025-01-16 00:32:53 +01:00
parent e7e80114f1
commit 72d6701a51

View File

@@ -735,6 +735,22 @@
"top-left",
);
map.addControl(
new M.GeolocateControl({
positionOptions: {
enableHighAccuracy: true,
},
fitBoundsOptions: {
animate: fitBounds == "animate"
},
trackUserLocation: true,
}),
);
if (showStyleSwitcher) {
map.addControl(switcherControl);
}
if (showElevation) {
epc = new ElevationProfileControl({
visible: false,
@@ -765,9 +781,6 @@
});
map.addControl(epc);
}
if (showStyleSwitcher) {
map.addControl(switcherControl);
}
if (showFullscreen) {
map.addControl(