I am using mapbox in our application. Doing this.map.fitBounds(bound value) will zoomout or zoomin map to bound specified value. I need to find out zoom level (i.e map rendering after fit bounds) before calling this.map.fitBounds. Is there any methods available in mapbox?
Use L.Map
's getBoundsZoom
method:
Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety.
http://leafletjs.com/reference.html#map-getboundszoom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With