I'm using Mapboxgl in angular, and I have this code and everything is well:
map!: mapboxgl.Map;
loadMap()
{
(Mapboxgl as any).accessToken = environment.mapBoxKey;
this.map = new Mapboxgl.Map({
container: 'map-box', // container id
style: 'mapbox://styles/mapbox/streets-v11',
center: [5, 51], // starting position
zoom: 5 // starting zoom
});
}
When I add 'click' event to the map, the double click zoom not working. this is the 'click' event code:
this.map.on('click', (e) =>{
if(this.marker != null){
this.marker.remove();
}
//creatMarker(e.lngLat.lng, e.lngLat.lat);
});
how can fix that?