Load GeoJSON as in GeoJSON_and_choropleth.ipynb.
import json
import folium
import requests
url = (
"https://raw.githubusercontent.com/python-visualization/folium/master/examples/data"
)
us_states = f"{url}/us-states.json"
geo_json_data = json.loads(requests.get(us_states).text)
m = folium.Map([43, -100], zoom_start=4, tiles="stamentoner")
folium.GeoJson(geo_json_data).add_to(m)
m
m = folium.Map([43, -100], zoom_start=4, tiles="stamentonerbackground")
folium.GeoJson(geo_json_data).add_to(m)
folium.map.CustomPane("labels").add_to(m)
# Final layer associated to custom pane via the appropriate kwarg
folium.TileLayer("stamentonerlabels", pane="labels").add_to(m)
m
m = folium.Map([43, -100], zoom_start=4, tiles="CartoDBPositronNoLabels")
folium.GeoJson(geo_json_data).add_to(m)
folium.map.CustomPane("labels").add_to(m)
# Final layer associated to custom pane via the appropriate kwarg
folium.TileLayer("CartoDBPositronOnlyLabels", pane="labels").add_to(m)
m
More tile providers can be found at https://leaflet-extras.github.io/leaflet-providers/preview/.