You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When given coordinates for a rectangle that crosses the International Date Line (IDL), Rectangle.fromDegrees switches East and West. (Related to 7909, but not fixed by it).
Example:
`var viewer = new Cesium.Viewer('cesiumContainer', {sceneMode: Cesium.SceneMode.SCENE2D});
var west = -160, east = 160, north = 20, south = -20;
var pts = [[west,north], [east,north], [east,south], [west,south]];
var rectFromArray = Cesium.Rectangle.fromCartesianArray(Cesium.Cartesian3.fromDegreesArray(pts.flat()));
var rectFromDegrees = Cesium.Rectangle.fromDegrees(west, south, east, north);
From the log, you will see that rectFromArray shows the western edge to be just west of the IDL and the eastern edge to be just east of the IDL, but rectFromDegrees shows the opposite.
From the calls to camera.flyTo, it begins by correctly flying to the small area bound by west, south, east & north, but using those same coordinates for rectFromDegrees, it flies to all of the map EXCEPT the area bound by west, south, east & north.
The text was updated successfully, but these errors were encountered:
When given coordinates for a rectangle that crosses the International Date Line (IDL), Rectangle.fromDegrees switches East and West. (Related to 7909, but not fixed by it).
Example:
`var viewer = new Cesium.Viewer('cesiumContainer', {sceneMode: Cesium.SceneMode.SCENE2D});
var west = -160, east = 160, north = 20, south = -20;
var pts = [[west,north], [east,north], [east,south], [west,south]];
var rectFromArray = Cesium.Rectangle.fromCartesianArray(Cesium.Cartesian3.fromDegreesArray(pts.flat()));
var rectFromDegrees = Cesium.Rectangle.fromDegrees(west, south, east, north);
console.log('rectFromArray', rectFromArray);
console.log('rectFromDegrees', rectFromDegrees);
viewer.scene.camera.flyTo({destination: rectFromArray});
setTimeout(() => {
viewer.scene.camera.flyTo({destination: rectFromDegrees});
}, 5000);`
From the log, you will see that rectFromArray shows the western edge to be just west of the IDL and the eastern edge to be just east of the IDL, but rectFromDegrees shows the opposite.
From the calls to camera.flyTo, it begins by correctly flying to the small area bound by west, south, east & north, but using those same coordinates for rectFromDegrees, it flies to all of the map EXCEPT the area bound by west, south, east & north.
The text was updated successfully, but these errors were encountered: