I created an Operations Dashboard with an Embedded Content window. In that window I have a WAB that automatically opens a widget to search for the nearest point feature. The WAB works fine on it's own; however, when I click the "Find My Location" icon on the widget, I receive the message "Geolocation has been disabled in this document by Feature Policy". On my mobile, I receive "User denied Geolocation".
I understand that you can fix this in an iframe by adding allow="geolocation" as per: https://community.esri.com/people/geonb_bernie/blog/2019/08/27/my-location-widget-and-iframes but how do I do this in an Operations Dashboard?
Thanks for your help!
British Columbia COVID-19 Collection Centre Dashboard is here: Experience
Hi Ben Arril,
Thanks for the post - I think the issue you present here is interesting because it looks like the Web AppBuilder app is embedded in the dashboard, then the dashboard is embedded in the web experience. I gave this a quick test on my end, and when accessing the My Location widget in the dashboard before embedding it in the web experience, I didn't see any issues. However when I add the dashboard to the web experience, I do see the issue you are describing.
I think this bug explains that issue: BUG-000129375: Creating a Web AppBuilder application using a Near M.. - if you are able to embed the web app directly in the web experience then the workaround might work here. We also have a similar issue logged for embedding apps that use the My Location widget in Hub sites. I would also be happy to facilitate getting a new issue logged specifically for your scenario, and we could get your account attached from our end.
Thanks Peter! I really appreciate you looking into this. We only use the experience builder to detect the screen resolution and then send the user to either a desktop version of the Ops Dash or a mobile optimized version. This is why I am unable to edit the iframe html as Ops Dash only gives me the option to input the URL.
Yes, please attach my account to the error. It sounds like we may have to forgo the experience builder option and just have users access either a mobile or desktop version of the Ops Dash.
I'm also having this issue with a WAB embedded in an Experience Builder site. I tried the custom code, but it kept creating margins/ borders around the WAB, disrupting the aesthetics of the site. Any other solutions to this?
You can check out the site here. I turned off the geolocate button for now and did not use the custom code.
Hi Charlotte Shade,
Looking at the bug linked above (BUG-000129375: Creating a Web AppBuilder application using a Near M.. ) I expect this will be resolved at the end-of-September ArcGIS Online update (8.3, listed as the version fixed in the bug). At that time you should not need to use the iFrame workaround to allow geolocation. In the meantime, is it possible that the margin/border around the web app can be mitigated by changing the dimensions of the iFrame width and height properties?
So today while working within WebApp Builder I had an app which requires the near me feature and needed this to embed on my own website.
I tried using the
allow = "geolocation"
And it still gave me that error.
I did some more digging on the Browser Devs forums and discovered a way which I think for anyone who faced the same challenges like I did today could also get things working.
I found out that you have to use it this way;
As as described in this post, grants access to all origins loaded within the iframe.