@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/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to