AnsweredAssumed Answered

Having trouble using World Route in iOS app

Question asked by stbrady on Sep 11, 2016
Latest reply on Sep 12, 2016 by Yue_Wu-esristaff

Hi there, Im new to using arcgis and I am trying to add routing capabilities to my iOS app. I downloaded the Routing Sample app from github and it works great straight out of the box. We need the routing to work in Australia so I thought I would use World Route. I created a developer account and have generated a short lived token so I can use World Route.

 

Any way, here what is happening:

 

I am declaring the route task url

#define kRouteTaskUrl @"http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer"

 and adding it to the map

 

NSURL *routeTaskUrl = [NSURL URLWithString:kRouteTaskUrl];

self.routeTask = [AGSRouteTask routeTaskWithURL:routeTaskUrl credential:cred];

and here is the error it is returning

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 9223372036854775807 beyond bounds [0 .. 16]'

*** First throw call stack:

I cant work out which array it is talking about though.

 

It's strange because if I use the original route url:

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route

Than it works fine, I just cant route anywhere in Australia.

 

Anyway I hope you can help me out.

 

Regards

Outcomes