File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1023,9 +1023,19 @@ define([
10231023 result = new Cartesian3 ( ) ;
10241024 }
10251025
1026- var scalar = Cartesian3 . magnitude ( center ) + d ;
1027- Cartesian3 . negate ( direction , result ) ;
1028- return Cartesian3 . multiplyByScalar ( result , scalar , result ) ;
1026+ var mag = Cartesian3 . magnitude ( center ) ;
1027+ var scalar = mag + d ;
1028+
1029+ if ( mag < CesiumMath . EPSILON6 ) {
1030+ cart . longitude = ( east + west ) * 0.5 ;
1031+ cart . latitude = ( north + south ) * 0.5 ;
1032+ ellipsoid . cartographicToCartesian ( cart , center ) ;
1033+ Cartesian3 . normalize ( center , center ) ;
1034+ } else {
1035+ Cartesian3 . normalize ( center , center ) ;
1036+ }
1037+
1038+ return Cartesian3 . multiplyByScalar ( center , scalar , result ) ;
10291039 }
10301040
10311041 var viewExtentCVCartographic = new Cartographic ( ) ;
You can’t perform that action at this time.
0 commit comments