Hello everybody,
Please run the following script in the Sandcastle (Cesium 1.26):
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var options = {
camera : viewer.scene.camera,
canvas : viewer.scene.canvas
};
var kml = ‘…/…/SampleData/kml/facilities/facilities.kml’;
var kmlds;
Sandcastle.addToolbarMenu([{
text : ‘Start’,
onselect : function() {
viewer.dataSources.removeAll();
viewer.dataSources.add(Cesium.KmlDataSource.load(kml, options))
.then(function(ds) {
kmlds = ds;
});
}
}, {
text : ‘Hide’,
onselect : function() {
kmlds.show = false;
}
}, {
text : ‘Show’,
onselect : function() {
kmlds.show = true;
}
}
], ‘toolbar’);
Sandcastle.reset = function() {
};
- When ready, a cloud of icon is shown. Zoom in to see both icons and text labels.
- Select “Hide” from the toolbar menu. Icons and labels disappear. So far so good.
- Select “Show” from the toolbar menu. Labels are back but not icons…?
- Select “Hide” again. Labels are still there…?
Do you observe the same?
The doc for KmlDataSource.show is “Gets whether or not this data source should be displayed”, but this property has a setter too. So my understanding is “Gets or sets whether or not this data source should be displayed”. Is this correct?
Thanks, Boris.