How to set mapbox api url for folium

Schneckenlieber
Feb 26, 2021

--

Steps of how to set tiles for folium described here since there seem no detailed instructions and folium requested passing via api for Mapbox maps.

Steps

  1. Go to Mapbox Studio
  2. Create a “New Style”, choose a template and variant
  3. adjust the settings you want, then click “share” on the top right corner
  4. Switch to “Third party” and select for “Fulcrum”. Then just copy the link

5. Paste to parameter “tiles” like

map = folium.Map(location=[51.163361, 10.447683], zoom_start=6, tiles='https://api.mapbox.com/styles/v1/username/referencecode/tiles/256/{z}/{x}/{y}@2x?access_token=pk.xxxx', attr='Mapbox Light')

and the map looks like

Reference

--

--

Schneckenlieber
Schneckenlieber

Written by Schneckenlieber

An Engineer living in Europe. Philosophy, Culture study, Psychology, Politics, Economy,... and so on as my hobby.

No responses yet