An object that defines the text, appearance and position of labels for features for a given scale range.
let labelDefinitionString = "{"
+ " \"allowOverrun\": false,"
+ " \"deconflictionStrategy\":\"static\","
+ " \"labelExpressionInfo\": { \"expression\": \"round($feature.length,2) + 'm^2'\"},"
+ " \"labelPlacement\": \"esriServerPolygonPlacementAlwaysHorizontal\","
+ " \"lineConnection\": \"none\","
+ " \"minScale\": 1999,"
+ " \"maxScale\": 0,"
+ " \"multiPart\": \"labelLargest\","
+ " \"name\":\"Building interior code\","
+ " \"priority\": 15,"
+ " \"removeDuplicates\": \"featureType\","
+ " \"removeDuplicatesDistance\": 300,"
+ " \"repeatLabel\":false,"
+ " \"repeatLabelDistance\":0,"
+ " \"stackLabel\": true,"
+ " \"stackAlignment\": \"dynamic\","
+ " \"stackRowLength\": 20,"
+ " \"stackBreakPosition\": \"before\","
+ " \"symbol\": {\"type\": \"esriTS\", \"color\": [0,78,78,255], \"backgroundColor\": null, \"borderLineColor\": null, \"verticalAlignment\": \"bottom\", \"horizontalAlignment\": \"left\", \"rightToLeft\": false, \"angle\": 0, \"xoffset\": 0, \"yoffset\": 0, \"font\": {\"family\": \"Arial\", \"size\": 12, \"style\": \"normal\", \"weight\": \"bold\", \"decoration\": \"none\"}},"
+ "}"
if let jsonData = labelDefinitionString.data(using: .utf8) {
do {
let JSON = try JSONSerialization.jsonObject(with: jsonData, options: JSONSerialization.ReadingOptions.mutableContainers)
}
catch {
print("Error: \(error.localizedDescription)")
}
}