imihiro

why does routTask.solve(routePara,function(resultRoutes){}) only returns 1 route?

Discussion created by imihiro on May 12, 2013
Latest reply on May 13, 2013 by imihiro
Subway map published to network analysis service.
select A as start station, B as destination station.  then routeTask.solve(paras,function(resultRoutes){});
why only one route returned while obviously there are multiple routes?

Code snippets:
        var routeTask = new esri.tasks.RouteTask(networkService);
        var routeParas = new esri.tasks.RouteParameters();
        routeParas.outSpatialReference = map.spatialReference; //outspatialReference of rp
        routeParas.returnRoutes = true;
        routeParas.stops = new esri.tasks.FeatureSet(); //stops of rp, each stop is a esri.Grahic
        routeParas.stops.features.push(tempGra1); //start station
        routeParas.stops.features.push(tempGra2);//end station

        var routeSymbol = new esri.symbol.SimpleLineSymbol().setColor(new dojo.Color([0, 0, 255, 0.5])).setWidth(5);
        routeTask.solve(routeParas, function (solveResults) {
        alert(solveResults.routeResults.length);//always one route,why?
        ........
        }

Any help will be appreciated.

Outcomes