0

I've successfully embedded the html where a popup appears with a text that one clicks and redirects to desired webpage with a jpg.

I want the popup to open the link automatically though. I don't want to click to be redirected to a new page to see the image. Below is my code:

for lt,ln,nm in zip(lat,lon,name):
    pp= folium.Html('<a href="'+str(nm)+' "target="_blank">'+ 'popup text' + '</a>', script=True)
    iframe = branca.element.IFrame(pp, width=430, height=420)

    popup = folium.Popup(iframe, max_width=2650, parse_html=True)
    folium.Marker(location=[lt,ln], popup=popup).add_to(map)
sentence
  • 8,213
  • 4
  • 31
  • 40
  • Then, do you want a marker with a link to a webpage? It is not clear your effective goal. Could you provide reproducible code? Moreover, what folium's version do you use? – sentence Jul 23 '20 at 10:12
  • I have the marker that has a popup with a link to webpage right now. that works fine. Instead of clicking the "pop up text" inside the popup when one clicks the marker to which redirects to the desired webpage I want instead for the webpage to open directly inside the popup when one clicks on the marker. I have the latest version of folium. – evawateva33 Jul 23 '20 at 18:11
  • Another Person has reproducible code and an example of what I'm trying to accomplish in this link yet it's not working for me : https://stackoverflow.com/questions/29535715/python-with-folium-how-can-i-embed-a-webpage-in-the-popup – evawateva33 Jul 23 '20 at 18:17
  • I was wondering if there is some function that will automatically open the url within the popup somehow... I have 70 images I have to mark that i can click right now that opens a popup with a text that says "popup text" that i click to redirect to the webpage with the image i want. but i want the popup to open the link instead of clicking the text. or else i have to download all 70 images into a folder to access directly, which i really want to refrain from doing if i can help it. – evawateva33 Jul 23 '20 at 18:24

0 Answers0