I want to zoom on a marker when it is clicked. I am using Mapbox and leaflet.
I tried:
marker.on('click', function(e){
map.setView([e.lat, e.lng], 12);
});
But it gives me some kind of error:
TypeError: t is null
I even tried:
marker.on('click', function(e){
map.fitBounds(marker.getBounds());
});