[openstreetmap/openstreetmap-website] Add PWA geo protocol handler (PR #5736)

Anton Khorev notifications at github.com
Wed Mar 12 15:19:40 UTC 2025


@AntonKhorev commented on this pull request.



> @@ -100,6 +106,9 @@ OSM = {
       mapParams.lon = params.mlon;
       mapParams.lat = params.mlat;
       mapParams.zoom = params.zoom || 12;
+    } else if (geoURI.pathname) {
+      [mapParams.lat, mapParams.lon] = geoURI.pathname.split(",");
+      mapParams.zoom = geoURI.searchParams?.get("z") || Math.round(geoURI.pathname.replaceAll(/,?[-\d]+\./g, "").length / 0.6) - 2;

Is `Math.round(...)` the inverse of `OSM.zoomPrecision()`?

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

Message ID: <openstreetmap/openstreetmap-website/pull/5736/review/2678918345 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250312/ea97ef95/attachment.htm>


More information about the rails-dev mailing list