Selecting the best approach
There are many different types of offline applications that you can build. This page will help you understand the pros and cons of the different approaches you can take to build these applications, and how to select the best approach to use.
Here are some common examples of offline applications:
- Simple map or scene viewers.
- Data collection or data editing applications.
- Applications that are used in very variable or unpredictable network conditions.
- Applications supporting large mobile workforces that need up-to-date maps.
- Applications that are prohibited from using a network at all.
Each offline application has different requirements for accessing, displaying, editing, or analyzing data in maps or scenes.
To support these different requirements, there are four approaches to using ArcGIS tools, technologies, and APIs to build your application:
- Download an offline map from a web map.
- Download offline data from a data service.
- Access a mobile package of maps or scenes.
- Access local data files directly.
The approach you choose depends on the requirements, workflows, and UX for your application.
Determining an approach
There are some easy questions you can ask up front that help you narrow down the approach or approaches that will work for your application:
Do you need to edit data in a feature service?
If your offline application needs to edit data hosted in a feature service, you can:
- Download an offline map from a web map.
- Download offline data from feature services.
You can work with an offline map or offline data without a network connection, but will need a network connection to initially download them and later to synchronize offline edits with the source data.
Is your device permanently offline?
Some offline applications are prohibited from accessing a network for regulatory or operational reasons. Others must work where no network is available. If your offline application will never have access to a network connection, you can:
- Sideload a mobile package of maps or scenes.
- Sideload data files and construct a map or scene in code, adding layers from the sideloaded data files.
You can edit data in shapefiles, GeoPackages, and KML, but other data files are read-only. See Data files for more details.
Will you be working in 3D?
If your offline application needs to work in 3D, you cannot use offline maps. Instead, you can either:
- Sideload or download a mobile scene package.
- Construct a scene in code, adding layers from data files or offline data.
Will you be geocoding or routing?
If your offline application needs to perform geocoding, reverse geocoding, place search, or routing without a network connection, then you need to use mobile packages.
If your offline application doesn't need to edit feature service data or you know you will have a network connection at least some of the time, then you have much more flexibility in choosing an approach.
This flowchart goes into greater detail about choosing an offline approach for your application:
Figure 2. Choosing an approach for your offline application
Using web maps and mobile packages vs data services and files
You should consider whether to use offline maps or mobile packages to access maps and scenes, or to construct maps and scenes in code using offline data and data files.
These are some benefits of using offline maps and mobile packages:
Reuse: A map or scene can be configured once and re-used by many applications and users, whether it is accessed using an offline map, or a mobile package.
Shared data content: You can include multiple maps in one mobile map package, or multiple scenes in one mobile scene package. Data content can be reused between multiple maps or scenes within a single package, so these can be efficient ways to use multiple maps and scenes in offline applications.
Less code: Offline maps and the maps and scenes contained in mobile packages specify multiple configuration settings, including:
- Initial display area
- Data-driven styling
- Layer ordering
- Scale-dependent layer visibility
- Layer data filtering
- Popup definitions
Offline maps and mobile packages specify basemap layers and data layers which reference data content that is included in the offline map or mobile package.
If your application works directly with offline data or data files, you will need additional code to create layers referencing the data, and to manage the map and scene configuration properties. If you use offline data, your application may also need to manage downloading and synchronizing multiple offline data items, which an offline map will coordinate automatically.
You typically decide to use offline data or data files when a map or scene is not the focus of your application, or if your application has more complex data workflows than offline maps or mobile packages can support.
Capabilities at a glance
This table summarizes the capabilities of each approach.
|Offline maps||Offline data||Mobile packages||Data files|
|Edit data while offline||3|
|Synchronize offline edits||4|
|Fully disconnected apps/devices||4||4|
|Offline place search||5|
|Set expiration date for data access|
- 1. Map constructed in code
- 2. Scene constructed in code
- 3. Shapefiles, GeoPackages, and KML
- 4. Custom sideloading workflows required
- 5. Locator exported from ArcMap
- 6. Network Analysis dataset exported from ArcMap
You can combine these various approaches to fine tune your offline application. For example, you can:
- Download an offline map and add a layer from a local shapefile.
- Display a map from a mobile map package and add a layer from a shapefile. You can then edit data in the shapefile and later copy the shapefile from the device to retrieve those edits.
Combining offline approaches with online services
Offline applications can also make use of online capabilities while connected to a network. For example, you can:
- Use an offline map, but geocode and find routes using ArcGIS Online.
- Display a web map and add a layer from a local shapefile.
- Configure an offline map (or the maps or scenes in a mobile package) to include online layers. The content for these layers is not included in the offline map or mobile package. Instead, an online layer will access a data service (such as a traffic layer) whenever a network connection is available.