[openstreetmap/openstreetmap-website] Fix fixthemap note link (PR #5869)
Anton Khorev
notifications at github.com
Tue Apr 1 01:26:27 UTC 2025
Embed pages have links to the *fixthemap* page that have lat/lon/zoom params:

[Example link](https://www.openstreetmap.org/fixthemap?lat=53.25688279713156&lon=-1.4329004287719729&zoom=13)
*fixthemap* has an *Add a Note* section with a new note icon that is supposed to be a link:

But it's not a link because javascript writing it is broken. `zoom` is used as a string with `+` operator, concatenation happens instead of addition, and link generation fails.
This PR forces zoom to be a number inside `OSM.formatHash` which is used to generate a link.

Actually we don't need javascript to write new note links because lat/lon/zoom are available server-side, but I'm not changing that yet.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5869
-- Commit Summary --
* Add title to "add a note" link on fixthemap page
* Convert zoom to number in OSM.formatHash
-- File Changes --
M app/assets/javascripts/osm.js.erb (4)
M app/views/site/fixthemap.html.erb (3)
A test/system/fixthemap_test.rb (11)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5869.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5869.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5869
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5869 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250331/ab25e0c0/attachment.htm>
More information about the rails-dev
mailing list