Get the most north/south/east/westbound coordinates of map

Hello Cesium,

Was wondering if there is a way for Cesium to determine what the most northbound, southbound, eastbound and westbound coordinates of the globe are visually?

I am trying to create a bounding box that contains these values.

The way I would do it is to use the Camera.PickEllipsoid function, providing the top left x,y screen coordinates to obtain west/northbound and bottom right x,y screen coordinates to obtain east/southbound lon/lat.

This, however, fails when the map is zoomed out to the point that the map does not cover the entire browser window.

Any tips/help is appreciated! If I am unclear with my explanation, please let me know and I will clarify.

Cesium version: 1.29
Windows 7
Firefox Version: 51.0 (64 bit)
Chrome Version: 56.0.2924.87 (64 bit)

Thanks!

Hello,

You can use the function Camera.getRectangleCameraCoordinates to get the portion of the globe that is currently in view by the camera.

Best,

Hannah

Hi Hannah,

Thank you for showing me this method. I must have overlooked it.
I am unsure how to use Camera.getRectangleCameraCoordinates to retrieve what I need though.

From what I understand, the argument this method requires (rectangle) is actually what I need returned.

The method states it returns a Cartesian3.

Please correct me if I'm wrong.

Thanks!

Oh sorry! I was thinking of the wrong function. Here’s the one you actually want: Camera.computeViewRectangle
That will give you the visible rectangle.

-Hannah