When we introduced xyzservices, we changed the way we handle the max_zoom and max_native_zoom arguments of TileLayer (and Map). In this PR, restore how it worked before that change, but keep using the values from xyzservices.
To do that, make min_zoom and max_zoom optional arguments with default values None. That way, when a user doesn't provide them, we can use the value from xyzservices.
When a user does provide explicit values for e.g. max_zoom, honor that value and don't overwrite it from xyzservices. This allows zooming past the highest native zoom level.
Fill the max_native_zoom option from xyzservices, unless a user provides an explicit value.
I opted to keep the defaults of 0 and 18, because those are the defaults set by Leaflet as well. This way, we make them explicit to our users.
Fix https://github.com/python-visualization/folium/issues/1859
When we introduced xyzservices, we changed the way we handle the
max_zoom
andmax_native_zoom
arguments ofTileLayer
(andMap
). In this PR, restore how it worked before that change, but keep using the values from xyzservices.To do that, make
min_zoom
andmax_zoom
optional arguments with default values None. That way, when a user doesn't provide them, we can use the value from xyzservices.When a user does provide explicit values for e.g.
max_zoom
, honor that value and don't overwrite it from xyzservices. This allows zooming past the highest native zoom level.Fill the
max_native_zoom
option from xyzservices, unless a user provides an explicit value.I opted to keep the defaults of 0 and 18, because those are the defaults set by Leaflet as well. This way, we make them explicit to our users.