AnsweredAssumed Answered

map in iframe in open data/hub page not functioning as expected

Question asked by gmcnamee_usfs on Oct 10, 2017
Latest reply on Oct 10, 2017 by gmcnamee_usfs

I'm a new to this so if I missed something obvious here, go easy on me. 


I'm creating a page with with an ArcGIS Online Open Data site. The Layout Builder within the Page Editor allows you to add an iframe. I wanted to add a map of US State that was clickable. Initially I pointed it to a web map stored in AGO, using the share link. That worked fine. I wanted a bit more functionality than available in a simple web map. Specifically I wanted each state polygon to highlight on hover and when you click the state I wanted it to search the open data site by state name. So I pieced together the attached code using the JavaScript API and some tutorials. (I changed the search url to search google because my open data site is not shared publicly yet). The code seems to work. I hosted the html file on one of our servers, and it works fine. (But I can't share here because it's not in production). But it works, and is an exact copy of the code attached, except for the google part.


When I point iframe URL in the Settings of the Page Editor to the html file's url, nothing is displayed. It says specifically not to add the iframe code, but a url in the tutorial online. So my thought was to create an iframe in an html file that points to the map created by the attached code. Something like this:


<iframe width="100%" height="400" src="https://www.mysite.blah/OpenData/RegionSelectMap.html" frameborder="0">


I did that, but still nothing displays. Now I'm not sure what to do.


So how do I make the map I create in the attached file, show up in an iframe in an open data site page?


Any help would be appreciated.