Feature Layer Label Style

320
1
Jump to solution
05-08-2017 07:28 AM
MarcTidd
New Contributor II

Hello,

I want to add street lines with labels from a geodatabase.

I have this working using a FeatureLayer and a GeodatabaseFeatureTable.  I can easily control the styling of the line but see no way to simply set the label color.

Here is the code I am using to create the feature layer.

var gdb = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(f);

// get the first table

var gdbFeatureTable = gdb.GeodatabaseFeatureTable(0);


// create a FeatureLayer to display the table
fl = new FeatureLayer(gdbFeatureTable);

Symbol sym = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Gray, 14);

SimpleRenderer sr = new SimpleRenderer(sym);

fl.Renderer = new SimpleRenderer(sym);

fl.LabelsEnabled = true;

This seems like such a simple thing, what am I missing?

Does anyone have any sample code?

Thanks

1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor

Hi,

Currently in v100.0 you need to setup the labels for your lines in ArcGIS Pro before creating your Mobile Map Package (or publishing a sync-enabled feature service). In the upcoming Update 1 release we plan to add some support to the API for setting label style and behavior programmatically, followed by a more extensive API in Update 2 later this year.

Cheers

Mike

View solution in original post

1 Reply
MichaelBranscomb
Esri Frequent Contributor

Hi,

Currently in v100.0 you need to setup the labels for your lines in ArcGIS Pro before creating your Mobile Map Package (or publishing a sync-enabled feature service). In the upcoming Update 1 release we plan to add some support to the API for setting label style and behavior programmatically, followed by a more extensive API in Update 2 later this year.

Cheers

Mike

View solution in original post