Pinched the code from this profiler sample. Having some trouble setting it up with my custom Esri Flex application.

My Flex application is using the Web Mercator Aux Sphere WKID and is using v10 map services, and therefore is 3857 WKID.

When using the tool within my application, I get a 500 error. This is the request is sends:


sampleserver2 is on a 9.3.1 setup.

If I swap out the 3857 at the end of that link for the older 102100, I get a correct JSON response.

So how do I get around this?

I can't see an equivalent service on the v10 sample servers.
My environment is all v10, and I would prefer to keep my app within the newer 102100 WKID.

Further info on the change in WKIDs.


Edit: sorry, my original answer was incorrect. Problem is the spatialReference of the input geometry cannot be understood by 9.3.1 (i.e. wkid 3857). Easy fix, simply set the spatialReference of the input geometry to 102100 before assigning it to the GP Params:

var g:Graphic = event.graphic;
g.geometry.spatialReference = new SpatialReference(102100);
var featureSet:FeatureSet = new FeatureSet([ event.graphic ]);
var params:Object = {
    "Input_Polylines": featureSet,
    "Image_Width": 600,
    "Image_Height": 250,
    "Display_Segments": true

You can also set the outSpatialReference for the GP task to 102100 just to make sure the data is returned in the correct projection, though it seems to work fine on my end without setting it.

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.