From 4bd74b01c70e125a437bb173fa4e02587d6262f9 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Wed, 5 Jun 2019 20:26:08 -0400 Subject: [PATCH 1/2] Implement flyTo improvement when rectangle crosses antimeridian --- CONTRIBUTORS.md | 1 + Source/Scene/Camera.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 99ca86db2caa..efff27318ca4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -208,3 +208,4 @@ 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) diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index e16cfe554c5e..dd123a9f8f62 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; From 1bf43b1614addc001fa2f4c3b7e92469b4519c3a Mon Sep 17 00:00:00 2001 From: hpinkos Date: Wed, 18 Sep 2019 12:10:15 -0400 Subject: [PATCH 2/2] CHANGES --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c682e4581a26..9752a2113cd4 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: