[openstreetmap/openstreetmap-website] Fix incorrect z-order of dashboard map markers (fixes #6639) (PR #6654)

Marwin Hochfelsner notifications at github.com
Tue Dec 30 22:05:20 UTC 2025


@hlfan commented on this pull request.



> -          .setLngLat([user.lon, user.lat])
+        const lat = parseFloat(user.lat);
+        const lon = parseFloat(user.lon);

We shouldn't need to parse here as MapLibre casts again anyway.

> +    const markerObjects = [];
+
     $("[data-user]").each(function () {

Could we make this more pipeliney?

```javascript
const markerObjects = $("[data-user]")
  .filter(...)
  .map(...)
  .get();
```

> +      markerObjects.forEach((item) => {
+        const point = map.project([item.lon, item.lat]);
+        const zIndex = Math.round(point.y);
+        item.marker.getElement().style.zIndex = zIndex;
+      });

I don't really like that this assigns values in the hundreds for a few dozen markers.
Some method of ending up with a more sequential z-index list would be great.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6654/review/3619360851 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251230/31d6e619/attachment-0001.htm>


More information about the rails-dev mailing list