Hello,
I am attempting to use the Python API in order to publish Feature Services to an ArcGIS Online portal. However, I am having a problem getting labels to appear. I have been trying to use the "showLabels" property in order to have the labels display. I tried including the "showLabels" property in "drawingInfo" (as per https://developers.arcgis.com/web-map-specification/objects/drawingInfo/) and also more just within the feature layer definition (not nested in drawingInfo). Neither have had any success.
When I go into the portal, the labels do not appear by default. If I click on "Create Labels" for the layer then it will load them properly with the correct labelingInfo. I was verifying the JSON using the inspect tool and noticed that the "showLabels" property found in arcgisonline.map.main.mapLayers[id] was being set as undefined. If I manually switch it to true and then reload the feature layer, then the labels appear.
My best guess right now is that I am setting showLabels in the incorrect spot and it isn't being recognized properly when loading the map. Is there somewhere else I need to set showLabels or another property that I need to modify?
Below is the rough structures I have tried. Every other property is being set correctly so I don't think there is an error trying to update the layer.
Structue within "drawingInfo"
{
"id": 0
"drawingInfo": {
"showLabels": True
...
}
...
}
Structue not within "drawingInfo"
{
"id": 0
"showLabels": True
"drawingInfo": { ... }
...
}
Any help would be greatly appreciated, thanks!
Note: This issue has been encountered before so I'm not sure if it is maybe a bug with the Python API (https://community.esri.com/t5/arcgis-api-for-python-questions/labelling-not-showing-on-webmap/td-p/1073153)