Hello
I'm calling the route service from iOS as follows:
let routeTask = AGSRouteTask(url: URL(string: "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World")!)
routeTask.defaultRouteParameters { [weak self] (defaultParameters, error) in guard error == nil else {
print("Error getting default parameters: \(error!.localizedDescription)")
return
}
I keep hitting the error condition with Error Code 15 stating "Error getting default parameters: Cannot call this method in this context".
Anyone have any leads on what might cause this?
Thanks
Not exactly. I was something like this Sample Code—ArcGIS Runtime SDK for iOS | ArcGIS for Developers not github. Steps are pretty similar if not exactly the same however I started from an existing project not the sample code.
It looks like you took the authentication code from the OAuth 2 DevLab. It's hard to know where things went wrong, but I would like to dig a little deeper in case we can improve things.
I know you moved on from the point where things weren't working, but if you are able to DM me an Xcode project that shows this behavior, I'd be happy to take a look.
Let me know.
For some reason I don't see the post but I saw an email where someone asked me if the routeTask was a class level or method level variable. It is class level per the example I saw.
I think that was my original reply above, which I edited to be more explicit/correct.