Entity .show property (how to show/hide?)

I am trying to use Entity .show property to show/hide my entities. Can anyone tell me what I’m doing wrong below or is this functionality still a work in progress? Thanks!

Here is my Sandcastle code:

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

Cesium.viewerEntityMixin(viewer);

Sandcastle.addToolbarButton(‘Custom Graphics’, function() {

var dataSource = new Cesium.GeoJsonDataSource();

viewer.dataSources.add(dataSource);

dataSource.loadUrl(’…/…/…/Specs/Data/test.geojson’).then(function() {

var entities = dataSource.entities.entities;

for (var i = 0; i < entities.length; i++) {

if(entities[i].polyline){entities[i].polyline.show=false;}

}

});

});

The properties in the DataSources layer are expected to be objects matching the Property interface, which primarily consists of a function getValue(time).

Try this instead:

entities[i].polyline.show = new Cesium.ConstantProperty(false);

There are other implementations of properties for other time-varying situations, such as TimeIntervalCollectionProperty and SampledProperty.