Possible bug in KmlDataSource.show

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() {
};

  1. When ready, a cloud of icon is shown. Zoom in to see both icons and text labels.
  2. Select “Hide” from the toolbar menu. Icons and labels disappear. So far so good.
  3. Select “Show” from the toolbar menu. Labels are back but not icons…?
  4. 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.

Hello Boris,

Thanks for providing the show example! I’ve opened an issue on our GitHub so we can look into this: https://github.com/AnalyticalGraphicsInc/cesium/issues/4408

Best,

Hannah

This issue was fixed in master and will be in the 1.27 release.

Dan