-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support 3D Tiles feature picking in Viewer #9121
Conversation
Thanks for the pull request @mramato!
Reviewers, don't forget to make sure that:
|
This area in general isn't super well unit tested and it didn't look like it was easy to test Cesium3DFeature without mocking a bunch of things. Given it's super easy to test with Sandcastle, I didn't worry about it for now. Here's a link to the OSM demo which now showcases this behavior by default: http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/feature-picking-3d/Apps/Sandcastle/index.html?src=Cesium%20OSM%20Buildings.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty amazing. Even though I already knew how to do this in my app, this is way more convenient.
One thing I don't get about the code is what happens to the new Entity
that's constructed for this - does it need to be explicitly destroyed? Does it just get garbage collected when selectedEntity = undefined
?
No need to explicitly destroy it, it will get garbage collected when the infobox is closed or programmatically unselected. |
@OmarShehata I think I addressed your feedback, anything else? |
I was considering if we need to update any Sandcastle examples to simplify them, like this one in particular: http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/feature-picking-3d/Apps/Sandcastle/index.html?src=3D%20Tiles%20Feature%20Picking.html, but that's doing more than just getting the properties on click (getting it on hover, adding an HTML overlay, highlighting with post processing). It may be valuable to add a separate code example for extracting the |
I am going to merge this since I am happy with how the feature works, and because the |
Viewer
now has default pick handling for
Cesium3DTileFeaturedata and will display its properties in the default
InfoBoxas well as set
Viewer.selectedEntity` to a transient Entity instance representing the data. While a little clunky, this is identical to how ImageryLayer picking has worked for ages.