Skip To Content ArcGIS for Developers Sign In Dashboard

Take a map offline - preplanned

The preplanned workflow allows an organization to prepare offline maps so that they can be taken into the field, as required. The map author creates a map area defined by a specific geographical area of work. This process generates the associated map, tile package and geodatabase files and stores them in a mobile map package. The offline map resides in this mobile map package, in ArcGIS Online or ArcGIS Enterprise, until the field worker downloads it. As soon as the mobile map package is downloaded the field worker can disconnect their device and work with the map offline.

The main advantages of this workflow are:

  • The map author can organise and define very specific map areas for the field workers.
  • The user can obtain the preplanned map area more quickly because the mobile map package has been generated, in advance, by the author. In contrast, during the on-demand workflow the user has to both generate and download the mobile map package to their device.
  • Many users can download exactly the same mobile map package.

  1. Create preplanned map areas
  2. Identify a map area
  3. Create the parameters
  4. Create the job
  5. Run the job


You must ensure that all services used in the web map are enabled for offline use.

Create preplanned map areas

The preplanned workflow allows you to create a mobile map package, in advance, so that it can be downloaded by field workers when they need it. To do this create a map area within a web map and generate the mobile map package for the map area. You can create up to 16 map areas (and their mobile map packages) per web map.

You can do this manually using the ArcGIS Online or ArcGIS Enterprise user interface. Or you can automate these steps using either Python scripts or the ArcGIS REST API, as follows:

ArcGIS Online or ArcGIS Enterprise

Manually create, edit, and manage map areas as follows:

Python scripts

Use the ArcGIS API for Python to write python scripts to create map areas and generate their associated data packages. This is detailed in the managing map areas Python topic along with other useful map area management functions such as:

  • Update a map area and any of its packages that have been deleted or contain newer data.
  • Delete an individual data package.
  • Delete a map area along with its associated packages.
  • Inspect any of the map area's packages.
  • List the web map's current map areas.


Use the ArcGIS REST API if you need even more control when creating your preplanned map areas. There are two stages to this process:

  • To create a map area you must run the Create Map Area task providing a bookmark or geographical extent as the area of interest. Upon completion the task will generate a new portal item of type MapArea. This task requires that the web map is enabled for offline use. It is only available to the owner of the web map and organization administrators.
  • To create the data defined by the map area you must run the Setup Map Area task providing the map area portal item ID. This will create a set of data files such as tile packages, vector tile packages and SQLite geodatabases. For good data management, we strongly recommend that you also provide a folder to organize these files. This task is only available to the map area portal item owner and organization administrators.

Define updates

As well as creating the map area you can also define how users receive updates to the geodatabases in the offline map. Updates can happen by synchronizing the offline map's geodatabases with their online services or by applying scheduled update files to the geodatabases (read-only).

  • Synchronization allows you to download updates from the online service and or upload edits from the offline map, once connectivity is restored. You can configure this synchronization direction to determine in which direction edits are synchronized—download only, upload only, or bi-directional.
  • Apply scheduled updates allows you to schedule the regular creation of a file containing updates made to the feature service. The ArcGIS Runtine API can download the files it requires and apply them to the offline map's geodatabases. These files are relatively small so they are quick to download and fast to apply. This is a scalable solution for receiving updates to read-only geodatabases. This option is useful in cases where you need to provide many clients with an up to date read-only copy for reference. You can set this scheduled update option using the Setup Map Area task in the ArcGIS REST API. Applying these updates will be described in Update an offline map.

Once you have created the preplanned map areas they will be ready to download to your device. The following section describes how you build a Runtime app to download the map area.

Identify a map area

As discussed above, each web map can contain one or more preplanned map areas. Your app needs to determine which map area should be downloaded. You can do this by allowing the field worker to select a map area from a map view or from a list of map areas. Alternatively, the app logic could select a map area for the field worker.

