It's been 13 years for this issue and the problem seems to be the same. I'm running into this issue too. Have there been any resolutions to this?
LabelingInfo in a mapservice's layer's resources (on REST) always returns null when advanced-expression is used to define labels.dynamic map service's export call will draw them correctly though using the advanced labeling expression that you set in the source map, it is just that LabelingInfo will always be null (when advanced expression is used).
Replace([Name],"Chp","CHP")
def FindLabel( [NPC_CATEGORY_ID] ): npcId = [NPC_CATEGORY_ID] idCodes = { "231": "WPn53", "371": "WMs83", "372": "WMs92", "375": "WPn53", "376": "WPn53" } if npcId in idCodes: return idCodes[npcId] return npcId
def FindLabel( [NPC_CATEGORY_ID] ): idArray = ["231","371","372","375","376"] codeArray = ["WPn53","WMs83","WMs92","WPn53","WPn53"] labelValue = [NPC_CATEGORY_ID] for i in range(len(idArray)): if idArray == [NPC_CATEGORY_ID]: labelValue = codeArray return labelValue
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.