I'm using ARCGIS 100.15. I'm trying to use travel mode restrictions by adding height and weight restrictions. In iOS it is not routing correctly and is routing over a bridge which violates the restrictions. I know the route is incorrect, because we also have an Android app with the exact same restrictions and the route on Android avoids the bridge as expected. Does anyone know why this is not working on iOS?
Sample code of defining restrictions below:
routeTask.defaultRouteParameters { (params: AGSRouteParameters?, error: Error?) -> Void in
guard error == nil, let params = params else {
print("Loading default parameters failed with error : \(String(describing: error?.localizedDescription))")
return completion(nil, error)
}
params.returnStops = true
params.returnRoutes = true
params.setStops(stops)
params.findBestSequence = false
params.preserveFirstStop = true
params.preserveLastStop = true
params.travelMode?.attributeParameterValues.forEach({ attribute in
if attribute.attributeName == "HeightRestriction" && attribute.parameterName == "Vehicle Height" {
attribute.parameterValue = 480
print("Assigning height value \(attribute.parameterValue ?? "nil").")
}
if attribute.attributeName == "WeightRestriction" && attribute.parameterName == "Vehicle Weight" {
attribute.parameterValue = 888888
print("Assigning weight value \(attribute.parameterValue ?? "nil").")
}
})
print("Returning defaultParameters successfully.")
completion(params, nil)
}
Hi Ron,
We need to give parameterValue as a Double value like Double(88888). Weight Restriction or Height Restriction are not accepting integer values.
Hi Ron, let me know if you have success with the suggestion above. 🙂