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.
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.
However,in many subway-transfer-route cases, a shortest distance route may cost more time than the second shortest distance route.
How to get the second shortest distance route using the ArcGIS Javascript API 3.4?
How to get the second shortest distance route using ArcGIS SDK?
Any Help with interface name or code snippets would be appreciated.
I'm Hinada.