-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Zoom for TileLayer in version 0.19.0 #2043
Comments
I have got a similar issue, the following is the reproducible codes that people can test on folium 0.18.0 and 0.19.0. import folium
# Esri_WorldTopoMap
arcgis = 'https://server.arcgisonline.com/ArcGIS/rest/services'
esri = {'Esri_WorldTopoMap': 'World_Topo_Map'}
tile = 'MapServer/tile/{z}/{y}/{x}'
tile_esri = dict(zip(esri.keys(), ['/'.join([arcgis, v, tile]) for v in esri.values()]))
# GOOGLE online map
tile_google = {
'Maps': 'https://mt1.google.com/vt/lyrs=r&x={x}&y={y}&z={z}',
'Satellite': 'http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}',
'Roads': 'https://mt1.google.com/vt/lyrs=h&x={x}&y={y}&z={z}',
}
m = folium.Map(
location=(-45.54, 169.74),
tiles=None,
zoom_start=9,
zoom_control=False,
attributionControl=False,
)
# Add 'Esri_WorldTopoMap' as 'Esri_WorldTopoMap'
folium.raster_layers.TileLayer(
tiles=tile_esri['Esri_WorldTopoMap'],
attr='Esri_WorldTopoMap',
name='World Topographic Map (ESRI)',
overlay=False, # As an optional overlay (True) or the base layer (False)
control=True, # Whether the Layer will be included in LayerControls
show=True,
).add_to(m)
# Add Google Maps
folium.raster_layers.TileLayer(
tiles='http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',
attr='Google',
name='Google Maps',
subdomains=['mt0', 'mt1', 'mt2', 'mt3'],
overlay=False,
control=True,
show=False,
).add_to(m)
# Add Google Satellite
folium.raster_layers.TileLayer(
tiles='http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',
attr='Google',
name='Google Satellite',
subdomains=['mt0', 'mt1', 'mt2', 'mt3'],
overlay=False,
control=True,
show=False,
).add_to(m)
# Add Google Roads layer (optional)
folium.raster_layers.TileLayer(
tiles=tile_google['Roads'],
attr='Google',
name='Google Roads',
overlay=True,
control=True,
show=False,
).add_to(m)
folium.LayerControl(position='bottomright', collapsed=False).add_to(m)
m The folium map can be shown properly in jupyter notebook when using 0.18.0. However, you will have a map with some possible render issue when using 0.19.0 Hopefully, the issue is clearly illustrated. |
I will have a look one of these days to see what can be the issue. |
Thanks @lux-orc for the reproducible example, very useful. The issue seems to be with the Before we used a |
Thank you for working on this @Conengmo. Looking forward to having the fix :) |
Just released v0.19.1 with a fix for this issue, hopefully that solves it for you. Thanks again for the bug report! |
I just installed Folium 0.19.1 using |
I'm using a tiling endpoint based of TiTiler to serve map tiles on Folium. Since the upgrade last night, the tiles no longer render, and my tiling endpoint gives me this error: "Invalid ZOOM level 0", and the tile request is showing as "tiles/WebMercatorQuad/0/0/0"
Typically, the folium map generates tile at whatever x, y, z are visible on the map. Only this single 0,0,0 tile is being requested.
Environment is in a Databricks notebook with Folium 0.19.0
The text was updated successfully, but these errors were encountered: