0

I was trying to create a map in Folium using a custom map built tile layer created with Mapbox Studio (using 3 different datasets and a satellite basemap). I was wondering if there is a simple way to add it with Folium? I read in the documentation that style layers and datasets had to be called separately. I tried with the following (and a few variations), but each time it loaded the Python data with no base map.

folium_map = folium.Map(location=[-8.907970, 33.433200],
                        zoom_start=7,
                        tiles='http://{s}.tiles.mapbox.com/v4/(username).(mapid)/{z}/{x}/{y}@2x.png?access_token=(access token)',
                        attr='Mapbox')

I was using Mapbox (instead of loading the datasets independently) because my datasets are pretty big (up to 100MB, upwards of 100,000 points) and that causes the Leaflet map to lag tremendously.

0

Perhaps this:

folium_map = folium.Map(location=[-8.907970, 33.433200],
                        zoom_start=7,
                        tiles='http://{s}.tiles.mapbox.com/v4/(username).(mapid)/{z}/{x}/{y}@2x.png',
                        attr='Mapbox',
                        API_key='(access token)'     
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.