How to show labels on a Route feature class at specific distance using ArcGIS Pro SDK

09-07-2021 03:20 AM
by Anonymous User
Not applicable


We have a route feature class and would like to place labels on it at specific distances. As shown in the screenshot below, we are looking for the same result. Labels are mentioned at certain distances, which are highlighted in yellow.

However We are not sure how  we can achieve this using ArcGIS Pro SDK.


Can anyone please provide the basic sample(in C#) for the same.

Expected Output:



Thanks in advance.

2 Replies
Occasional Contributor III

If the screenshot shown is not from ArcGIS Pro, create a featurelayer that visually meets your requirements via the GUI, as described here.

Save it the layer to a .lyrx file, and view it with a text editor, examining the CIM classes therein.



Write code that instantiates the CIM renderer class, and set the properties to whatever appears in the lyrx file.  Finally, use SetRenderer to assign the renderer to the featurelayer.

0 Kudos
by Esri Regular Contributor
Esri Regular Contributor

I attached a sample that uses the graphics layer in order to add the labels to your map.   The sample uses a selected polyline (feature) and creates labels at a distance of 200 meters along the selected line (depending on the linear unit of your projection)



0 Kudos