Closed mguerrajordao closed 9 years ago
And looking forward for new additions. Thank you for this project. Regards, Marcelo
Hi @mguerrajordao. You need to serve the HTML, that is how folium is supposed to work. Take a look at #72
Thank you, Sorry, I haven't noticed it was a duplicated issue. I'll have a look. Congratulations for this project.
I guess my main issue was because I was also trying to use it embedded on an iframe in iPython notebook. I'll see if i can serve the HTML. Thanks
Option 1:
import folium
folium.initialize_notebook()
Option 2:
from IPython.display import HTML, IFrame
def inline_map(m):
"""Takes a folium instance or a html path and load IFrame."""
if isinstance(m, Map):
m._build_map()
srcdoc = m.HTML.replace('"', '"')
embed = HTML('<iframe srcdoc="{srcdoc}" '
'style="width: 100%; height: 500px; '
'border: none"></iframe>'.format(srcdoc=srcdoc))
elif isinstance(m, str):
embed = IFrame(m, width=750, height=500)
return embed
Hello developers,
I've been starting to use foluim to produce leaflet.js maps from geographical data using python and pandas dataframe. I've noticed that when trying to use the polygon markers, and export to html via map.create_map, the 'http:' prefix is missing on the head of the html file. While trying to open the html file separately or by an iframe, the javascript does not find this urls locally (as it prepends with 'file:') on the bootstrap and markercluster (js and css files). I don't know if this is the expected behavior, but anyway is reported.
Input on python (from polygon marker example)
bridges.html file output header:
Thanks and best regards, Marcelo