[openstreetmap/openstreetmap-website] Map Marker only shows when iframe loads on the host page load (Issue #3929)

Joheyy notifications at github.com
Fri Feb 10 15:51:22 UTC 2023


### URL

https://www.openstreetmap.org/export/embed.html?bbox=-21.777659654617313%2C64.09986306895152%2C-21.76714539527893%2C64.102761455032&layer=mapnik&marker=64.1013111281992%2C-21.77240252494812

### How to reproduce the issue?

1. Go to the main page and select something
2. Use the share functionality
3. Generate an iframe with the HTML button with marker enabled
4. Embed the iframe in some website
5. Cut out the src attribute
6. Set the src attribute some time later via javascript

As you can now see, the marker is not visible.

(It's the same behavior when opening the embed URL itself, see the URL that I have linked in this issue)

### Screenshot(s) or anything else?

I think this issue is significant since because of the GDPR I have to ask the user of my website for permission before loading the map.
So I - like every other EU citizen - can not just load it with the html file like it was intended.

My guess why this issue happens is that the function that fetches the marker and places it only gets called while loading the parent page. (Maybe the window.onload event)


Here is a comparison between the behavior of a html load:

![Screenshot from 2023-02-10 16-14-27](https://user-images.githubusercontent.com/44101694/218134457-0c41d763-2dfd-4819-a0ce-cc320d0145ac.png)


![Screenshot from 2023-02-10 16-14-41](https://user-images.githubusercontent.com/44101694/218134421-14790372-eb9d-4d90-9e6b-12cff1b368e3.png)


... and a javascript load

![Screenshot from 2023-02-10 16-26-56](https://user-images.githubusercontent.com/44101694/218134560-e888ba63-079a-4109-a0b1-679cdcd6ad38.png)


![Screenshot from 2023-02-10 16-21-26](https://user-images.githubusercontent.com/44101694/218134531-81b33751-529f-4faa-9a13-9feedfca2f42.png)


You can clearly see that in the javascript case there is no get request for the marker.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3929
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3929 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230210/e5727041/attachment-0001.htm>


More information about the rails-dev mailing list