I tried this:
map.fitBounds(L.polyline([L.latLng(40,9), L.latLng(1,2)]).getBounds(), {
padding: [50, 50],
maxZoom: 17,
animate: true,
duration: 10
});
I expect the animation to take 10 seconds to complete, but it completes very fast.. Does anyone have ideas about how to make the duration longer for fitBounds?
It should be set as:
map.fitBounds(bounds, {
padding: [50, 50],
maxZoom: 18,
animate: true,
pan: {
duration: 10
}
});
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