Style is removing after pane or zoom in/out from feature

Hi everyone,

I am using style (changing color) on the features/ buildings on the basis of my query. But I am facing issue that when I am doing pane on map or zooming in/out then on mouse hovering on buildings is removing the style color and giving an error.

error:
Cesium.js:59038 Uncaught TypeError: Cannot read properties of undefined
(reading ‘toBytes’)

at BatchTexture.setColor (Cesium.js:59038:17)

at Cesium3DTileBatchTable.setColor (Cesium.js:59454:26)

at Cesium3DTileFeature.set (Cesium.js:60178:36)

at Cesium3DTilesInspectorViewModel.set (Cesium.js:173249:24)

at Cesium.js:172435:35

at handleMouseMove (Cesium.js:41417:7)

at handlePointerMove (Cesium.js:41676:12)

at HTMLCanvasElement.r (Cesium.js:41278:7)

Please help me to resolve this issue.

Thank you

Have you applied conditions on mouseMove to check if the object is a Tileset or undefined? Please share your code here or create a sandcastle example.

Hi @Jacky , I am not applying any conditions on mouse move, I am styling buildings using buildingid just simple style (changing color of the selected building). below is the code that I have written

tileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
[“${buildingid} === ‘118023456’”, “color(‘red’)”],
],
},
});
this code is working as per my requirement.
But when I am doing pane on map or zooming in/out, then hovering mouse on selected building, the istyled color is getting removed permanently with below error

error:
Cesium.js:59038 Uncaught TypeError: Cannot read properties of undefined
(reading ‘toBytes’)

at BatchTexture.setColor (Cesium.js:59038:17)

at Cesium3DTileBatchTable.setColor (Cesium.js:59454:26)

at Cesium3DTileFeature.set (Cesium.js:60178:36)

at Cesium3DTilesInspectorViewModel.set (Cesium.js:173249:24)

at Cesium.js:172435:35

at handleMouseMove (Cesium.js:41417:7)

at handlePointerMove (Cesium.js:41676:12)

at HTMLCanvasElement.r (Cesium.js:41278:7)