Follow these steps to retrieve all of the map areas:

  1. Instantiate the offline map task by passing either a map (created from a web map) or a web map's portal item to the OfflineMapTask constructor.

    // Get a web map item using its ID.
    PortalItem webmapItem = await PortalItem.CreateAsync(portal, "acc027394bc84c2fb04d1ed317aac674");
    // Create a map from the web map item.
    Map onlineMap = new Map(webmapItem);
    // Create an OfflineMapTask from the map ...
    takeMapOfflineTask = await OfflineMapTask.CreateAsync(onlineMap);
    // ... or a web map portal item.
    takeMapOfflineTask = await OfflineMapTask.CreateAsync(webmapItem);

  2. Retrieve a list of the preplanned map areas from the web map using the GetPreplannedMapAreasAsync method on the OfflineMapTask.
  3. Load the preplanned map area; PreplannedMapArea.
  4. Display the map area titles and thumbnails in a list, or show the map area extents or just select a map area by name.

// Get a list of the available preplanned map areas.
IReadOnlyList<PreplannedMapArea> preplannedMapAreaList = await takeMapOfflineTask.GetPreplannedMapAreasAsync();

// Loop through all preplanned map areas.
foreach (PreplannedMapArea mapArea in preplannedMapAreaList)
    // Load the preplanned map area so property values can be read.
    await mapArea.LoadAsync();

    // Get the area of interest (geometry) for this area.
    Geometry aoi = mapArea.AreaOfInterest;

    // Get the portal item for this area, read the title and thumbnail image.
    PortalItem preplannedMapItem = mapArea.PortalItem;
    string mapTitle = preplannedMapItem.Title;
    RuntimeImage areaThumbnail = preplannedMapItem.Thumbnail;

Create the parameters

