View in MAUI UWP WPF WinUI View on GitHub
import InlineCode from "@esri-dx/starship-doc-components/components/InlineCode.astro";

Identify features in a scene to select.

Image of scene layer selection

Use case

You can select features to visually distinguish them with a selection color or highlighting. This can be useful to demonstrate the physical extent or associated attributes of a feature, or to initiate another action such as centering that feature in the scene view.

How to use the sample

Click on a building in the scene layer to select it. Deselect buildings by clicking away from the buildings.

How it works

  1. Create an
    passing in the URL to a scene layer service.
  2. Wait for the user to tap with the
    event and get the tapped screen point.
  3. Call
    to identify features in the scene.
  4. From the resulting
    , get the list of identified
    with
    .
  5. Get the first element in the list, checking that it is a feature, and call
    to select it.

Relevant API

  • ArcGISSceneLayer
  • Scene
  • SceneView

About the data

This sample shows a Brest France Buildings Scene hosted on ArcGIS Online.

Tags

3D, buildings, identify, model, query, search, select

Sample Code

SceneLayerSelection.xaml SceneLayerSelection.xaml SceneLayerSelection.xaml.cs
<UserControl x:Class="ArcGIS.WinUI.Samples.SceneLayerSelection.SceneLayerSelection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
<Grid>
<esriUI:SceneView x:Name="MySceneView" GeoViewTapped="SceneViewTapped" />
<Border Style="{StaticResource BorderStyle}">
<TextBlock FontWeight="SemiBold"
Text="Tap to select buildings."
TextAlignment="Center" />
</Border>
</Grid>
</UserControl>