Hi Everbody
I am trying to label a FeatureLayer with values from an attribute, but somehow it fails. I have calculated the z-value and want to label that, but for some reason it label another attribute.
In the CIMLabelClass I define the Expression to be the 'zValue' attribute:
var labelFeatureLayer = new CIMLabelClass
{
Name = "labelFeatureLayer",
ExpressionEngine = LabelExpressionEngine.Arcade,
Expression = "$feature.zValue",
TextSymbol = SymbolFactory.Instance.ConstructTextSymbol().MakeSymbolReference(),
Visibility = true
};
var lyrDefn = fcLayer.GetDefinition() as CIMFeatureLayer;
var listLabelClasses = lyrDefn.LabelClasses.ToList();
listLabelClasses.Add(labelFeatureLayer);
lyrDefn.LabelClasses = listLabelClasses.ToArray();
fcLayer.SetDefinition(lyrDefn);
fcLayer.SetLabelVisibility(true);
But its just showing a different attribute (in this case its the objectid)
