Routetask limitation when using findBestSequence=true

645
3
Jump to solution
09-06-2012 11:35 AM
FredHejazi
New Contributor III
I am finding a limit of 7 stops when setting findBestSequence to true, when using Routetask in a simple javascript routing application.  Has any one else run into this?  Is this a permanent limitation, or just on the free version of the ArcGIS online?  I seem to be able to route more than 7 points if the parameter is false.

Thanks
0 Kudos
1 Solution

Accepted Solutions
FredHejazi
New Contributor III
The solution had nothing to do with findbestSequence.  Rather it was the size of the request.  Since it was a tricky I am posting the answer here. The problem was the samples use an ESRI proxy. You need a proxy because the request can get bigger than 2048 characters. The following is the line.

esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";

Which is why it stopped working at 7 stops. The request was just bigger than 2048 and was getting cut off. Since there were no error messages, it was tough to diagnose.

There is information on how to setup a proxy page on this link

http://help.arcgis.com/en/webapi/jav...help_start.htm

However, if you install the php version, you will need cURL. The instructions that come up if cURL is not installed are for windows. They will not work for Linux and Apache. Use the instructions from the following link

http://askubuntu.com/questions/9293/...l-curl-in-php5

View solution in original post

0 Kudos
3 Replies
derekswingley1
Frequent Contributor
I'm not all that familiar with our routing functionality but what's the specific error you're seeing? Can you post a simple test page that shows the problem?
0 Kudos
FredHejazi
New Contributor III
I just modified the sample code with one line added to it.

http://help.arcgis.com/en/webapi/javascript/arcgis/demos/routetask/routetask_multiple_stops.html

in Line 38 I added

routeParams.findBestSequence=true;

The sample works exactly the same, of course it resequences the stops, but after 7 stops, it does not function.  No errors are generated. At least none that show up.
0 Kudos
FredHejazi
New Contributor III
The solution had nothing to do with findbestSequence.  Rather it was the size of the request.  Since it was a tricky I am posting the answer here. The problem was the samples use an ESRI proxy. You need a proxy because the request can get bigger than 2048 characters. The following is the line.

esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";

Which is why it stopped working at 7 stops. The request was just bigger than 2048 and was getting cut off. Since there were no error messages, it was tough to diagnose.

There is information on how to setup a proxy page on this link

http://help.arcgis.com/en/webapi/jav...help_start.htm

However, if you install the php version, you will need cURL. The instructions that come up if cURL is not installed are for windows. They will not work for Linux and Apache. Use the instructions from the following link

http://askubuntu.com/questions/9293/...l-curl-in-php5
0 Kudos