Easy question to start your day. I want to access entities that have been pulled in from CZML. I can access individual entities using SpaceEventHandlers without trouble. However, I’d like to make some settings universal (e.g. translucencyByDistance) for all entities. I have been using Cesium.LabelGraphics to define individual entities accessed by the SpaceEventHandler. But a similar approach without ‘picking’ has my head spinning. What have I missed? Cheers, erik
------------------------------Sandcastle------------------------------------
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var scene = viewer.scene;
var czml =
[{“id” : “document”,
“version” : “1.0”
},{“id” : “Boston”,
“label”:{“text”:“Boston”},
“position”:{“cartographicDegrees”:[-71.0589,42.3601,0]},
},{“id” : “New York City”,
“label”:{“text”:“New York”},
“position”:{“cartographicDegrees”:[-74.0059,40.7127,0]},
}];
var importedCzml = new Cesium.CzmlDataSource();
importedCzml.load(czml);
viewer.dataSources.add(importedCzml);
importedCzml.entities.label = new Cesium.LabelGraphics({
show: true,
translucencyByDistance: new Cesium.NearFarScalar(25000,0.0,75000,1.0)
});