Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'd like to send a parameter with the Route Task and be able to get that same parameter in the RouteResult object. The goal is to be able to recognize the routes I receive from the server when I perform many solve operations on the same RouteTask.

share|improve this question
add comment

3 Answers 3

up vote 3 down vote accepted

There is no need to send something along to the server (and expecting it back). The AsyncResponder supports a third argument "token" which can be used for this. There is no need to create special classes or wrap it when the Adobe/Apache Flex SDK support it already :)

token:Object (default = null) — Additional information to associate with this request. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/AsyncResponder.html#AsyncResponder()

Some of the ArcGIS API for Flex samples take advantage of this, for example in the "Routing Directions" example which use it to keep track of the "from" and "to" geocodes: http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Route_Directions/01nq0000000p000000/

share|improve this answer
add comment

One solution would be to create your own custom geoprocess that wraps the RouteTask. You pass all the parameters for the RouteTask and your extra parameters and then return the result of the RouteTask along with your own parameters. I used this method to take geocoding parameters and my own custom parameters, then called the geoprocess function and returned geocoding results along with my own tracking parameters that I had passed in.

share|improve this answer
    
Yes but geoprocessing services are very slow in comparison with NA services. I need my request to be processed by the server in ~1 sec. –  yo_haha Feb 18 '13 at 9:21
add comment

I think I'm going to create a new class that will contain its own RouteTask, the callback function for the RouteTask and my own parameters. Then each time I need to use a routeTask, I will use my new object created. What do you think?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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