TypeError: Cannot set property 'geometry' of undefined

I am trying to set the colour of an entity using ColorMaterialProperty. However, I am getting the following error:

TypeError: Cannot set property ‘geometry’ of undefined
TypeError: Cannot set property ‘geometry’ of undefined
at Object.PrimitivePipeline.unpackCombineGeometryParameters (http://localhost:8080/Source/Scene/PrimitivePipeline.js:616:35 )
at combineGeometry (http://localhost:8080/Source/Workers/combineGeometry.js:11:44 )
at http://localhost:8080/Source/Workers/createTaskProcessorWorker.js:56:42

Here is an example of some of the code:

roof_one = entities[3];

roof_one.polygon.material = new Cesium.ColorMaterialProperty(createSampledProperty(0, difference, 1800));

I am using Cesium 1.34, on Mac, on Google Chrome.

Thanks.

Hi there,

Here’s an example of assigning color material properties: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Hello%20World.html&label=Showcases&gist=de4e010c54af2141b74665c42117ee2c

Are you sure polygon is defined for entities[3]? I would double check that first.

Hope that helps,

  • Rachel