[openstreetmap/openstreetmap-website] Preserve hash for map element navigation (PR #7220)

Vincent Wong notifications at github.com
Sat Jul 11 06:42:17 UTC 2026


@Vectorial1024 commented on this pull request.



> @@ -204,6 +204,7 @@ OSM.Router = function (map, rts) {
     const clickEvent = new (event.constructor)("click", eventOptions);
     const link = document.createElement("a");
     link.href = href;
+    link.hash = location.hash;

If the URL only says `note/0000000` without zoom layer, then the webpage has the right (and "should" too, given that we are using URL fragments to control the UI) to reset zoom level as soon as the map note is clicked. Then, before this PR, not doing so is actually a bug. But we all know claiming "reset zoom level on click" as "intended behavior" is absurd, so the prior statement "lose info when clicking" must be unwanted.

(reductio ad absurdum)

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

Message ID: <openstreetmap/openstreetmap-website/pull/7220/review/4676871260 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260710/86796760/attachment.htm>


More information about the rails-dev mailing list