Select to view content in your preferred language

So many ways to get offline maps.

777
2
Jump to solution
02-16-2023 05:31 PM
DuanePfeiffer
New Contributor III

I need to download an offline map.  No Swift documentation in drop downs here: https://developers.arcgis.com/documentation/mapping-apis-and-services/offline/offline-data/

From what I can tell there are three ways to get an offline map.

  1. Offline data (above link)
  2. On-demand offline map
  3. Pre-planned offline map

Just wanted to give some feedback.  Kinda confusing when trying to choose the best option.  My 100.x code base uses the offline data method with completion blocks.  So far I've coded a solution for this method that I think will work using async throws methods.  It's my weekend so I'll have to resume on Monday.

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Hi @DuanePfeiffer ,

Thanks for the feedback. This has always been a bit of complex topic and we're always keen to improve how we cover it.

This documentation might help a bit. In particular, this diagram:

2023-02-17_11-34-54.png

Working offline essentially breaks down to two main approaches:

  1. Using a map (top half of the diagram).
  2. Using data and to build a map in code (bottom half of the diagram).

Using a map can involve taking a web map offline from your app using the on-demand or pre-planned workflow, or by publishing a Mobile Map Package from ArcGIS Pro and opening that in your app.

Using data can be done by downloading data from services (feature data, image tiled data, or vector tiled data), or by using local data files like mobile geodatabases, geopackages, shapefiles, KML files, etc.

The documentation I link to above goes into more detail on those two approaches, and how you might pick one over another or combine them. Each has pros and cons. Some support editing, some don't, for example, some are more scalable for large workforces, while other provide more flexibility.

Unfortunately we haven't had time yet to get Swift SDK code snippets in place in the doc. But the patterns are the same as for the 100.x Runtime SDK for iOS, so that should help.

There are also topics in the Swift documentation itself: https://developers.arcgis.com/swift/offline-maps-scenes-and-data/

While that's also missing some code snippets for the time being, the patterns you can find here should help you out. For example: https://developers.arcgis.com/ios/offline-maps-scenes-and-data/download-an-offline-map-on-demand/

View solution in original post

2 Replies
Nicholas-Furness
Esri Regular Contributor

Hi @DuanePfeiffer ,

Thanks for the feedback. This has always been a bit of complex topic and we're always keen to improve how we cover it.

This documentation might help a bit. In particular, this diagram:

2023-02-17_11-34-54.png

Working offline essentially breaks down to two main approaches:

  1. Using a map (top half of the diagram).
  2. Using data and to build a map in code (bottom half of the diagram).

Using a map can involve taking a web map offline from your app using the on-demand or pre-planned workflow, or by publishing a Mobile Map Package from ArcGIS Pro and opening that in your app.

Using data can be done by downloading data from services (feature data, image tiled data, or vector tiled data), or by using local data files like mobile geodatabases, geopackages, shapefiles, KML files, etc.

The documentation I link to above goes into more detail on those two approaches, and how you might pick one over another or combine them. Each has pros and cons. Some support editing, some don't, for example, some are more scalable for large workforces, while other provide more flexibility.

Unfortunately we haven't had time yet to get Swift SDK code snippets in place in the doc. But the patterns are the same as for the 100.x Runtime SDK for iOS, so that should help.

There are also topics in the Swift documentation itself: https://developers.arcgis.com/swift/offline-maps-scenes-and-data/

While that's also missing some code snippets for the time being, the patterns you can find here should help you out. For example: https://developers.arcgis.com/ios/offline-maps-scenes-and-data/download-an-offline-map-on-demand/

Nicholas-Furness
Esri Regular Contributor

And to clarify, whatever you did in 100.x will work in the 200.x Swift SDK (same patterns, for the most part you just drop the AGS from the class name). You'll just be using Swift Concurrency instead of callback blocks. You can see this example for some details too: https://developers.arcgis.com/swift/sample-code/generate-offline-map/

0 Kudos