Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a built-in variable for geometry type #333

Closed
OmarShehata opened this issue Aug 28, 2018 · 1 comment
Closed

Add a built-in variable for geometry type #333

OmarShehata opened this issue Aug 28, 2018 · 1 comment

Comments

@OmarShehata
Copy link

OmarShehata commented Aug 28, 2018

Currently it's possible to style features by ID:

tileset.style = new Cesium.Cesium3DTileStyle({
       color: {
           conditions: [
               ['${ID} >= "uniqueID"', 'rgba(45, 0, 75, 0.5)'],
               ['true', 'rgb(127, 59, 8)']
           ]
       }
   });

It would be nice to be able style by type. For example, you have a composite tile composed of vector tiles and b3dm, and you want to color only the lines in the vector tiles (a use case which came up on the forum). So something like this could work:

tileset.style = new Cesium.Cesium3DTileStyle({
       color: {
           conditions: [
               ['${TYPE} == "polyline"', 'rgba(45, 0, 75, 0.5)'],
               ['true', 'rgb(127, 59, 8)']
           ]
       }
   });

Currently I think the workaround would be to add your own type to the batch table and style based on that?

@donmccurdy
Copy link
Contributor

Related:

Unless this becomes a built-in variable in declarative styling, I think the recommended solution would be to use an enum- or integer-typed property value in EXT_mesh_features. See 3D Tiles Next. No need for a custom metadata semantic in this case, since the property is just used for styling and not actually determining the geometry type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants