Open SunBlack opened 8 years ago
Yes this is a good point for the point cloud styling engine, which won't work if a style references a non-existent property. We should be smarter about detecting non-existent properties ahead of time.
Adding defined
may not be needed since {MYPORPERTY} !== undefined
is valid. It might be a good idea though.
CC #3241
Also added link from https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/140 where it is suggested that undefined
may be able to evaluate to 0
or false
with the GLSL backend.
So what is the solution for this case? It shows error below Error generating style shader: undefined is not supported.
Before applying how can I check with undefined? If you can provide, it's much appreciated. Thanks
Currenlty you have to make sure a property exists if you use it in Cesium3DTileStyle. But if you have a generic UI sometimes you don't know if a Tileset as has property, because its depend on conent of each tile.
So following code can cause a crash if MYPORPERTY does not exists:
So it would be nice if you could write something like this:
In case this is to complex another suggestion would be to extent it to