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:
- click “In Map Area”
- click “Select area on map”
- draw a bounding box on the map (it doesn’t refresh very well… working on it)
- click “Apply”
- 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