Skip to content
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 positionCartographic not always updated in 2D? #2838

Closed
mramato opened this issue Jun 25, 2015 · 0 comments
Closed

Camera positionCartographic not always updated in 2D? #2838

mramato opened this issue Jun 25, 2015 · 0 comments

Comments

@mramato
Copy link
Contributor

mramato commented Jun 25, 2015

Run this code. In 2D mode, zooming in doesn't trigger the console message, you have to move the camera after zooming to get it to happen.

var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var lastHeight;
scene.preRender.addEventListener(function(){
    var camera = scene.camera;
    var height = camera.positionCartographic.height;
    if(lastHeight !== height) {
        //Camera height has changed
        console.log('New height: ' + height);
        lastHeight = height;
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant