[openstreetmap/openstreetmap-website] Reuse bounds size functions (PR #6076)

Anton Khorev notifications at github.com
Sun Jun 15 05:31:59 UTC 2025


@AntonKhorev commented on this pull request.



> @@ -369,6 +368,14 @@ L.extend(L.Icon.Default.prototype, {
   }
 });
 
+OSM.boundsArea = function ([[minLat, minLon], [maxLat, maxLon]]) {
+  const height = maxLat - minLat;
+  let width = maxLon - minLon;
+
+  if (width < 0) width += 360;

This fix is specific to what Overpass returns. You want to put it into a generic area calculation. Do you think it's going to work for all possible bounding boxes?

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

Message ID: <openstreetmap/openstreetmap-website/pull/6076/review/2928989773 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250614/2d8b3f47/attachment.htm>


More information about the rails-dev mailing list