@hlfan 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;
Not entirely,
- replaceAll takes the decimal places
- and this / 0.6 - 2 is close enough to the inverse of `OSM.zoomPrecision()`
I removed `Math.round(...)` to make this more clear.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5736#discussion_r1991848793
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5736/review/2679105...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev