gravitystorm / openstreetmap-website

The Rails application powering OpenStreetMap
http://www.openstreetmap.org/
GNU General Public License v2.0
2 stars 1 forks source link

Refactor fixthemap to remove javascript and add tests #257

Open gravitystorm opened 1 year ago

gravitystorm commented 1 year ago

There's a feature on the fixthemap page that means you can link to it like this:

https://www.openstreetmap.org/fixthemap?lat=47.21776092401608&lon=8.524017333984375&zoom=13

... and the note icon will then get a link to the right place on the map. This is done by javascript after the page has loaded.

But the controller has access to this information too, and it can rework it and pass it to the view, so there's no need for it to be in javascript. So let's refactor it, since building links in javascript on pageload is quite unexpected.

It could also do with a test, since third-party pages rely on it working.