import folium
from IPython.display import HTML
import json
with open('test_schisto.geojson') as f:
data = json.load(f)
carte = folium.Map(location=[50.2797,5.3481],zoom_start=11)
carte.geo_json(geo_path="test_schisto.geojson")
carte.create_map(path='test_schisto.html')
def inline_map(map):
"""
Embeds the HTML source of the map directly into the IPython notebook.
This method will not work if the map depends on any files (json data). Also this uses
the HTML5 srcdoc attribute, which may not be supported in all browsers.
"""
map._build_map()
return HTML('<iframe srcdoc="{srcdoc}" style="width: 100%; height: 510px; border: none"></iframe>'.format(srcdoc=map.HTML.replace('"', '"')))
inline_map(carte)