+ updateChangesetLocations: function (map) {
+ const mapCenterLng = map.getCenter().lng;
+
+ for (const changeset of this._changesets) {
+ const changesetSouthWest = changeset.bounds.getSouthWest();
+ const changesetNorthEast = changeset.bounds.getNorthEast();
+ const changesetCenterLng = (changesetSouthWest.lng + changesetNorthEast.lng) / 2;
+ const shiftInWorldCircumferences = Math.round((changesetCenterLng - mapCenterLng) / 360);
+
+ if (shiftInWorldCircumferences) {
+ changesetSouthWest.lng -= shiftInWorldCircumferences * 360;
+ changesetNorthEast.lng -= shiftInWorldCircumferences * 360;
+
+ this.getLayer(changeset.id)?.setBounds(changeset.bounds);
+ }
+ }
+ },
+