odd issues with Camera.flyTo

I have an updateBounds function like this one:

    updateBounds () {
        var west = this.bounds[2];
        var south = this.bounds[3];
        var east = this.bounds[0];
        var north = this.bounds[1];
        this.viewer.camera.flyTo({
            destination : Cesium.Rectangle.fromDegrees(west, south, east, north),
            duration : 1
        });
        this.notifyRepaintRequired();
    }

``

you can test it here:

  1. click “In Map Area”
  2. click “Select area on map”
  3. draw a bounding box on the map (it doesn’t refresh very well… working on it)
  4. click “Apply”
  5. you can clear a selection by clicking “In Map Area” and then selecting “Any”
    the current object contains a bounds property which is an array with [east, north, west, south] values
  • if i have western bounding boxes, it works fine
  • if i have large eastern values it seems to be fine
  • if i have small eastern values, especially in southern Europe, it fails, zooming to the wrong place
  • note: the bounds itself is not the white rectangle but the bounds of the visible dots
    what is going on? is there any extra math i need to take into consideration for eastern longitudes?

you can debug it by looking at the values via the console inspector. there is a _pic object you can access that has the _pic.bounds and the _pic.updateBounds() (and all other functions) exposed

Hello,

We recently fixed a flyTo rectangle but where it was flying to the wrong location. The fix will be included in the 1.21 release, available on May 2.

If you are still seeing the problem in the new release, let me know and I’ll take a look at it.

Best,

Hannah

seems to be fixed in 1.20

i had 1.19

thanks!