Feature masking with SceneLayer


Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

Masking features is useful in urban planning. In this sample users can hide buildings by clicking on them. This can be easily achieved by setting a definitionExpression on a SceneLayer.

When a user clicks on a building, the objectid of the building is added to the definitionExpression property:

// show all the buildings that don't have these objectids
sceneLayer.definitionExpression = 'OBJECTID NOT IN (3, 5, 20)';

By removing NOT from the query, the opposite effect could be achieved: only the building that was clicked on stays in the view.

Other helpful resources

Sample search results