Tasks for offline layers?

4207
6
06-02-2011 06:02 AM
RickJones
Occasional Contributor II
We need our app to function offline, so I've employed OfflineTiledLayer and OnlineOfflineFeatureLayer from here.
The feature layers display properly in each mode, however any Tasks (IdentifyTask, QueryTask, etc) require a Url (which means it must be online for it to work). I've tested this and just get an error connecting to the server.
I was using the IdentifyTask demo logic (which worked great) until I took away the internet.

Replacing the IdentifyTask logic with didClickAtPoint, and parsing the graphics collection works offline AND online, but the tolerance is too great (fat finger effect).
Also, we would like to be able to use QueryTask, Routing in the future.

Is there something I'm missing in the library or the above classes that would make this work?
0 Kudos
6 Replies
DiveshGoyal
Esri Regular Contributor
Rick, you are not missing anything. The API primarily works in connected mode - most of the heavy lifting is done on a remote server. The tasks take in a URL because they are just proxies to the capabilities on the server. They don't provide any functionality when the device is offline.
0 Kudos
MattDenton
New Contributor II

Divesh Goyal, is this still true in 10.2.4 and later?  The reason I ask is because this blog makes it seem like the API should be online/offline agnostic.

0 Kudos
DiveshGoyal
Esri Regular Contributor

Matt, Thanks for asking. We've added many offline capabilities to the SDK since that post in 2011, and these offline capabilities are available in 10.2.4. You can use the AGSRouteTask to compute routes offline using a Network dataset on the device. You can also use the AGSLocator to geocode/reverse-geocode addresses offline using an Address Locator dataset

More info here - Route task—ArcGIS Runtime SDK for iOS | ArcGIS for Developers  and Locator—ArcGIS Runtime SDK for iOS | ArcGIS for Developers

You can also work with maps offline including - basemap tiles and operational features.

Create an offline map—ArcGIS Runtime SDK for iOS | ArcGIS for Developers

MattDenton
New Contributor II

Thanks for your reply, Divesh.  I should have been more clear, but I was asking specifically about the usage pattern for AGSQueryTask and AGSIdentifyTask.  I suspect but am not sure if those tasks are still facades to easily interact with the server (and do not support offline).

Otherwise, thanks for the links, I will check them out!

0 Kudos
DiveshGoyal
Esri Regular Contributor

Yes, those tasks still need the server.

0 Kudos
RickJones
Occasional Contributor II
Thank you for confirming that.

What I ended up doing was loading the OnlineOffline layers, but configuring the Tasks to use the URL for their corresponding Maplayer services.
0 Kudos