Sunday, 16 June 2019

Zoom to fit all markers in Mapbox or Leaflet

How do I set view to see all markers on map in Mapbox or Leaflet? Like Google Maps API does with bounds?

var group = new L.featureGroup([marker1, marker2, marker3]);

map.fitBounds(group.getBounds());

2 comments:

Thanks for your comments