umap icon indicating copy to clipboard operation
umap copied to clipboard

GPS doesn't work in iframe element

Open panosalevropoulos opened this issue 4 years ago • 1 comments
trafficstars

GPS works fine on umap instances but has no effect when the map is embedded in a website with iframe.

panosalevropoulos avatar Apr 08 '21 23:04 panosalevropoulos

Hi, I have the same problem, GPS works fine on map but when the map is embedded in a website with iframe, the button doesn't work. Please, help us to fix it 😄

hugomymaps avatar Sep 02 '22 09:09 hugomymaps

Could you share a link where to reproduce the issue ?

yohanboniface avatar May 11 '23 09:05 yohanboniface

@yohanboniface https://saloni.ca/

panosalevropoulos avatar May 11 '23 10:05 panosalevropoulos

Firefox displays an error: Capture d’écran, le 2023-05-11 à 11 14 51

Safari is more verbose: Capture d’écran, le 2023-05-11 à 11 16 04

I would say we need to explicitly allow the geolocation as a feature policy for the iframe: https://udn.realityripple.com/docs/Web/HTTP/Headers/Feature-Policy/geolocation

@panosalevropoulos can you try to change from:

<iframe frameborder="0" allowfullscreen="" src="[https://umap.openstreetmap.fr/en/map/thessaloniki-lost-city-_663542#16/40.6330/22.9465?scaleControl=true&amp;miniMap=false&amp;scrollWheelZoom=true&amp;zoomControl=true&amp;allowEdit=false&amp;moreControl=true&amp;searchControl=true&amp;tilelayersControl=false&amp;embedControl=false&amp;datalayersControl=true&amp;onLoadPanel=caption&amp;captionBar=true](view-source:https://umap.openstreetmap.fr/en/map/thessaloniki-lost-city-_663542#16/40.6330/22.9465?scaleControl=true&miniMap=false&scrollWheelZoom=true&zoomControl=true&allowEdit=false&moreControl=true&searchControl=true&tilelayersControl=false&embedControl=false&datalayersControl=true&onLoadPanel=caption&captionBar=true)"></iframe>

To:

<iframe allow="geolocation" frameborder="0" allowfullscreen="" src="[https://umap.openstreetmap.fr/en/map/thessaloniki-lost-city-_663542#16/40.6330/22.9465?scaleControl=true&amp;miniMap=false&amp;scrollWheelZoom=true&amp;zoomControl=true&amp;allowEdit=false&amp;moreControl=true&amp;searchControl=true&amp;tilelayersControl=false&amp;embedControl=false&amp;datalayersControl=true&amp;onLoadPanel=caption&amp;captionBar=true](view-source:https://umap.openstreetmap.fr/en/map/thessaloniki-lost-city-_663542#16/40.6330/22.9465?scaleControl=true&miniMap=false&scrollWheelZoom=true&zoomControl=true&allowEdit=false&moreControl=true&searchControl=true&tilelayersControl=false&embedControl=false&datalayersControl=true&onLoadPanel=caption&captionBar=true)"></iframe>

(allow="geolocation" added)

davidbgk avatar May 11 '23 15:05 davidbgk

@davidbgk I added allow="geolocation" but it doesn't seem to work.

panosalevropoulos avatar May 13 '23 17:05 panosalevropoulos

@panosalevropoulos did you do it on https://saloni.ca/ because I cannot see the modification?

davidbgk avatar May 13 '23 17:05 davidbgk