# Lines disappears on zooming in

**URL:** <https://community.cesium.com/t/lines-disappears-on-zooming-in/10624>\
**Category:** CesiumJS\
**Created:** [August 18, 2020, 8:56am UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624 "2020-08-18T08:56:53Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![micelic](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/micelic/32/3476_2.png) [@micelic](https://community.cesium.com/u/micelic)\
**Post date:** [October 13, 2021, 11:18am UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/22 "2021-10-13T11:18:19Z")

</div>

Here is the viewer change

var viewer = new Cesium.Viewer(“cesiumContainer”, {

shouldAnimate: true,

terrainProvider : Cesium.createWorldTerrain()

});

Zoom all the way in and out …

Hi Sam,

> **[Cesium Sandcastle](https://sandcastle.cesium.com/?src=CZML.html)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [October 13, 2021, 6:59pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/23 "2021-10-13T18:59:18Z")

</div>

@micelic

Thank you for sharing your sandcastle demo with the community. It looks like sections of the KML are being hidden as I zoom towards the terrain.

![image](https://global.discourse-cdn.com/cesium/original/2X/0/0b3da11338cc6683325d6ba8629f7e9331556db0.jpeg)

This error might be related to multi-frustum artifacts. Thus, it may be fixed by enabling log depth. Please try setting

```auto
scene.logarithmicDepthBuffer = true;
scene.camera.frustum.near = 0.1;
scene.camera.frustum.far = 10000000000.0;

```

-Sam

---

<div class="post-metadata">

**Author:** ![micelic](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/micelic/32/3476_2.png) [@micelic](https://community.cesium.com/u/micelic)\
**Post date:** [October 13, 2021, 7:39pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/24 "2021-10-13T19:39:00Z")

</div>

Hi Sam.

I see the same issue. This is what I did on your sandcastle.

var viewer = new Cesium.Viewer(“cesiumContainer”,{terrainProvider : Cesium.createWorldTerrain()});  
viewer.scene.logarithmicDepthBuffer = true;  
viewer.scene.camera.frustum.near = 0.1;  
viewer.scene.camera.frustum.far = 10000000000.0;

Let me know if this is what you were asking.

Thanks,

Carlo

---

<div class="post-metadata">

**Author:** ![micelic](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/micelic/32/3476_2.png) [@micelic](https://community.cesium.com/u/micelic)\
**Post date:** [October 13, 2021, 7:49pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/25 "2021-10-13T19:49:18Z")

</div>

Hi Sam

Here is another sandcastle example

 ![image](https://global.discourse-cdn.com/cesium/original/2X/2/23e947582a45b0c7c036f080993629729762ec12.jpeg)

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [October 14, 2021, 7:57pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/26 "2021-10-14T19:57:24Z")

</div>

@micelic

Are you still seeing the same issue even when you update your project to include the following code?

```auto
scene.logarithmicDepthBuffer = true;
scene.camera.frustum.near = 0.1;
scene.camera.frustum.far = 10000000000.0;

```

-Sam

---

<div class="post-metadata">

**Author:** ![DataVerse](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dataverse/32/3476_2.png) [@DataVerse](https://community.cesium.com/u/DataVerse)\
**Post date:** [May 4, 2022, 11:54am UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/27 "2022-05-04T11:54:05Z")

</div>

I have some code with the same bug. Adding those 3 lines didn’t fix it. If I find a solution I’ll post it here. It vanishes if I zoom in and generally looks strange as I pan and tilt the view. The same code works perfectly with other data in a different location!

> const redLine = viewer.entities.add({  
> name: “Route”, polyline: {  
> positions: Cesium.Cartesian3.fromDegreesArray(posns),  
> width: 15,  
> material: Cesium.Color.RED,  
> clampToGround: true, },  
> });
> 
> ![Image1](https://global.discourse-cdn.com/cesium/original/2X/6/6d5b95824d1fc73dae045157e3548c56b04c418a.jpeg)

---

<div class="post-metadata">

**Author:** ![elolelo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/elolelo/32/15527_2.png) [@elolelo](https://community.cesium.com/u/elolelo)\
**Post date:** [August 16, 2023, 9:00pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/28 "2023-08-16T21:00:50Z")

</div>

Hi everyone,

Has there been a solution to this issue? I am also facing a similar challenge with icons and even labels. When zooming in, they dissapear.

 ![Screenshot 2023-08-16 at 21.59.16](https://global.discourse-cdn.com/cesium/original/2X/f/f5ac872052632986feb15d95a88cb0d13539b667.jpeg)

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [August 17, 2023, 5:13pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/29 "2023-08-17T17:13:46Z")

</div>

Hi @elolelo,

I would recommend setting the [`disableDepthTestDistance`](https://cesium.com/learn/cesiumjs/ref-doc/BillboardGraphics.html#disableDepthTestDistance) property for billboards and labels in this case.

---

<div class="post-metadata">

**Author:** ![a499401289](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/a499401289/32/14000_2.png) [@a499401289](https://community.cesium.com/u/a499401289)\
**Post date:** [June 24, 2025, 1:19pm UTC](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624/30 "2025-06-24T13:19:43Z")

</div>

hello, sample problem , have you resolved?

[Previous page](https://community.cesium.com/t/lines-disappears-on-zooming-in/10624.md?page=1)
