[openstreetmap/openstreetmap-website] Fix incorrect z-order of dashboard map markers (fixes #6639) (PR #6654)
Anshul Zilpe
notifications at github.com
Thu Dec 25 09:25:44 UTC 2025
### Description
Fixes #6639
The dashboard map markers were previously rendered in the order they appeared in the DOM (which matches the text list order). This caused visual z-order issues where "Northern" markers (background) were sometimes drawn on top of "Southern" markers (foreground) if they appeared later in the list.
This PR fixes the issue by:
1. Collecting all user data from the DOM first.
2. Sorting the users by latitude in descending order (North to South).
3. Adding the markers to the map in this sorted order.
This ensures that Northern markers are always rendered first (in the background) and Southern markers are rendered last (in the foreground), preserving the correct visual perspective.
**Screenshot (After Fix):**
<img width="1023" height="557" alt="image (2)" src="https://github.com/user-attachments/assets/0673fa49-bab9-4bea-bfb7-c3c9c2f28a98" />
### How has this been tested?
I tested this locally in the development environment:
1. Created two users with overlapping coordinates using the Rails console:
* **User A (Friend):** Latitude `51.501` (North)
* **User B (Me):** Latitude `51.5` (South)
2. Verified on the Dashboard map that **User B (South)** is correctly drawn **in front of** User A (North).
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/6654
-- Commit Summary --
* Fix incorrect z-order of dashboard map markers (fixes #6639)
-- File Changes --
M app/assets/javascripts/dashboard.js (18)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/6654.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6654.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6654
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6654 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251225/111b6d5b/attachment-0001.htm>
More information about the rails-dev
mailing list