@AntonKhorev commented on this pull request.


> @@ -93,6 +100,11 @@ OSM = {
       mapParams.lon = params.get("mlon");
       mapParams.lat = params.get("mlat");
       mapParams.zoom = params.get("zoom") || 12;
+    } else if (geoURI.has("geo") && geoURI.has("u") && !geoURI.has("z")) {
+      mapParams.bounds = 
L.latLng(geoURI.get("geo").split(",")).toBounds(geoURI.get("u") * 4);
+    } else if (geoURI.has("geo")) {
+      [mapParams.lat, mapParams.lon] = geoURI.get("geo").split(",");
+      mapParams.zoom = geoURI.getAll("z").reduce((out, cur) => parseInt(cur, 
10) || out, 12);

Because you won't give up on merging different parameters, you are:
- reading zoom off the geouri parameters, despite it's not defined there and 
you can't know what it means if you find it
- treating 0 as an invalid zoom value
- reading `u` from url parameters, again not knowing what it means; try 
`geo:60,30?u=no`

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/5736/review/2753090...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to