How can I place multiple labels in a parcel feature layer. My following function adds single attribute field as label as charm. Dont know how to add multiple attributes as labels. Appricate any help.
=========================================
function showLables(color, fsize, lblLayerID, LayerName, LabelField) {
color = new esri.Color(color);
var labelField = LabelField;
statesLabel = new esri.symbol.TextSymbol().setColor(color);
statesLabel.font.setSize(fsize);
statesLabel.font.setFamily("arial");
var renderer = new esri.renderer.SimpleRenderer(statesLabel);
var labels = new esri.layers.LabelLayer({ id: lblLayerID });
labels.addFeatureLayer(LayerName, renderer, "{" + labelField + "}");
app.map.addLayer(labels);
}
Thank you
Solved! Go to Solution.
If I understand your question then you just need to concatenate all the attributes you want to show into the same string:
labels.addFeatureLayer(LayerName, renderer, "{" + labelField + "}" + ", " + "{" + labelField2 + "}");
If I understand your question then you just need to concatenate all the attributes you want to show into the same string:
labels.addFeatureLayer(LayerName, renderer, "{" + labelField + "}" + ", " + "{" + labelField2 + "}");