Display custom labels in a 3D scene.
Labeling features is useful to visually display information or attributes on a scene. For example, city officials or maintenance crews may want to show installation dates of features of a gas network.
Pan and zoom to explore the scene. Notice the labels showing installation dates of features in the 3D gas network.
To open a web scene from a portal item:
- Create a
Scene
from a URL, then load. - After loading is complete, obtain the gas layer from the scene's operational layers.
- From the gas layer, find the main gas sublayer.
- Create a
TextSymbol
to use for displaying the label text. - Create a
LabelDefinition
using anArcadeLabelExpression
. - Add the definition to the feature layer's
labelDefinitions
list.
- ArcadeLabelExpression
- LabelDefinition
- Scene
- SceneView
This sample shows a New York City infrastructure scene hosted on ArcGIS Online.
3D, labeling, scene, web scene