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

Anton Khorev notifications at github.com
Mon Mar 10 15:07:38 UTC 2025


@AntonKhorev commented on this pull request.



> @@ -80,6 +80,11 @@ OSM = {
 
     const hash = OSM.parseHash(location.hash);
 
+    const geoURI = Object.fromEntries(new URLSearchParams(
+      params.geouri?.replaceAll(/[?;]/g, "&")?.replace(":", "=")

`new URL()` is going to help you to get `z` and to get everything between `geo:` and `?` without writing things like `slice(4)`.

Do you plan to show the uncertainty? Because if not, maybe you don't need `u`. And if you need `u`, surely there's a simpler regexp just for `u` than `/;([\w-]+)=([\w-.!~*'()[\]:&+$%]+)/g`.

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

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


More information about the rails-dev mailing list