Display a route layer and its directions using feature collection.

Use case
Routes can be stored as feature collection layers. These layers can store useful information such as directions, estimated trip time, and more.
You can create a route layer in ArcGIS Pro and store a route layer as a portal item, making it easy to access, share, or display.
How to use the sample
Pan and zoom to view the route displayed by the feature collection layer. Tap the toolbar button to view the list of directions.
How it works
- Create a
PortalItemwith the item ID. - Create and load a
FeatureCollectionwith the item. - After loading, get the specified
FeatureCollectionTableby name. - Create an array of
Features. - Get the direction text from the attributes of each feature in the array.
- Create a
FeatureCollectionLayerwith the feature collection and set it to the map’soperationalLayers.
Relevant API
- Feature
- FeatureCollection
- FeatureCollectionLayer
- FeatureCollectionTable
- PortalItem
Tags
directions, feature collection, route layer