The following code initializes a leaflet map. The initialize function centers the map based on user location. How do I change the center of the map to a new position after c
You could also use:
var latLon = L.latLng(40.737, -73.923); var bounds = latLon.toBounds(500); // 500 = metres map.panTo(latLon).fitBounds(bounds);
This will set the view level to fit the bounds in the map leaflet.