3

I have a folium map object that I am displaying in a notebook and adding layers to it and displaying again.

So I want to update the zoom level of a map each time I add a layer based on the extent of these layers and previously added layers.

I know I can create a FetureGroup and do FitBounds but I don't want to have a FeatureGroup. Is there a way to do this automatically?

1 Answer 1

5

Just tried this and it worked.

map.fit_bounds(map.get_bounds(), padding=(30, 30))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.