Query client-side 3D extents
Explore in the sandboxView live
This sample shows how to query a mesh SceneLayerView to get more information about features visible in the view.The SceneLayerView query methods only execute queries against features that are visible in the view at the moment of the query.
The use case for this sample is to display more information about a building and to zoom to it when the user clicks on that building.
We can get the objectid of the feature the user clicked using the hitTest() method of the view. We use the result to create a query object:
The query object is then passed to queryExtent() method, which returns the 3D extent of the feature, and to the queryFeatures() method, which returns the feature with all the attributes.