Select to view content in your preferred language

Polygon areas label are set to 0,0 lat,lon

227
1
03-17-2022 01:22 AM
GonzaloMuñoz
New Contributor II

Hi all,

we have some polygons (rectangles) in our map with a labeldefinition like :

labelBuilder.AppendLine("{");
// Define a labeling expression that will show the Name attribute value
labelBuilder.AppendLine("\"allowOverrun\": true ,");
labelBuilder.AppendLine("\"allowOverlapOfLabel\": \"allow\" ,");
labelBuilder.AppendLine("\"allowOverlapOfFeatureBoundary\": \"allow\" ,");
labelBuilder.AppendLine("\"allowOverlapOfFeatureInterior\": \"allow\" ,");
labelBuilder.AppendLine("\"priority\": 25 ,");
labelBuilder.AppendLine("\"labelExpressionInfo\": {");
labelBuilder.AppendLine("\"expression\": \"return $feature.Name;\"},");
// Align label horizontally
labelBuilder.AppendLine("\"labelPlacement\": \"esriServerPointLabelPlacementCenterRight\",");
labelBuilder.AppendLine("\"multiPart\": \"labelLargest\",");
// Set the style for the text symbol
labelBuilder.AppendLine("\"symbol\": {");
labelBuilder.AppendLine("\"color\": [255,255,255,255],");
labelBuilder.AppendLine("\"haloColor\": [51,51,51,255],");
labelBuilder.AppendLine("\"haloSize\": 1.5,");
labelBuilder.AppendLine("\"font\": {\"size\": 10, \"weight\": \"bold\"},");
labelBuilder.AppendLine("\"type\": \"esriTS\"}");
labelBuilder.AppendLine("}");

 

and the problem we are finding is that the label is set at lat,lon 0,0. Does anyone know where is the problem?

 

Regards

Gonzalo

 

0 Kudos
1 Reply
PeterDimitrov1
Esri Contributor

Hi GonzaloMuñoz, 

Just to check if I understand you correctly - are you saying that all the labels for polygon features which have that label definition are placed away from the polygons at Lat/Lon 0/0 or just one label is exhibiting this behaviour?

Also, would you be able to share any data with us such as an MMPK so we can have a look (assuming you are loading from a local data source and not a web map)?

Regards, 
Peter Dimitrov