# How to get the level of the current viewport?

**URL:** <https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501>\
**Category:** Cesium for Unreal\
**Created:** [December 4, 2023, 6:58am UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501 "2023-12-04T06:58:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![IndigoYun](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/indigoyun/32/11245_2.png) [@IndigoYun](https://community.cesium.com/u/IndigoYun)\
**Post date:** [December 4, 2023, 6:58am UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501/1 "2023-12-04T06:58:37Z")

</div>

Hi Cesium team,I want to get the level of the current viewport. perhaps this level is the RasterOverlay’s level. like this:

 ![微信图片_20231204144922](https://global.discourse-cdn.com/cesium/original/3X/f/3/f3a4a0388090dd9f8694fed5dc9fa8b9055fbb98.png)  
but I find the code :  
 ![20231204145231](https://global.discourse-cdn.com/cesium/original/3X/8/5/856477273449dfbc5e75987795061b8a57e0c6da.png)  
this is calculated in this way too difficult for me,Is there a simpler way to get it, For example, compute it based on the current camera height，thanks ！

---

<div class="post-metadata">

**Author:** ![IndigoYun](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/indigoyun/32/11245_2.png) [@IndigoYun](https://community.cesium.com/u/IndigoYun)\
**Post date:** [December 4, 2023, 7:09am UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501/2 "2023-12-04T07:09:32Z")

</div>

This “level” is crucial for me, as I need it to build my model, and the appearance of the model is transformed based on it. Is there any additional method to obtain it?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [December 4, 2023, 10:27am UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501/3 "2023-12-04T10:27:05Z")

</div>

Different parts of the scene will have different levels. There’s no single level across the scene.

---

<div class="post-metadata">

**Author:** ![IndigoYun](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/indigoyun/32/11245_2.png) [@IndigoYun](https://community.cesium.com/u/IndigoYun)\
**Post date:** [December 6, 2023, 1:16am UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501/4 "2023-12-06T01:16:33Z")

</div>

oh,This means that tiles or rasteroverlays at different distances have different levels in the same viewport?

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [December 6, 2023, 3:29pm UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501/5 "2023-12-06T15:29:15Z")

</div>

@IndigoYun Yes, that’s the nature of 3D Tiles. Levels of detail are loaded based on distance from the camera.

---

<div class="post-metadata">

**Author:** ![IndigoYun](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/indigoyun/32/11245_2.png) [@IndigoYun](https://community.cesium.com/u/IndigoYun)\
**Post date:** [December 7, 2023, 1:26am UTC](https://community.cesium.com/t/how-to-get-the-level-of-the-current-viewport/28501/6 "2023-12-07T01:26:25Z")

</div>

I see ,thanks for your anwser!
