I have a web map with a FeatureLayer (polygons). I’m using a LabelLayer to label the polygons with a double-type field. My values in the field go to the hundredth, but some don’t. (example image below) I want to show all labels with values to the tenth, which means some will have to be rounded, and others will have to be padded on the right with “.0”
I know how to do this in ArcMap - go to the layer’s attribute table, go to the field’s numeric properties, set how many decimal places to show, also check the ‘Pad with zeros’ box. How do I accomplish this with my web map? I can’t find a decimal places setting in the documentation for LabelLayer... Is there a round/pad function I can use in the textExpression of the addFeatureLayer method? Or is there a way to set field display properties in the map service?
Solved! Go to Solution.
Tracy Schloss yes LabelClass works with FeatureLayers too. The example I posted is using a feature layer. We are currently working on updating the doc for labelling so at the next release it should be more clear.