var viewer = new Cesium.Viewer('cesiumContainer'); viewer.dataSources.add(Cesium.CzmlDataSource.load('../../SampleData/simple.czml')); Cesium.knockout.getObservable(viewer, '_selectedEntity').subscribe(function(entity) { if (!Cesium.defined(entity)) { console.log('De-selected entity.'); } else { console.log('Selected entity ' + (entity.name || entity.id)); } });
Cesiumjs – How to add global event for specific entities?
Leave a reply