I want to add this map tile layer to my map – Stamen toner-background. As I read in documentation I need to simply give custom url in the tiles attribute of map
mapa = folium.Map(width=1000, height=700, zoom_start=5.5,
location=[52.5, 19], tiles='http://maps.stamen.com/toner-background/embed#6/{x}/{z}', attr="toner-bcg")
It loads but nothing is displayed.
I don't really know how this attribution thing works like and what should I do. I like the tile because it's like stamen toner but without country names and that makes my map a lot more beautiful.
Folium allows us to create maps with different tiles like Stamen Terrain, Stamen Toner, Stamen Water Color, CartoDB Positron, and many more.
This is your lucky day, Stamen designs are built-in in Folium. You should run the following code:
mapa = folium.Map(width=1000, height=700, zoom_start=5.5,
location=[52.5, 19], tiles='Stamen Toner')
This should solve the issue.
The reason your code was not working is because you were not using the correct URL templates. The format is one specified here:
http://tile.stamen.com/toner/{z}/{x}/{y}.png
http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg
http://tile.stamen.com/watercolor/{z}/{x}/{y}.jpg
The code would look like this:
mapa = folium.Map(width=1000, height=700, zoom_start=5.5,
location=[52.5, 19], tiles='http://tile.stamen.com/toner/{z}/{x}/{y}.png ')
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