I've been trying to add an image to a folium marker popup using the following command:
html = '<img src="image.png" style="width:400px;height:300px;">'
folium.Marker(location=(lat, lon), popup=folium.Popup(folium.element.IFrame(html=html, width=420, height=320), max_width=2000)).add_to(map)
Each time I open the saved "map.html" file in the browser and click on the marker, however, the popup shows an empty white rectangle without the image.
I even tried serving the file using "python3 -m http.server 8080" and navigating to the address "127.0.0.1:8080/map.html", but I still see just the empty white rectangle.
Note that the file "image.png" is in the same directory as the "map.html" file.
Could you please let me know what I might be doing wrong? I've now been stuck with this for a few hours.
Thanks!
I've been trying to add an image to a folium marker popup using the following command:
Each time I open the saved "map.html" file in the browser and click on the marker, however, the popup shows an empty white rectangle without the image.
I even tried serving the file using "python3 -m http.server 8080" and navigating to the address "127.0.0.1:8080/map.html", but I still see just the empty white rectangle.
Note that the file "image.png" is in the same directory as the "map.html" file.
Could you please let me know what I might be doing wrong? I've now been stuck with this for a few hours.
Thanks!