Coordinates of Latitude and Longtitude different on Cesium vs real world?

282 views
Skip to first unread message

whatdidido

unread,
Dec 6, 2016, 9:27:43 PM12/6/16
to cesium-dev
Hello all,

I am running into a problem that I can't seem to find documentation on. I am trying to center the view around Australia (using the latitude and longitude of Sydney as a basis [-33.865143, 151.209900]).

When I enter those coordinates into

var viewer = new Cesium.Viewer('cesiumContainer');

viewer.camera.setView({
position : new Cesium.Cartesian3.fromDegrees(-33.865143, 151.209900, 1550.0)
});

the view centers around North America, barely any difference from the normal view that pops up in the "Hello World" example..

I even added a simple console.log at the end to check if all the code was being run and it was.
I suspect that the coordinate system for cesium is vastly different from the real world and I am not sure how to fix that...

Any help would be great.

I also tried the Cartographic way:

viewer.camera.setView({
positionCartographic : new Cesium.Cartographic(-33.865143, 151.209900, 1550.0)
});


That produced a similar result as the first one.

Hannah Pinkos

unread,
Dec 7, 2016, 12:56:53 AM12/7/16
to cesium-dev, hogl...@klinche.com
Hello,

Cesium uses (longitude, latitude), not (latitude, longitude).  Switching the coordinates fixes the problem.
Here is your updated example:

var viewer = new Cesium.Viewer('cesiumContainer');
viewer
.camera.setView({

    destination
: new Cesium.Cartesian3.fromDegrees(151.209900, -33.865143, 1550.0)
});


Best,

Hannah

hogl...@klinche.com

unread,
Dec 7, 2016, 6:56:32 PM12/7/16
to cesium-dev, hogl...@klinche.com
Ah thank you so much!!

I feel a little silly, I see that is noted on the documentation.
Reply all
Reply to author
Forward
0 new messages