2D Circle - drawn incorrectly?

Hi,
In the following sandcastle there is a green circle which is drawn by having the same minor and major axis in an ellipse:

However, when switching to 2D mode it does not look anymore like a circle:
image

I thought maybe this has something to do with the curvature of the earth, but the same things happens with very small radiuses as well…

I am building a 2D app which has to be able to dislplay a circle with given radius around given coordinates… what can I do?

Thank you

By default, the 2D mode uses a CartographicProjection. When you place some circles at different latitudes, then this is the result:

Cesium CartographicProjection

They will only be “perfect circles” when they are shown at the equator.

In contrast to that, when you are using the WebMercatorProjection, then it will look like this:

Cesium WebMercatorProjection

(Note that the size still appears to vary. There is no “right” way to map the surface of a sphere to a plane. There are only many different projections that are wrong in different ways…)

You can set that projection with

const viewer = new Cesium.Viewer("cesiumContainer", {
  mapProjection: new Cesium.WebMercatorProjection()
});

Here is a sandcastle for the last screenshot:

2 Likes

That makes sense.
Thank you!