Draw text in polygon using Export Web Map Task

858
0
09-13-2016 08:56 AM
ToddWebb
New Contributor

I am using Export Web Map Task to create an image of my data, which is primarily irregular polygons and a base map.. I need  to add a label to each polygon. I currently draw the text at the centroid of each polygon. This algorithm works well for mostly rectangular polygons but fails for irregular polygons.

This is the relevant part of the spec:

          "featureSet": {             "features": [               {                 "geometry": <geometry>,                 "attributes": [                   "<field1>": "<field name1>",                   "<field2>": "<field name2>",                 ]               }             ],             "symbol": <symbol>           }

I currently pass a point in the geometry field and text as a field in the symbol. I tried passing a polygon as the geometry, but the text disappeared.

Is there some way, using Export Web Map Task, to specify a polygon and some text so that ESRI will make a best effort to draw the text in the polygon?

0 Kudos
0 Replies