Popup with html renders blank map
See original GitHub issuePython 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
…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:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
@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.
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?