[openstreetmap/openstreetmap-website] Antimeridian wraparound flashing fix (PR #7341)

leijurv notifications at github.com
Tue Aug 25 18:48:11 UTC 2026


### Description

Fix the screen flashing to black for about 250ms when panning across ±180°.

I noticed this while working on [this](https://github.com/openstreetmap-carto/openstreetmap-carto/issues/3504#issuecomment-5401977453) issue.

Before
<img width="780" height="467" alt="before" src="https://github.com/user-attachments/assets/664d128e-93b0-4bb0-99c0-f009bf71333e" />

After
<img width="780" height="467" alt="after" src="https://github.com/user-attachments/assets/98b930ce-4c9b-4ad1-b2fd-610e2e6464d2" />

<details><summary>Higher quality screen recordings (click to expand)</summary>


https://github.com/user-attachments/assets/6dd08ae8-ccca-47cd-84c1-2339d43c4c76


https://github.com/user-attachments/assets/e0e6f92f-0f11-442e-83af-81e897e857be

</details>

### Why not Leaflet?

The immediate question is "why implement this here, with a `_onPreDragWrap` listener like this? why not fix it in Leaflet as suggested [here](https://github.com/openstreetmap/openstreetmap-website/issues/1153#issuecomment-183646654)"? Answer:

1. Leaflet has been aware of this for over a decade: https://github.com/Leaflet/Leaflet/issues/4141
2. And it is challenging to make a generic solution. IvanSanchez, who is the second-most prolific human committer to Leaflet, said `I'm unsure if this can be solved gracefully.` the last time this was brought up with specific reference to openstreetmap.org: https://github.com/Leaflet/Leaflet/issues/9878#issuecomment-3287116479

### How has this been tested?

Verified visually, and with unit tests. Please see screen recordings above. You may also try it yourself at https://osm.leijurv.com/


You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/7341

-- Commit Summary --

  * antimeridian wraparound

-- File Changes --

    M app/assets/javascripts/application.js (1)
    A app/assets/javascripts/leaflet.worldcopy.js (74)
    A test/javascripts/leaflet_worldcopy_test.js (54)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/7341.patch
https://github.com/openstreetmap/openstreetmap-website/pull/7341.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/7341 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260825/08f8aa0c/attachment.htm>


More information about the rails-dev mailing list