# odd issues with Camera.flyTo

**URL:** <https://community.cesium.com/t/odd-issues-with-camera-flyto/4037>\
**Category:** CesiumJS\
**Created:** [April 24, 2016, 6:20pm UTC](https://community.cesium.com/t/odd-issues-with-camera-flyto/4037 "2016-04-24T18:20:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Giraldo](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Mauricio\_Giraldo](https://community.cesium.com/u/Mauricio_Giraldo)\
**Post date:** [April 24, 2016, 6:20pm UTC](https://community.cesium.com/t/odd-issues-with-camera-flyto/4037/1 "2016-04-24T18:20:05Z")

</div>

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](http://pic.nypl.org/map):

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](http://pic.nypl.org/map/?address.AddressTypeID=*&address.CountryID=*&bbox=-93.0191_38.1137_-84.6534_44.3949&Nationality=*&gender.TermID=*&process.TermID=*&role.TermID=*&format.TermID=*&biography.TermID=*&collection.TermID=*&DisplayName=*&Date=*&mode=2) [fine](http://pic.nypl.org/map/?address.AddressTypeID=*&address.CountryID=*&bbox=-60.8432_-35.9038_-49.9033_-27.1420&Nationality=*&gender.TermID=*&process.TermID=*&role.TermID=*&format.TermID=*&biography.TermID=*&collection.TermID=*&DisplayName=*&Date=*&mode=2)
- if i have large eastern values it [seems](http://pic.nypl.org/map/?address.AddressTypeID=*&address.CountryID=*&bbox=10.5875_39.1192_34.3977_50.0679&Nationality=*&gender.TermID=*&process.TermID=*&role.TermID=*&format.TermID=*&biography.TermID=*&collection.TermID=*&DisplayName=*&Date=*&mode=2) to be [fine](http://pic.nypl.org/map/?address.AddressTypeID=*&address.CountryID=*&bbox=22.8143_-41.9068_152.8052_-1.1902&Nationality=*&gender.TermID=*&process.TermID=*&role.TermID=*&format.TermID=*&biography.TermID=*&collection.TermID=*&DisplayName=*&Date=*&mode=2)
- if i have small eastern values, especially in [southern Europe](http://pic.nypl.org/map/?address.AddressTypeID=*&address.CountryID=*&bbox=5.0169_43.1643_7.7059_44.0543&Nationality=*&gender.TermID=*&process.TermID=*&role.TermID=*&format.TermID=*&biography.TermID=*&collection.TermID=*&DisplayName=*&Date=*&mode=2), it fails, zooming to the [wrong place](http://pic.nypl.org/map/?address.AddressTypeID=*&address.CountryID=*&bbox=11.8169_41.8152_14.2474_43.0665&Nationality=*&gender.TermID=*&process.TermID=*&role.TermID=*&format.TermID=*&biography.TermID=*&collection.TermID=*&DisplayName=*&Date=*&mode=2)
- 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](https://github.com/NYPL/pic-app/blob/master/app/assets/javascripts/PIC.ts)) exposed

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [April 25, 2016, 2:31pm UTC](https://community.cesium.com/t/odd-issues-with-camera-flyto/4037/2 "2016-04-25T14:31:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mauricio\_Giraldo](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Mauricio\_Giraldo](https://community.cesium.com/u/Mauricio_Giraldo)\
**Post date:** [April 25, 2016, 6:02pm UTC](https://community.cesium.com/t/odd-issues-with-camera-flyto/4037/3 "2016-04-25T18:02:19Z")

</div>

seems to be fixed in 1.20

i had 1.19

thanks!
