routeTask = new esri.tasks.RouteTask("http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World"); routeParams = new esri.tasks.RouteParameters(); dojo.connect(routeTask, "onSolveComplete", showRoute); routeParams.restrictionAttributes = ["Use Preferred Truck Routes","Height Restriction"]; | |||||||||||||||
routeParams.attributeParameterValues = [{ | |||||||||||||||
"attributeName": "Use Preferred Truck Routes", | |||||||||||||||
"parameterName": "Restriction Usage", | |||||||||||||||
"value": "Prefer_High" | |||||||||||||||
},{ | |||||||||||||||
"attributeName": "Height Restriction", | |||||||||||||||
"parameterName": "Vehicle Height (meters)", | |||||||||||||||
"value": 40000 | |||||||||||||||
}]; routeParams.outSpatialReference = { "wkid": 102100 }; if (li.length != routeParams.stops.features.length) { var x = locationPoint[li.length - 1].getLatitude(); var y = locationPoint[li.length - 1].getLongitude(); var latlog = new esri.geometry.Point(y, x); var webMercator = new esri.geometry.webMercatorUtils.geographicToWebMercator(latlog); var point = new esri.geometry.Point(webMercator.x, webMercator.y, new esri.SpatialReference({ wkid: 102100 })); var graphic = new esri.Graphic(point, stopSymbol); routeParams.stops.features.push(new esri.Graphic(point, stopSymbol)); } if (li.length>=2) { routeTask.solve(routeParams); }
| |||||||||||||||
// For addres: 550 C St SW, Washington, District of Columbia, 20024 (here is tunnel) | |||||||||||||||
//to 500 5th St NW, Washington, District of Columbia, 20001 ESRI Please Help |
Solved! Go to Solution.
I Resolve this by replacing the code with
var graphic = new esri.Graphic(latlog, stopSymbol);
I Resolve this by replacing the code with
var graphic = new esri.Graphic(latlog, stopSymbol);
Isn't this question cross-posted elsewhere on the forum?
No Sephe, but what you need actually?
I need you to mark your other question as answered also:Why Height Restriction is not working. Thanks!