# viewer.flyTo with offset/headingnot working 2D

**URL:** <https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262>\
**Category:** CesiumJS\
**Created:** [March 8, 2017, 11:51am UTC](https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262 "2017-03-08T11:51:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus\_Rheinwald1](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@Klaus\_Rheinwald1](https://community.cesium.com/u/Klaus_Rheinwald1)\
**Post date:** [March 8, 2017, 11:51am UTC](https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262/1 "2017-03-08T11:51:03Z")

</div>

This piece of code rotates the view in 3D, but not in 2D. (zoomTodoesn’t work at all: [https://github.com/AnalyticalGraphicsInc/cesium/issues/2473](https://github.com/AnalyticalGraphicsInc/cesium/issues/2473) )

According to the documentation ‘In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the target will be the range. The heading will be determined from the offset. If the heading cannot be determined from the offset, the heading will be north.’

Any suggestions on how to rotate eh 2D-View?

---

<div class="post-metadata">

**Author:** ![Klaus\_Rheinwald1](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@Klaus\_Rheinwald1](https://community.cesium.com/u/Klaus_Rheinwald1)\
**Post date:** [March 8, 2017, 12:12pm UTC](https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262/2 "2017-03-08T12:12:26Z")

</div>

Found this workaround - not very nice as the view jumps into place, though.

---

<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:** [March 8, 2017, 3:24pm UTC](https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262/3 "2017-03-08T15:24:09Z")

</div>

Hello,

Glad you were able to find a workaround. I don’t have a better solution for now, but I did make a comment on that GitHub issue you linked to so we know how many people are running into this problem. I linked to your forum post so we can give you an update when we get a chance to look at it.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Klaus\_Rheinwald1](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@Klaus\_Rheinwald1](https://community.cesium.com/u/Klaus_Rheinwald1)\
**Post date:** [March 8, 2017, 8:49pm UTC](https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262/4 "2017-03-08T20:49:12Z")

</div>

Thansk, Hanna!

viewer.flyTo ignoring the heading in 2D seems to be a different issue, though.

Klaus

---

<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:** [March 9, 2017, 2:55pm UTC](https://community.cesium.com/t/viewer-flyto-with-offset-headingnot-working-2d/5262/5 "2017-03-09T14:55:23Z")

</div>

Thanks for clarifying Klaus. I added another comment to [https://github.com/AnalyticalGraphicsInc/cesium/issues/2473](https://github.com/AnalyticalGraphicsInc/cesium/issues/2473) saying that we need to rotate the map or keep heading north depending on the selected 2D map mode.

-Hannah
