diff --git a/CHANGES.md b/CHANGES.md index c682e4581a2..9752a2113cd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ Change Log ========== +### 1.62 - 2019-10-01 + +##### Fixes :wrench: +* `Camera.flyTo` flies to the correct location in 2D when the destination crosses the international date line [#7909](https://github.com/AnalyticalGraphicsInc/cesium/pull/7909) + ### 1.61 - 2019-09-03 ##### Additions :tada: diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4f6458c1e02..7c0a7eb5ce3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -222,6 +222,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Alexander Popiak](https://github.com/apopiak) * [Trubie Turner](https://github.com/flexei) * [Merijn Wijngaard](https://github.com/mwijngaard) +* [Michael Hayes](https://github.com/michaelhayes-dev) * [Dennis Adams](https://github.com/dennisadams) * [Hai Zhou](https://github.com/verybigzhouhai) * [Pascal Poulain](https://github.com/ppoulainpro) diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index e16cfe554c5..dd123a9f8f6 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -2392,12 +2392,20 @@ define([ var viewRectangle2DSouthWest = new Cartesian3(); function rectangleCameraPosition2D(camera, rectangle, result) { var projection = camera._projection; + + // Account for the rectangle crossing the International Date Line in 2D mode + var east = rectangle.east; if (rectangle.west > rectangle.east) { - rectangle = Rectangle.MAX_VALUE; + if(camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL) { + east += CesiumMath.TWO_PI; + } else { + rectangle = Rectangle.MAX_VALUE; + east = rectangle.east; + } } var cart = viewRectangle2DCartographic; - cart.longitude = rectangle.east; + cart.longitude = east; cart.latitude = rectangle.north; var northEast = projection.project(cart, viewRectangle2DNorthEast); cart.longitude = rectangle.west;