From 7987ea33809dd33c4e620afee451881c7d8d834e Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 5 May 2025 12:28:27 +0300 Subject: [PATCH] Switch to NorthWest/SouthEast corners in updateChangesetLocations --- .../javascripts/index/history-changesets-layer.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index/history-changesets-layer.js b/app/assets/javascripts/index/history-changesets-layer.js index 2f762e0d6..5176f897e 100644 --- a/app/assets/javascripts/index/history-changesets-layer.js +++ b/app/assets/javascripts/index/history-changesets-layer.js @@ -118,14 +118,15 @@ OSM.HistoryChangesetsLayer = L.FeatureGroup.extend({ const mapCenterLng = map.getCenter().lng; for (const changeset of this._changesets.values()) { - const changesetSouthWest = changeset.bounds.getSouthWest(); - const changesetNorthEast = changeset.bounds.getNorthEast(); - const changesetCenterLng = (changesetSouthWest.lng + changesetNorthEast.lng) / 2; + const changesetNorthWest = changeset.bounds.getNorthWest(); + const changesetSouthEast = changeset.bounds.getSouthEast(); + const changesetCenterLng = (changesetNorthWest.lng + changesetSouthEast.lng) / 2; const shiftInWorldCircumferences = Math.round((changesetCenterLng - mapCenterLng) / 360); if (shiftInWorldCircumferences) { - changesetSouthWest.lng -= shiftInWorldCircumferences * 360; - changesetNorthEast.lng -= shiftInWorldCircumferences * 360; + changesetNorthWest.lng -= shiftInWorldCircumferences * 360; + changesetSouthEast.lng -= shiftInWorldCircumferences * 360; + changeset.bounds = L.latLngBounds(changesetNorthWest, changesetSouthEast); for (const layer of this._bboxLayers) { layer.updateChangesetLayerBounds(changeset); -- 2.39.5