Open mramato opened 9 years ago
Perhaps range is a typo, should be roll instead? I don't see range anywhere in the setView function. Though pitch and roll in 2D always use defaults looking at the code. However I don't see how having an unused property would cause it not to function at all, or just the orientation is off perhaps?
Yes, range is a typo (which I've now fixed), but it has no bearing on the actual issue, since roll just defaults to 0 anyway when not specified.
There may be a problem with position. I made a sandcastle example to factor out orientation and z position issues (position.z 0 seems to cause clipping issues.)
var viewer = new Cesium.Viewer('cesiumContainer', {
sceneMode : Cesium.SceneMode.SCENE2D
});
viewer.scene.camera.setView({
position : Cesium.Cartesian3.fromDegrees(88, 0, 27e6),
});
var camera = viewer.camera;
camera.direction.x=0;camera.direction.y=0;camera.direction.z=-1;
camera.right.x=1;camera.right.y=0;camera.right.z=0;
camera.up.x=0;camera.up.y=1;camera.up.z=0;
if(camera.position.z<100){camera.position.z+=100;}
Entering various lon/lat values yields strange results.
It takes time for camera._this mode to change from 3 to 2. Add these lines to the end of the above sandcastle app
console.log(camera._mode);
setTimeout(function(){ console.log(camera._mode); }, 1000);
Here's one where does setView 1 second later, and it functions properly:
var viewer = new Cesium.Viewer('cesiumContainer', {
sceneMode : Cesium.SceneMode.SCENE2D
});
setTimeout(function(){
viewer.scene.camera.setView({
position : Cesium.Cartesian3.fromDegrees(88, 0, 27e6)
});
}, 1000);
I was trying to zoom to lla
88, 0, 27e6
in 2D mode and neither of the below calls work (each on their own should accomplish the task.Doesn't work
Does the same thing as above (Doesn't work either)