[openstreetmap/openstreetmap-website] Refactor more of the internal coordiante usage to `{ lat, lng }` (PR #7039)

Marwin Hochfelsner notifications at github.com
Sun Apr 26 16:27:04 UTC 2026


@hlfan commented on this pull request.



> @@ -141,7 +141,9 @@ L.OSM.Map = L.Map.extend({
     const params = {};
 
     if (marker && this.hasLayer(marker)) {
-      [params.mlat, params.mlon] = OSM.cropLocation(marker.getLatLng(), this.getZoom());
+      const { lat, lng } = OSM.cropLocation(marker.getLatLng(), this.getZoom());

I think destructuring could still work here:

```suggestion
      const { lat: params["mlat"], lng: params["mlon"] } = OSM.cropLocation(marker.getLatLng(), this.getZoom());
```

But it isn't as nice.

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

Message ID: <openstreetmap/openstreetmap-website/pull/7039/review/4177153706 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260426/320089b9/attachment.htm>


More information about the rails-dev mailing list