Support unwrapped bbox values in changeset history queries #5473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3423.
How narrow this area is depends on zoom and map view width. It's an area between wrapped left and (independently) wrapped right longitude bounds because:
It's not Leaflet's method. Maybe it existed previously in Leaflet and was removed, but we added it again in f612f57. Implementing wrap on
L.LatLngBounds
by wrapping its corners independently is not going to give correct results in a general case.It's not difficult to write the logic without clipping. Unfortunately
BoundingBox.from_bbox_params
insists on clipping, that's why I'm not usingBoundingBox
.I don't think that the current behavior reduces server load. The more changesets you filter out, the longer you have to scan the table. If the current implementation filters out changesets that shouldn't have been filtered out, it slows down the server.
This PR fixes only how changesets are selected by the
/history
page based on the current view area, which gets translated into thebbox
parameter. It doesn't change how bboxes are displayed, which needs further fixing. When you zoom out, you can see the same place on the map several times. If there's a changeset, it also needs to be rendered several times. That usually doesn't matter much because you can see one of its renderings. But that doesn't work if you zoom in close to the date line. Only one side is going to be visible on the map. On the other hand the list in the sidebar should be correct.