Embed pages have links to the *fixthemap* page that have lat/lon/zoom params:
![image](https://github.com/user-attachments/assets/32f4ac9c-0dc8-4311-a48b-ac5dab3ebbcf)

[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:
![image](https://github.com/user-attachments/assets/e6286464-d694-4864-9e12-0ddb21c23c8d)

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.
![image](https://github.com/user-attachments/assets/f23548aa-257d-4201-8305-99d6c5bfdd29)

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/5...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to