-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera flight path in 2D tries to fly through the map #804
Labels
Comments
Discovered while testing #803. |
Updated code example: var viewer = new Cesium.Viewer('cesiumContainer', { sceneMode : Cesium.SceneMode.SCENE2D });
var scene = viewer.scene;
var ellipsoid = scene.globe.ellipsoid;
function flyToExtent() {
var west = Cesium.Math.toRadians(-90.0);
var south = Cesium.Math.toRadians(38.0);
var east = Cesium.Math.toRadians(-87.0);
var north = Cesium.Math.toRadians(40.0);
var extent = new Cesium.Rectangle(west, south, east, north);
scene.camera.flyTo({
destination : extent
});
}
function viewAnExtent() {
var west = Cesium.Math.toRadians(-89.0);
var south = Cesium.Math.toRadians(38.5);
var east = Cesium.Math.toRadians(-88.0);
var north = Cesium.Math.toRadians(39.5);
var extent = new Cesium.Rectangle(west, south, east, north);
scene.camera.viewRectangle(extent, ellipsoid);
}
Sandcastle.addToolbarButton('View Extent', function() {viewAnExtent();});
Sandcastle.addToolbarButton('Fly to Extent', function() {flyToExtent();}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the current camera position is closer to the globe than the destination, and the current position is not directly in front of destination (the path isn't a straight zoom-out, it is offset in some direction), the camera flies through the map and generates an error of "right must be greater than left."
Sandcastle Example: Click 'Vew Extent' then 'Fly To Extent'
The text was updated successfully, but these errors were encountered: