tileVisible

This event fires once for each visible tile in a frame. This can be used to manually style a tileset.

The visible Cesium3DTile is passed to the event listener.

This event is fired during the tileset traversal while the frame is being rendered so that updates to the tile take effect in the same frame. Do not create or modify Cesium entities or primitives during the event listener.

tileset.tileVisible.addEventListener(function(tile) {
if (tile.content instanceof Model3DTileContent) {
console.log('A 3D model tile is visible.');
}
});
// Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
tileset.style = new Cesium3DTileStyle({
color : 'color("red")'
});
tileset.tileVisible.addEventListener(function(tile) {
const content = tile.content;
const featuresLength = content.featuresLength;
for (let i = 0; i < featuresLength; i+=2) {
content.getFeature(i).color = Color.fromRandom();
}
});

See also