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

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?

enter image description here

Please, can anyone provide some help?

Thank you very much!


Please use this sample: (Create points for labeling (3.2 version)). According to the error, I guess you were using old method in JS API 1.6, but required the new version of the dojo library. Howerver this JS file: http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/esri/layers/FeatureLayer.xd.js doesn't exist anymore. In the mean time, you can't direct import cross-domain js.

  • Yes I think it was the proxy...unfortunately, due to security reasons in my company I can't test it properly, so I will go for something else...Thanks for the tip. – Irene Dec 2 '12 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.