I have published in my ArcGIS server a map service with a table containing the polygons of all countries on Earth. So this table contains more than 200 rows and the geometry field is of type type: esriFieldTypeGeometry , alias: Shape
.
What I would like to do is creating a label inside this polygon, so what I did was modifying this ESRI example (Create points for labeling) that, instead of allowing the user drawing a polygon to be sent to the external Geometry Service, expects a click from user's side, retrieves clicked-country geometry with a Query operations and draws a predefined label on the country. Of course, last step is not done yet, but this would be the idea.
The problem is that after building a new Graphic
object with the new geometry retrieved from the layer and call ESRI Geometry Service as in the example, I got an error on Firebug like this:
TypeError: _c94 is undefined
...eateSegments:function(_764){_764.shape.path=_764.vmlPath;_764.segmented=false;_7...
And well, I don't know why is this happening as error is not verbose at all. I noticed that the error is caused by:
http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2 (On Line 34)
So these are my doubts:
The ESRI example comes, out of the box, with the 1.6 version of ArcGIS JS API. And I changed it to 3.2, because if not, I got this error just when starting the application because I imported the Feature Layer with dojo.require:
"NetworkError: 404 Not Found - http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/esri/layers/FeatureLayer.xd.js" uncaught exception: Could not load cross-domain resources: esri.layers.FeatureLayer
Is it possible that I need a proxy to pass the country geometry to Geometry Server? I mean, if you check the following image, you can see that there are about 2800 rings. I am not sure if these data are sent to the geometry service, but if so, I guess that the GET request will be huge and therefore, a proxy should be involved, isn't it?
Please, can anyone provide some help?
Thank you very much!