# BUG? PrimitiveCollection show property ignored (with Sandcastle)

**URL:** <https://community.cesium.com/t/bug-primitivecollection-show-property-ignored-with-sandcastle/5470>\
**Category:** CesiumJS\
**Created:** [May 2, 2017, 8:06pm UTC](https://community.cesium.com/t/bug-primitivecollection-show-property-ignored-with-sandcastle/5470 "2017-05-02T20:06:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Ressler](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@Bryan\_Ressler](https://community.cesium.com/u/Bryan_Ressler)\
**Post date:** [May 2, 2017, 8:06pm UTC](https://community.cesium.com/t/bug-primitivecollection-show-property-ignored-with-sandcastle/5470/1 "2017-05-02T20:06:10Z")

</div>

Hello Cesium folks,

If I create a PrimitiveCollect (or PointPrimitiveCollection in the example below), add it to the scene, then flip the show property on that collection, no visible change occurs. Here’s a Sandcastle that demonstrates the issue:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var points = viewer.scene.primitives.add(  
new Cesium.PointPrimitiveCollection());

var step = 360 / 30;

for (var longitude = -180; longitude \< 180; longitude += step) {  
var color = Cesium.Color.PINK;  
if ((longitude % 2) === 0) {  
color = Cesium.Color.CYAN;  
}  
for (var latitude = -90; latitude \< 90; latitude += step) {  
points.add({  
position : Cesium.Cartesian3.fromDegrees(longitude, latitude),  
color : color  
});  
}  
}  
points.show = false;

``

Expected: no visible points

Observed: all points visible

If I do:

viewer.scene.primitives.show = false;

``

This does in fact turn off the points. However I want more granular control than that. I want to add several PrimitiveCollections, and be able to toggle them on/off independently of one another, which I would expect to be able to do.

Thoughts?

Thanks,

Bryan Ressler

Institute for Disease Modeling

---

<div class="post-metadata">

**Author:** ![Scott\_Hunter](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_hunter/32/2006_2.png) [@Scott\_Hunter](https://community.cesium.com/u/Scott_Hunter)\
**Post date:** [May 2, 2017, 8:21pm UTC](https://community.cesium.com/t/bug-primitivecollection-show-property-ignored-with-sandcastle/5470/2 "2017-05-02T20:21:56Z")

</div>

Looks like PointPrimitiveCollection doesn’t actually have a show property (and never has). You could wrap each PointPrimitiveCollection in a PrimitiveCollection, or if you wanted to add the show property, that would use a useful (and easy) contribution.

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [May 2, 2017, 8:29pm UTC](https://community.cesium.com/t/bug-primitivecollection-show-property-ignored-with-sandcastle/5470/3 "2017-05-02T20:29:38Z")

</div>

+1 to Scott’s reply! We’d be happy to help you make a contribution if you’re interested. Start by taking a look here: [https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md)

---

<div class="post-metadata">

**Author:** ![Bryan\_Ressler](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@Bryan\_Ressler](https://community.cesium.com/u/Bryan_Ressler)\
**Post date:** [May 2, 2017, 8:39pm UTC](https://community.cesium.com/t/bug-primitivecollection-show-property-ignored-with-sandcastle/5470/4 "2017-05-02T20:39:47Z")

</div>

Wow I looked in PointPrimitiveCollection, didn’t see show, then _assumed that PointPrimitiveCollection was-a PointCollection (OOP)_, and went to look at PrimitiveCollection, which _does_ have a show property, and so assumed it would be inherited. So definitely _mea culpa_. For now I will wrap the PointPrimitiveCollection in a PrimitiveCollection, since I’m currently trying to avoid modifying/building Cesium. I may take a shot at adding a show property too.

Thanks for your help Scott & Rachel!
