From e218535c3f975cffc115e3cc29a4d09dfb1e4c8f Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 5 May 2025 12:47:43 +0300 Subject: [PATCH] Rename consts in updateChangesetLocations --- .../index/history-changesets-layer.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/index/history-changesets-layer.js b/app/assets/javascripts/index/history-changesets-layer.js index 619d36989..6015917e0 100644 --- a/app/assets/javascripts/index/history-changesets-layer.js +++ b/app/assets/javascripts/index/history-changesets-layer.js @@ -115,18 +115,18 @@ OSM.HistoryChangesetsLayer = L.FeatureGroup.extend({ }, _updateChangesetLocations: function (map) { - const mapCenterLng = map.getCenter().lng; + const mapViewCenterLng = map.getCenter().lng; for (const changeset of this._changesets.values()) { - const changesetNorthWest = changeset.bounds.getNorthWest(); - const changesetSouthEast = changeset.bounds.getSouthEast(); - const changesetCenterLng = (changesetNorthWest.lng + changesetSouthEast.lng) / 2; - const shiftInWorldCircumferences = Math.round((changesetCenterLng - mapCenterLng) / 360); + const changesetNorthWestLatLng = changeset.bounds.getNorthWest(); + const changesetSouthEastLatLng = changeset.bounds.getSouthEast(); + const changesetCenterLng = (changesetNorthWestLatLng.lng + changesetSouthEastLatLng.lng) / 2; + const shiftInWorldCircumferences = Math.round((changesetCenterLng - mapViewCenterLng) / 360); if (shiftInWorldCircumferences) { - changesetNorthWest.lng -= shiftInWorldCircumferences * 360; - changesetSouthEast.lng -= shiftInWorldCircumferences * 360; - changeset.bounds = L.latLngBounds(changesetNorthWest, changesetSouthEast); + changesetNorthWestLatLng.lng -= shiftInWorldCircumferences * 360; + changesetSouthEastLatLng.lng -= shiftInWorldCircumferences * 360; + changeset.bounds = L.latLngBounds(changesetNorthWestLatLng, changesetSouthEastLatLng); for (const layer of this._bboxLayers) { layer.updateChangesetLayerBounds(changeset); -- 2.39.5