I want to show labels for a Feature Layer (this._layerSPGrid) that I've added to the map. I use this code to add them
var label = new TextSymbol();
label.color.setColor(new Color('black'));
label.font.setSize('8pt');
label.font.setFamily("arial");
var json = {
labelExpressionInfo: { value: '{' + this._fieldPriority + '}' }
}
var labelClass = new LabelClass(json);
labelClass.symbol = label;
this._layerSPGrid.setLabelingInfo([labelClass]);
This works in the app running in Developer Edition. However, when I deploy the app to my server, the labels don't show up. I've stepped through the debugger and it hits all the lines without throwing any errors.
Any ideas why the labels don't show on the server?
Solved! Go to Solution.
Ken,
To make them appear automatically just add
"showLabels": true
to the "mapOptions": {}, portion of the apps main config.json
Ken,
In the LayerList widget do you get the menu option to show labels for that layer?
Thanks, Robert, I had completely overlooked that option. Clicking that does turn the labels on.
However, I am still curious as to why the label appear automatically in the DE version but not the deployed version.
Ken,
To make them appear automatically just add
"showLabels": true
to the "mapOptions": {}, portion of the apps main config.json
Where is the menu option to show labels for a layer?
Click on the ... for the layer and you'll see the option
I don't have that option? I published to server with a scale range on layers will that affect it