Capture Image for 2d Map

I am trying to capture an image from Cesium to use as on overlay on a 2d map. I am having trouble getting the points to line up when I place it on the other map. After some investigation seems that the rectangle isn’t quite right.

Here is the example I have.

Two problems I have run into:

  1. Calling Camera.setView after Camera.switchToOrthographicFrustum() throws an error.
  2. Calling Camera.switchToOrthographicFrustum() after setView leaves a border around the rectangle.

Any ideas on how to get the camera set up so that it exactly captures the rectangle?

Turns out there is an issue with the camera not working well with fitting rectangles in portrait mode.

Until the portrait issue is fixed I ended up working it by always setting the aspect ratio to landscape and the using the bounds of the view. Instead of trying to fit the view to know bounds.

1 Like