speno

routetask attributeparametervalue error

Discussion created by speno on Jul 11, 2013
Latest reply on Jul 17, 2013 by dkudinov-esristaff
I keep getting an "attributeparametervalues parameter is invalid" error with this code. Can someone see what I'm missing?

var APV = [
  {
      "attributeName": "Avoid Limited Access Roads",
      "parameterName": "Restriction Usage",
      "value": "Avoid_Medium"
  }
    ];

    routeTask = new esri.tasks.RouteTask("https://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_NA/NAServer/Route");
    routeParams = new esri.tasks.RouteParameters();
    routeParams.stops = new esri.tasks.FeatureSet();
    routeParams.barriers = new esri.tasks.FeatureSet();
    routeParams.returnRoutes = true;
    routeParams.returnDirections = true;
    routeParams.directionsLengthUnits = esri.Units.MILES;
    routeParams.outSpatialReference = new esri.SpatialReference({ wkid: 102100 });
    routeParams.restrictionAttributeNames = ["Avoid Limited Access Roads"];
    routeParams.attributeParameterValues = APV;

Outcomes