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