I'm trying to disable zooming on user location while triggering GeolocateControl.
Basically I do not want to run map.flyTo() function while locating an user.
const geolocate = useRef( new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true
},
trackUserLocation: true,
showAccuracyCircle: false
}))
map.current.addControl(geolocate.current);
geolocate.current.on('geolocate', function(e) {
map.current.flyTo({
zoom: map.current.getZoom()
});
});
Okay, I figured out a way to achieve that.