Get user's current zoom level

I know I can get the user's magnitude to the core of earth, however is there a way to get the current zoom level?

I figure if there's no clustering:!topic/cesium-dev/_GTmHu7AWvo

then I can use the current zoom level to cluster a collection of PointPrimitives myself.


You can get the distance in meters between the camera and the ellipsoid surface like this:

var cameraPosition =;
var ellipsoidPosition = viewer.scene.globe.ellipsoid.scaleToGeodeticSurface(cameraPosition);
var distance = Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(cameraPosition, ellipsoidPosition, new Cesium.Cartesian3()));




Awesome, thanks Hannah


The code works great in 3D scene mode, but in SCENE2D return invalid results.
Should i use different calculation for geting the camera's heigth in this case?
Finally i want to calculate the map's scale represented in 2D view.

Best Regards,


Hello Dima,

The problem you’re seeing may be related to this issue:

positionWC seems like it might be the incorrect value in 2D. Hopefully we’ll look into this soon.



Hi Hannah,

For example, i have the zoom level range from 10 - 18 along with 10:20000m - 18:1000m of distance, so now if the camera is currently on 6000m of height, please help me to compute the zoom level of this height and what algorithm to compute it?


Hi Sang,

See this thread:!searchin/cesium-dev/zoom$20level|sort:relevance/cesium-dev/QG2EbfMl43k/YII7A7OwBwAJ

The ImageryLayer API will help you. For instance, you can use maximumLevel and minimumLevel to clamp the zoom levels used.

hope that helps,

  • Rachel