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

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