Why Height Restriction is not working

4098
4
Jump to solution
05-03-2015 03:10 AM
AshishRao
New Contributor II

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);

}

    function showRoute(solveResult) {
        clearRoutes();
        dojo.forEach(solveResult.routeResults, function (routeResult, i) {
            routes.push(map.graphics.add(routeResult.route.setSymbol(routeSymbols)));
       

});

}

    }
// 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

1 Solution

Accepted Solutions
AshishRao
New Contributor II

I Resolve this by replacing the code with

  var graphic = new esri.Graphic(latlog, stopSymbol);

View solution in original post

4 Replies
AshishRao
New Contributor II

I Resolve this by replacing the code with

  var graphic = new esri.Graphic(latlog, stopSymbol);

SepheFox
Frequent Contributor

Isn't this question cross-posted elsewhere on the forum?

AshishRao
New Contributor II

No Sephe, but what you need actually?

0 Kudos
SepheFox
Frequent Contributor

I need you to mark your other question as answered also:Why Height Restriction is not working. Thanks!

0 Kudos