Display a route layer and its directions using a feature collection.
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.
Pan and zoom to view the route displayed by the feature collection layer. Toggle to view or hide the turn-by-turn directions.
- Create a
PortalItem
with the default portal and item ID. - Create and load a
FeatureCollection
with the item. - After loading, get the
FeatureCollectionTable
containing turn-by-turn directions. - Set the
ItemSource
of the collection displaying directions to theFeatureCollectionTable
. - Create a
FeatureCollectionLayer
with the feature collection and set it to the map'sOperationalLayers
.
- AGSFeatureCollection
- AGSFeatureCollectionLayer
- AGSFeatureCollectionTable
directions, feature collection, route layer