Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html does not appear in jupyter #4153

Open
mybox2003 opened this issue Oct 29, 2018 · 2 comments
Open

html does not appear in jupyter #4153

mybox2003 opened this issue Oct 29, 2018 · 2 comments

Comments

@mybox2003
Copy link

mybox2003 commented Oct 29, 2018

I use the following code

import folium
 import pandas as pd
 
 df = pd.read_csv('meteo.csv', encoding='cp1251', sep =';')
 customers = zip(df['lat'], df['lng'])
 m = folium.Map(location=[70, 100], zoom_start=1)
 folium.Marker(location=customers[0]).add_to(m)
 folium.Marker(location=customers[1]).add_to(m)
 folium.Marker(location=customers[3]).add_to(m)
 
 m

if markers are 2, then the folium displays a map with markers, but if markers are 3 or or more, then I see an empty window in jupyter, there are no errors. How to fix it?

The case is most likely in Jupiter.
If I run the code:

    def embed_map(m):
        from IPython.display import HTML
    
        m.save('index.html')
        with open('index.html') as f:
            html = f.read()
    
        iframe = '<iframe srcdoc="{srcdoc}" style="width: 100%; height: 750px; border: none"></iframe>'
        srcdoc = html.replace('"', '&quot;')
        return HTML(iframe.format(srcdoc=srcdoc))
    
    
    embed_map(m)

I get the correct html, but it also does not appear in jupyter.

@takluyver
Copy link
Member

Check the browser's Javascript console to see if there are any errors there.

@mybox2003
Copy link
Author

there are no errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants