question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Popup with html renders blank map

See original GitHub issue

Python Code

mymap = folium.Map(location=[lat_mean, lon_mean],zoom_start=14,tiles=‘Stamen Toner’) … popup = folium.Popup(pout) … ddfg[scenario].add_child(folium.CircleMarker([lat,lon],popup=popup,radius=10,color=color,fill_color=color,fill=True))

Problem description

“pout” from the above code is html that has been constructed elsewhere. When pout is something like this:

<html> <body>

My Scenario

  • msg_type: 111 (0x11) (Deactivate EPS bearer context request)
  • Log Id: 0xb111, Name: Outgoing Message -- context accept Msg
  • msg_type: 111 (0xc1) (Deactivate )
  • Log Id: 0xb111, Name: Incoming Message -- request Msg
  • Log Id: 0x1111, Name: Incoming Message -- request Msg
  • msg_type: 111 (0xc1) (Deactivate request)
  • Log Id: 0xb111, Name: Outgoing Message -- Deactivate Msg
  • msg_type: 111 (0xcc) (Deactivate accept)
  • bearer_id: 1 (0x1) ( value 1)
  • Log Id: 0xb111, Name: Outgoing Message -- disconnect request Msg
  • Log Id: 0xb111, Name: Incoming Message -- Deactivate request Msg
  • Log Id: 0xb11, Name: Outgoing Message -- accept Msg
  • msg_type: 111 (0x11) ( accept)
  • msg_type: 111 (0xc1) ( context request)
  • </body> </html>

    …which folium turns into this:

    “bubblingMouseEvents”: true, “color”: “#075FBE”, “dashArray”: null, “dashOffset”: null, “fill”: true, “fillColor”: “#075FBE”, “fillOpacity”: 0.2, “fillRule”: “evenodd”, “lineCap”: “round”, “lineJoin”: “round”, “opacity”: 1.0, “radius”: 10, “stroke”: true, “weight”: 3 } ).addTo(feature_group_3481df76d3474e3898d84950ae8dc7f2);

            var popup_768ef23d8a164d6591289ca2a848b0a1 = L.popup({maxWidth: '300'});
    
    
                var html_c28edf7b450644a0b62f5c2084b9d45c = $('<div id="html_c28edf7b450644a0b62f5c2084b9d45c" style="width: 100.0%; height: 100.0%;">         <html>           <body>             <h2>My Scenario</h2>                     <li>msg_type: 111 (0x11) (Deactivate EPS bearer context request)</li> <li>Log Id: 0xb111, Name: Outgoing Message -- context accept Msg</li> <li>msg_type: 111 (0xc1) (Deactivate )</li> <li>Log Id: 0xb111, Name:  Incoming Message -- request Msg</li> <li>Log Id: 0x1111, Name: Incoming Message --  request Msg</li> <li>msg_type: 111 (0xc1) (Deactivate  request)</li> <li>Log Id: 0xb111, Name: Outgoing Message -- Deactivate  Msg</li> <li>msg_type: 111 (0xcc) (Deactivate  accept)</li> <li>bearer_id: 1 (0x1) ( value 1)</li> <li>Log Id: 0xb111, Name: Outgoing Message -- disconnect request Msg</li> <li>Log Id: 0xb111, Name: Incoming Message -- Deactivate  request Msg</li> <li>Log Id: 0xb11, Name: Outgoing Message --  accept Msg</li> <li>msg_type: 111 (0x11) ( accept)</li> <li>msg_type: 111 (0xc1) ( context request)</li>            </body>         </html>         </div>')[0];
                popup_768ef23d8a164d6591289ca2a848b0a1.setContent(html_c28edf7b450644a0b62f5c2084b9d45c);
    
    
            circle_marker_7430bca8e820473bba2f33ecaec025e6.bindPopup(popup_768ef23d8a164d6591289ca2a848b0a1);
    

    The result is that the map is blank or does not render.

    Expected Output

    The expected output is that the map would render and that the html would appear when I click on the circle marker.

    Output of folium.__version__

    ‘0.5.0’

    Issue Analytics

    • State:closed
    • Created 6 years ago
    • Comments:5 (1 by maintainers)

    github_iconTop GitHub Comments

    1reaction
    jtbakercommented, Apr 12, 2018

    @pjandrews I’m super interested in the 0.6 release as well. Loving this library as I’ve been integrating it into some Dash products. Wish I wrote more JS so that I could help to contribute.

    0reactions
    pjandrewscommented, Apr 12, 2018

    Sure thing. Thanks Conengmo… another question… I would like to use the search plugin that will be released with 0.6.0. Do you know if the release will happen soon, or if there is a way to access this plugin beforehand?

    Read more comments on GitHub >

    github_iconTop Results From Across the Web

    Creating marker on map using Folium results in blank HTML ...
    It work's fine until i add a Marker to the map. On adding Marker the output results in just a blank HTML page....
    Read more >
    Google Maps Rendering Blank - Oracle Communities
    Google Maps Rendering Blank · 1. Click the create icon in the Regions section · 2. Select HTML for the region type and...
    Read more >
    How can I include HTML in a Folium Marker popup?
    Tooltip(iframe.render())) # without the render method, a blank tooltip will appear.
    Read more >
    Popups and window methods - The Modern JavaScript Tutorial
    A popup window is one of the oldest methods to show additional document to user. ... let newWin = window.open("about:blank", "hello", ...
    Read more >
    Re: Blank map on print preview in Firefox - Esri Community
    For testing, I added a red background to the HTML Canvas element which does appear on the print preview so it seems like...
    Read more >

    github_iconTop Related Medium Post

    No results found

    github_iconTop Related StackOverflow Question

    No results found

    github_iconTroubleshoot Live Code

    Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
    Start Free

    github_iconTop Related Reddit Thread

    No results found

    github_iconTop Related Hackernoon Post

    No results found

    github_iconTop Related Tweet

    No results found

    github_iconTop Related Dev.to Post

    No results found

    github_iconTop Related Hashnode Post

    No results found