xiaoguang

Label don't show After Define LabelDefinition for ArcGISMapImageSublayer

Discussion created by xiaoguang on Jul 24, 2017
Latest reply on Aug 7, 2017 by xiaoguang

Hi, I Define LabelDefinition for ArcGISMapImageSublayer after the ArcGISMapImagelayer loaded, but the labels don't show, the field is to be labeld is "name"

 

private async void ArcGISMapImageLayer_LoadStatusChanged(object sender, LoadStatusEventArgs e)
{
var lyr = sender as ArcGISMapImageLayer;

if (e.Status == LoadStatus.Loaded)
{
var subLyr = lyr.Sublayers[1] as ArcGISMapImageSublayer;
await subLyr.LoadAsync();
subLyr.LabelDefinitions.Add(LabelDefinition.FromJson("{\"labelExpression\": \"[name]\",\"labelPlacement\": \"esriServerPolygonPlacementAlwaysHorizontal\",\"symbol\": {\"color\": [255,0,255,123],\"font\": {\"size\": 16},\"type\": \"esriTS\"}}"));

}

Outcomes