Search code examples
dictionarymapboxrendertilesfolium

Mapbox Bright wont render: Did I leave a command out?


Using Folium but cant render a map with a "Mapbox Bright" tiling. However I can render a "Stamen Toner" tiling. Am I leaving out a command?

  • Ran code on both windows and linux platforms,
  • in the cloud and local,
  • in both firefox and chrome.
  • libraries installed via pip install folium or conda install

Code should execute:

import webbrowser

import folium

world_map_stamen = folium.Map(location=[56.130, -106.35], tiles="Stamen Toner",zoom_start=4,height=500, width=1000)

world_map_mapbox = folium.Map(location=[56.130, -106.35], tiles="Mapbox Bright",zoom_start=4,height=500, width=1000)

world_map_stamen.save("mymap_stamen.html") world_map_mapbox.save("mymap_mapbox.html")

webbrowser.open("mymap_stamen.html")

webbrowser.open("mymap_mapbox.html")

I expected both to work. Only one did. I must be forgetting something?


Solution

  • Found my own answer and this question has been answered elsewhere in various forms....

    But it seem like there are two answers:

    (1) Mapbox maps are no longer supported in folium 0.9 so Mapbox maps must be called using an attribution and custom tile call:

    (2) the tilesets that are free are listed in another post and no longer include mapbox bright. see https://gis.stackexchange.com/questions/244788/map-ids-to-add-mapbox-basemaps-to-leaflet-or-openlayers