I would like to use flyTo() and provide a lat long co-ordinate but keep the camera at the same height / zoom / distance from the surface as it currently is.
I've tried to use the camera.position.z in my call to flyTo but this seems to zoom in further and further on each call to flyTo().
Does anyone know how to achieve this?
I found the way to solve the problem.
You need to take the camera's cartographic position via:
var currentPosition = viewer.camera.positionCartographic;
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(50.0, 5.0, currentPosition.height)
});
have you tried setting maximumHeight?
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var height = 500000;
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(50.0, 5.0, height)
});
setTimeout(function() {
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(-117.16, 32.71, height),
maximumHeight: height
});
}, 2000);
http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=674299ee1a1bffffdc3a042018aadd2a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With