Adjust map geolocation control settings

master
Skylar Ittner 3 years ago
parent 971ed994e0
commit d154221464

@ -30,18 +30,22 @@ function maplibreMap(containerEl, interactive) {
showCompass: false
}), 'top-left');
map.addControl(
new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true,
timeout: 10 * 1000
},
fitBoundsOptions: {
maxZoom: 16
},
trackUserLocation: false
}), 'top-left'
);
map.geolocatecontrol = new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true
},
fitBoundsOptions: {
maxZoom: 15
},
showAccuracyCircle: false,
trackUserLocation: true
});
map.addControl(map.geolocatecontrol, 'top-left');
map.geolocatecontrol.on('error', function (err) {
console.error("Geolocate error", err);
});
map.addControl(
new mapboxgl.ScaleControl({

Loading…
Cancel
Save