Skip to content

Commit 26e4562

Browse files
committed
adjust satellite clip angle based on distance
1 parent efd9b14 commit 26e4562

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/plots/geo/constants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ exports.axesNames = ['lonaxis', 'lataxis'];
128128

129129
// max longitudinal angular span (EXPERIMENTAL)
130130
exports.lonaxisSpan = {
131-
'satellite': 120,
132131
'orthographic': 180,
133132
'azimuthal equal area': 360,
134133
'azimuthal equidistant': 360,

src/plots/geo/geo.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,9 @@ function getProjection(geoLayout) {
647647
var projFn = geo[projName] || geoProjection[projName];
648648
var projection = projFn();
649649

650-
var clipAngle = geoLayout._isClipped ?
651-
constants.lonaxisSpan[projType] / 2 :
652-
null;
650+
var clipAngle =
651+
projType === 'satellite' ? Math.acos(1 / projection.distance()) * 180 / Math.PI :
652+
geoLayout._isClipped ? constants.lonaxisSpan[projType] / 2 : null;
653653

654654
var methods = ['center', 'rotate', 'parallels', 'clipExtent'];
655655
var dummyFn = function(_) { return _ ? projection : []; };
209 Bytes
Loading

0 commit comments

Comments
 (0)