I'm having trouble with moving camera to show some rectangle. I have rectangle/polygon coordinates and would like to move camera so that it shows the entire rectangle on screen. Consider the following sandcastle example:
var viewer = new Cesium.Viewer('cesiumContainer');
Sandcastle.addToolbarButton('Fly to', function(){
var rectangle = new Cesium.Rectangle(0.1485961502596944, 0.823228424579245, 0.1486927730733333, 0.8232981854516427);
viewer.camera.flyTo({
destination: rectangle
});
});
It works well on WGS84 ellipsoid (pressing the button zooms to target rectagle), but when I switch to STK World terrain mesh the camera crashes through the ground.
Is there a way to display rectangle on terrain when I only know its coordinates and not height?