let p= pCollection.add(new Cesium.Primitive({ geometryInstances: instance, allowPicking: false, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType('Color', { color: Cesium.Color.RED }) }), })); console.log(p);
这时候p里面的geometryInstances是有对象的;
待某个事件触发后,我需要获取p,此时我执行下面代码:
let p = pCollection.get(0); console.log(p);
这时候p的geometryInstances是undefined。