[openstreetmap/openstreetmap-website] Not all changesets shown in history view on low zoom levels (Issue #3423)

kallejre notifications at github.com
Sat Jan 15 14:33:58 UTC 2022


### URL

https://www.openstreetmap.org/history#map=1/0/0

### How to reproduce the issue?

To reproduce issue:
1. Got to OSM website
2. From the menu in top-left corner, select "History" (Ajalugu in attached screenshot)
3. Zoom out or adjust width of browser window until all continents are visible at least twice
4. (Optional): To make effects of the bug more clear, make sure that longitude of both edges of the map are approximately same

Issue: Only changesets from that very narrow gap are shown.
Expected behaviour: All changesets around the world are shown.

### Screenshot(s) or anything else?

The bug is caused by Leaflet's method `.wrap()` on [line 62 of history.js](https://github.com/openstreetmap/openstreetmap-website/blob/master/app/assets/javascripts/index/history.js#L62). The easiest fix is to simply remove said method because it's used for offsetting user's bbox of current viewport into valid latitude/longitude. However, function that processes the passed parameter in [changesets_controller.rb](https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/changesets_controller.rb#L90-L92) as of now uses simple number comparison to filter changesets and don't mind unusual bbox parameters. Bit more sophisticated fix is to add client-side bbox validation where too large bboxes would be clipped from -180/180 meridian. But bigger question is that since this issue was introduced as [single commit](https://github.com/openstreetmap/openstreetmap-website/commit/8fe5dbb92cec25467f1f1c23f65113c5e956a7ff) 8 years ago and not fixed since, is this a bug or an intentional feature to reduce server load?

I came across this bug while working on PR #3417 and had actually already fixed it there using the lazy method, but wanted to clarify if wrapping was intentional or it was added by accident.

Screenshot with sample of the issue (loaded bit more changesets than the default 20 to show the trend). Note the map boundaries.

![pilt](https://user-images.githubusercontent.com/22601238/149625106-1abe109f-9dd5-4557-a3ad-445f83a93feb.png)



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

Message ID: <openstreetmap/openstreetmap-website/issues/3423 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220115/f5e42e4a/attachment.htm>


More information about the rails-dev mailing list