iframe in popup leaflet

541 views
Skip to first unread message

John froeschke

unread,
Dec 9, 2015, 3:02:50 PM12/9/15
to Shiny - Web Framework for R
I'm using leaflet with shiny and trying to add a webpage in the popup using an iframe tag.  It works fine locally but does not work on the web.  Any ideas on how to make this work.  The relevent bit of code is below:



addPolygons
(data=MadisonSwanson, fillOpacity=0.5, stroke=FALSE,
            fillColor
='#66c2a5',
            popup
= ~ paste("<a><b>Madison and Swanson</a></b>",
                           
"Seasonal area closures implemented to protect Gulf reef fish",
                           
'<a href="http://sero.nmfs.noaa.gov/maps_gis_data/fisheries/gom/documents/madswan_steam_edges.txt" target="_blank">Federal regulations</a>',
                           
'<iframe src="http://sero.nmfs.noaa.gov/maps_gis_data/fisheries/gom/documents/madswan_steam_edges.txt"></iframe>',
                           sep
="<br/>"),
           
group="Madison and Swanson")  %>%

The app can be viewed here: https://gulfcouncilportal.shinyapps.io/reeffishmanagementareas.  Ideally, the page here: http://sero.nmfs.noaa.gov/maps_gis_data/fisheries/gom/documents/madswan_steam_edges.txt would display in the popup using something like this 

John froeschke

unread,
Dec 10, 2015, 11:27:05 AM12/10/15
to Shiny - Web Framework for R
Quick update.  I downloaded the files locally to the www folder and the popups work using the iframe tag.
 '<iframe src="madswan_steam_edges.txt"></iframe>'
Reply all
Reply to author
Forward
0 new messages