Skip to content

Commit 514cdcf

Browse files
committed
Fix longitudes outside [-180°, 180°].
1 parent 091f389 commit 514cdcf

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

d3.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6372,8 +6372,14 @@
63726372
}
63736373
}
63746374
function d3_geo_rotation(δλ, δφ, δγ) {
6375-
return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_equirectangular;
6375+
return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
63766376
}
6377+
function d3_geo_identityRotation(λ, φ) {
6378+
return [ λ > π ? λ - 2 * π : λ < -π ? λ + 2 * π : λ, φ ];
6379+
}
6380+
d3_geo_identityRotation.invert = function(x, y) {
6381+
return [ x, y ];
6382+
};
63776383
function d3_geo_forwardRotationλ(δλ) {
63786384
return function(λ, φ) {
63796385
return [ (λ += δλ) > π ? λ - 2 * π : λ < -π ? λ + 2 * π : λ, φ ];

0 commit comments

Comments
 (0)