To take a map offline you can provide a set of DownloadPreplannedOfflineMapParameters. To obtain a set of default parameters pass in the map area to the CreateDefaultDownloadPreplannedOfflineMapParametersAsync method on the OfflineMapTask. The value of these default parameters will match the advanced offline settings configured by the web map author (discussed in Take web maps offline.

// Get the default parameters (provide a map area).
DownloadPreplannedOfflineMapParameters defaultDownloadParams =
    await takeMapOfflineTask.CreateDefaultDownloadPreplannedOfflineMapParametersAsync(downtownMapArea);

// Update some of the parameter values.
defaultDownloadParams.ContinueOnErrors = false;
defaultDownloadParams.IncludeBasemap = true;
defaultDownloadParams.ReferenceBasemapDirectory = dataFolder;

For more information see Advanced parameters.

Create the job

Create the download preplanned map area job by calling the DownloadPreplannedOfflineMap method on the OfflineMapTask. Pass in the PreplannedMapArea and a download directory on the device. If this download directory already exists it must be empty. If the directory doesn't exist, it will be created by the job.

DownloadPreplannedOfflineMapJob preplannedMapJob = takeMapOfflineTask.DownloadPreplannedOfflineMap(downtownMapArea, pathToOutputPackage);

If, however, you have created parameters to control the map content you must create the DownloadPreplannedOfflineMapJob using the DownloadPreplannedOfflineMap method on the OfflineMapTask and provide both the DownloadPreplannedOfflineMapParameters and the download directory.

preplannedMapJob = takeMapOfflineTask.DownloadPreplannedOfflineMap(parameters, pathToOutputPackage);

Run the job

To download the preplanned map area to your device start the DownloadPreplannedOfflineMapJob. Upon completion the job will return an instance of the DownloadPreplannedOfflineMapResult. If at least one table or layer failed to be taken offline the HasErrors property will be true. In this case you should examine the layerErrors and tableErrors dictionaries to identify the problem.

Remember that if the job's ContinueOnErrors parameter has been set to false then the job will be terminated immediately if a single layer or table fails to be taken offline.

If you want to display the map immediately then use the DownloadPreplannedOfflineMapResult.OfflineMap.

// Generate the offline map and download it.
DownloadPreplannedOfflineMapResult preplannedMapResult = await preplannedMapJob.GetResultAsync();

if (!preplannedMapResult.HasErrors)
    // Job completed successfully and all content was generated.
    Debug.WriteLine("Map " +
        preplannedMapResult.MobileMapPackage.Item.Title +
        " was saved to " +

    // Show the offline map in a MapView.
    MyMapView.Map = preplannedMapResult.OfflineMap;
    // Job is finished but one or more layers or tables had errors.
    if (preplannedMapResult.LayerErrors.Count > 0)
        // Show layer errors.
        foreach (var layerError in preplannedMapResult.LayerErrors)
            Debug.WriteLine("Error occurred when taking " +
                layerError.Key.Name +
                " offline. Error : " +
    if (preplannedMapResult.TableErrors.Count > 0)
        // Show table errors.
        foreach (var tableError in preplannedMapResult.TableErrors)
            Debug.WriteLine("Error occurred when taking " +
                tableError.Key.TableName +
                " offline. Error : " +

Note that the job will behave the same whether it was created with or without the DownloadPreplannedOfflineMapParameters.

For more details on how to work with jobs, see the Tasks and jobs topic.

Offline maps created by the preplanned workflow are stored in an unpacked mobile map package. When your app goes into the field you will need to open the map directly from the mobile map package downloadDirectory stored on your device. See Open an offline map for more information.

Advanced parameters

Once you have the default parameters you can customize them as required. For example:

  • Continue if a table or layer fails?

    The DownloadPreplannedOfflineMapJob takes a map's tables and layers offline. By default this job will continue to do this even if one table of layer has failed. Failures could be due to an intermittent network connection, loss of the service or an unsupported layer type. The approach ensures that you can take a map offline but you may have some data missing.

    To ensure that the offline map contains all of its layers and tables you can request that the job is stopped if any layer or table fails to download. To do this set the ContinueOnErrors property to false.

  • Which basemap should the map use?

    The author of the web map can define whether the map uses:

    • the basemap defined by the web map

      This is the default situation and ensures that a tile package is downloaded as part of the mobile map package.

    • a tile package that is already on the device

      The tile package must be downloaded or copied onto the device and can be located using an actual file path on the device or a path that is relative to the mobile map package. You must ensure that the tile package covers the areas required by your map area. The benefits of this option are that the mobile map package file will be smaller, the download time may be faster, and you can use the tile package in many different maps and apps.

      To use the tile package on your device you must set the referenceBasemapDirectory to the directory which contains the tile package. We recommend that you confirm that the tile package file, referenceBasemapFilename, exists on the device before running the AGSDownloadPreplannedOfflineMapJob. This job will add the tile package, as a basemap, to the offline map.

      // Use the ReferenceBasemapFilename value in the default parameters to create a path to the location of the expected tile package.
      string path = System.IO.Path.Combine(dataFolder, defaultDownloadParams.ReferenceBasemapFilename);
      // If the package exists, set the ReferenceBasemapDirectory so DownloadPreplannedOfflineMapJob can use the local tiles as the map's basemap.
      if (System.IO.File.Exists(path))
          defaultDownloadParams.ReferenceBasemapDirectory = dataFolder;


      If this tile package has a different spatial reference to your online map then the offline map will use the spatial of the tile package.

    • No basemap

      If you only want to take the operational layers offline you can programmatically exclude the basemap. To do this set the includeBasemap property to false. In this case the DownloadPreplannedOfflineMapJob will not download layers included as part of the map's basemap. This task will not use the local tile package, even if you have specified one.

  • Overwrite the geodatabase update mode?.

    If the web map author has specified that scheduled updates will be generated for all feature services in the map (discussed in Define updates, then the updateMode on the DownloadPreplannedOfflineMapParameters will be set to PreplannedUpdateModeDownloadScheduledUpdates. This means that the geodatabases will be read-only and can only receive updates via the scheduled update files.

    If you wish to edit these geodatabases and adopt the synchronization approach you can override this updateMode by setting it to PreplannedUpdateModeSyncWithFeatureServices. From this point you will not be able to update the geodatabase using the scheduled update files.


Instead of obtaining the default set of DownloadPreplannedOfflineMapParameters you could construct them manually. The author of the web map can recommended how data is downloaded to offline devices, and subsequently synchronized, by adjusting the map's advanced offline settings (discussed in Take web maps offline). You can access these advanced settings from the map's OfflineSettings. They include:

  • working with feature attachments
  • synchronizing edits
  • downloading a basemap or using one which is already on the device

Next steps

Once you have obtained the offline map follow these steps:

  1. Display and interact with the maps, layers and data offline. Explore and edit the feature data, if necessary.
  2. Update an offline map by synchronizing your edits with the online services, when connectivity is restored.
  3. Finish using an offline map by unregistering any geodatabases and fully releasing all locks on the mobile map package.