Adjust map geolocation control settings
This commit is contained in:
parent
971ed994e0
commit
d154221464
@ -30,18 +30,22 @@ function maplibreMap(containerEl, interactive) {
|
|||||||
showCompass: false
|
showCompass: false
|
||||||
}), 'top-left');
|
}), 'top-left');
|
||||||
|
|
||||||
map.addControl(
|
map.geolocatecontrol = new mapboxgl.GeolocateControl({
|
||||||
new mapboxgl.GeolocateControl({
|
positionOptions: {
|
||||||
positionOptions: {
|
enableHighAccuracy: true
|
||||||
enableHighAccuracy: true,
|
},
|
||||||
timeout: 10 * 1000
|
fitBoundsOptions: {
|
||||||
},
|
maxZoom: 15
|
||||||
fitBoundsOptions: {
|
},
|
||||||
maxZoom: 16
|
showAccuracyCircle: false,
|
||||||
},
|
trackUserLocation: true
|
||||||
trackUserLocation: false
|
});
|
||||||
}), 'top-left'
|
|
||||||
);
|
map.addControl(map.geolocatecontrol, 'top-left');
|
||||||
|
|
||||||
|
map.geolocatecontrol.on('error', function (err) {
|
||||||
|
console.error("Geolocate error", err);
|
||||||
|
});
|
||||||
|
|
||||||
map.addControl(
|
map.addControl(
|
||||||
new mapboxgl.ScaleControl({
|
new mapboxgl.ScaleControl({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user