property check fails in style expression
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
I am going to show points on Point Cloud according to Classification.
If "Classification" property exists, style expression works fine below
['${Classification} === ' + id, color]
But if "Classification" property does not exist, I get this error message.
RuntimeError: Style references a property "Classification" that does not exist or is not styleable.
So I tried to like this in expression.
"defines" : {
"Classification" : "${Classification} !== Undefined ? ${Classification} : -1"
},
But still get error with this message
DeveloperError: The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.
I saw Undefined is avilable to use and @lilleyse mentioned at #4637 that it is available to use {MyProperty} !== undefined.
Also I checked it is available to use Undefined at https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/Styling/README.md#reference-point-cloud-style.
If Cesium doesn't support this, I think there should be built-in function to check property in PointCloud.
Contributor guide
Research direction
Start with the point-cloud style example in the issue and compare its undefined-property behavior with the linked point-cloud styling specification. Then inspect Cesium3DTileStyle.readyPromise and ready handling around the reported DeveloperError. Done would require a decided, tested behavior for missing properties or a clear resolution that the requested check is unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100