In [1]:
import os
import folium
print(folium.__version__)
In [2]:
lon, lat = -38.625, -12.875
zoom_start = 8
In [3]:
m = folium.Map(location=[lat, lon], tiles='OpenStreetMap', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_0.html'))
m
Out[3]:
In [4]:
m = folium.Map(location=[lat, lon], tiles='Mapbox Bright', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_1.html'))
m
Out[4]:
In [5]:
m = folium.Map(location=[lat, lon], tiles='Mapbox Control Room', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_2.html'))
m
Out[5]:
In [6]:
m = folium.Map(location=[lat, lon], tiles='Stamen Terrain', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_3.html'))
m
Out[6]:
In [7]:
m = folium.Map(location=[lat, lon], tiles='Stamen Toner', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_4.html'))
m
Out[7]:
In [8]:
m = folium.Map(location=[lat, lon], tiles='Stamen Watercolor', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_5.html'))
m
Out[8]:
In [9]:
m = folium.Map(location=[lat, lon], tiles='Cartodb Positron', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_6.html'))
m
Out[9]:
In [10]:
m = folium.Map(location=[lat, lon], tiles='Cartodb dark_matter', zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_7.html'))
m
Out[10]:
In [11]:
attr = ('© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> '
'contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>')
tiles = 'http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png'
m = folium.Map(location=[lat, lon], tiles=tiles, attr=attr, zoom_start=zoom_start)
m.save(os.path.join('results', 'TilesExample_8.html'))
m
Out[11]:
In [12]:
from IPython.display import IFrame
IFrame('http://leaflet-extras.github.io/leaflet-providers/preview/', width=900, height=750)
Out[12]: