1. Define app functionalities
Before you start building your partially offline app
- Will you be working with preconfigured 3D scenes or 2D maps?
- Will you be editing data offline and synchronizing offline edits?
- Will you be geocoding, routing, or finding an address using a locator file?
Once you have outlined the requirements of your partially offline app, you can begin to prepare a mobile data source.
2. Prepare a mobile data source
To start creating a partially offline app.mmpk) or mobile scene package.mspk) created in ArcGIS Pro
If you choose an offline map
Use the following table to help select your mobile data source
| Offline maps | Offline data | Mobile packages | Data files | |
|---|---|---|---|---|
| 2D maps | 1 | 1 | ||
| 3D scenes | 2 | 2 | ||
| Edit data while offline | 3 | |||
| Synchronize offline edits | 4 | |||
| Fully disconnected apps/devices | 4 | 4 | ||
| Offline geocoding | 5 | |||
| Offline routing | 6 | |||
| Offline analysis | ||||
| 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 ArcGIS Pro
- 6. Network Analysis dataset exported from ArcGIS Pro
Once you select a mobile data source, the general steps to prepare the mobile data source are:
- Create a web map
A web map is a map stored as a JSON object that defines properties such as the basemap layer, data layers, layer styles, and pop-up styles. Its JSON structure is defined by the web map specification. using Map ViewerMap Viewer is a browser-based mapping tool that can view, create, and save web maps. It can also perform mapping, visualization, and spatial analysis operations. or ArcGIS ProArcGIS Pro is a professional desktop GIS application that can explore, visualize, analyze, and manage 2D and 3D data. . - Enable it for offline use in the Settings tab of the web map's item page
An item page is a web page in ArcGIS Online or the developer dashboard used to access and manage the properties for an item and the content it references such as a web map, hosted layer, or file. . - Obtain the item ID so you can download it later.
3. Build the app
Once you have prepared a mobile data source
Example code to access data from a mobile data source in an offline app:
var portal = await ArcGISPortal.CreateAsync();
var portalItem = await PortalItem.CreateAsync(portal, "YOUR_ITEM_ID"); // Replace with your web map ID
var map = new Map(portalItem);
OfflineMapTask offlineTask = await OfflineMapTask.CreateAsync(map);
GenerateOfflineMapParameters generateParameters =
await offlineTask.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);
GenerateOfflineMapJob job = offlineTask.GenerateOfflineMap(generateParameters, "path\\to\\map\\directory");
GenerateOfflineMapResult result = await job.GetResultAsync();
if (result.OfflineMap is Map offlineMap)
{
MainMapView.Map = offlineMap;
}Tutorials

Create an offline-enabled web map

Create an offline map area
Use your portal to create an offline map area from an offline-enabled web map.
Workflows
Create an app using a web map (ahead of time)
Learn how to build an offline app using an offline-enabled web map using the ahead-of-time method.

Create an app using a web map (on-demand)
Learn how to build an offline app using an offline-enabled web map using the on-demand method.

Create an app using a web map with layers (ahead of time)
Learn how to build an offline app using an offline-enabled web map and feature layer using the ahead-of-time method.

Create an app using a web map with layers (on-demand)
Learn how to build an offline app using an offline-enabled web map and feature layer using the on-demand method.



