AnsweredAssumed Answered

Draw text in polygon using Export Web Map Task

Question asked by AlpineGIS on Sep 13, 2016

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?