# Toggle 3D buildings on and off

**URL:** <https://community.cesium.com/t/toggle-3d-buildings-on-and-off/11894>\
**Category:** CesiumJS\
**Created:** [January 2, 2021, 1:34pm UTC](https://community.cesium.com/t/toggle-3d-buildings-on-and-off/11894 "2021-01-02T13:34:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davor\_Fiedler](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/davor_fiedler/32/1987_2.png) [@Davor\_Fiedler](https://community.cesium.com/u/Davor_Fiedler)\
**Post date:** [January 2, 2021, 1:34pm UTC](https://community.cesium.com/t/toggle-3d-buildings-on-and-off/11894/1 "2021-01-02T13:34:31Z")

</div>

Hello all,

does anyone have a working code example of how to toggle 3D buildings on/off in Cesium?

Since the OSM buildings in Cesium are solid, everything beneath them is obscured so I would like to add an option to toggle them on/off.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [January 4, 2021, 5:34pm UTC](https://community.cesium.com/t/toggle-3d-buildings-on-and-off/11894/2 "2021-01-04T17:34:55Z")

</div>

Hello @Davor_Fiedler,

`createOsmBuildings` returns a `Cesium3DTileset`. You can show/hide this tileset by simply setting the value of `tileset.show`.

For example:

```auto
var tileset = viewer.scene.primitives.add(Cesium.createOsmBuildings());
tileset.show = true;

```

Best regards,

Hannah  
Cesium Staff

---

<div class="post-metadata">

**Author:** ![Davor\_Fiedler](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/davor_fiedler/32/1987_2.png) [@Davor\_Fiedler](https://community.cesium.com/u/Davor_Fiedler)\
**Post date:** [January 4, 2021, 10:46pm UTC](https://community.cesium.com/t/toggle-3d-buildings-on-and-off/11894/3 "2021-01-04T22:46:48Z")

</div>

Working, thank you very much Hannah !!!

This helps me to finnish map with quake damage assessments and other stuff 🙂

Best regards,  
Davor

pon, 4. sij 2021. u 18:45 hannah via Cesium Community \<[cesium@discoursemail.com](mailto:cesium@discoursemail.com)\> napisao je:
