python-visualization/branca

Branca HTML iFrame width in percentage not working

tayyabvohra opened this issue · 1 comments

When I am applying the width in percentage the popup is not working but when giving in the numbers it is working

    html = fancy_html(i)
    iframe = branca.element.IFrame(html=html,width='100%',height='40%',ratio='20%')
    popup = folium.Popup(iframe,parse_html=True)

when accessing with the width numbers value it is working

    html = fancy_html(i)
    iframe = branca.element.IFrame(html=html,width='200',height='40%',ratio='20%')
    popup = folium.Popup(iframe,parse_html=True)

Looks like there's a restriction that if you embed an iframe in a popup, you have to give the iframe a certain width in pixels. That's probably because the Leaflet popup container doesn't set a certain width, but depends on its content to set it. I don't think there's anything to fix here, so I'll close the issue.