flyTo vs setView maximum zoom in 2d mode

35 views
Skip to first unread message

jo...@axismaps.com

unread,
Aug 29, 2016, 11:06:40 AM8/29/16
to cesium-dev
Does camera.flyTo have a maximum zoom it supports? Looking at the below Sandcastle code, it seems like it is maxed at 40 million units while setView can go higher.

var viewer = new Cesium.Viewer('cesiumContainer', { sceneMode : Cesium.SceneMode.SCENE2D });

Sandcastle.addToolbarButton('flyTo', function() {
    viewer.camera.flyTo({
      destination: Cesium.Cartesian3.fromDegrees(0, 0, 60000000),
      duration: 0.5
    });

    setTimeout(function () {
        var position = viewer.camera.positionCartographic;
        console.log(position.height);
    }, 1000);
});

Sandcastle.addToolbarButton('setView', function() {
    viewer.camera.setView({
      destination: Cesium.Cartesian3.fromDegrees(0, 0, 60000000)
    });

    setTimeout(function () {
        var position = viewer.camera.positionCartographic;
        console.log(position.height);
    }, 1000);
});

I tried setting camera.maximumZoomFactor to 100, but that didn't seem to do anything in regards to the max flyTo can go to.

Hannah Pinkos

unread,
Aug 29, 2016, 11:30:25 AM8/29/16
to cesium-dev
Hello,

This looks like a bug in Cesium.  setView is moving the camera further away from the map than it's supposed to.  flyTo has the correct behavior.
I've filed an issue on our GitHub so we can fix the problem: https://github.com/AnalyticalGraphicsInc/cesium/issues/4246

Thanks!

Hannah
Reply all
Reply to author
Forward
0 new messages