Create Mobile Map Package (Data Management)

Summary

Packages maps and basemaps along with all referenced data sources into a single .mmpk file.

Usage

  • Mobile map packages can be used by ArcGIS Pro, ArcGIS Navigator, and with ArcGIS Maps SDKs for Native Apps.

  • Mobile map packages can be shared with others by uploading them to your organization in ArcGIS Online or by sharing an .mmpk file through common file sharing methods.

  • Mobile map packages support simple features, raster datasets, tables, relationship classes, locators, network datasets, and maps that contain map tile (.tpk) or vector tile (.vtpk) packages. Mobile map packages created in ArcGIS Pro for use with ArcGIS Maps SDKs for Native Apps support the following layer types: feature layers, raster layers, image tile layers from previously created tile packages, and vector tile layers from previously created vector tile packages.

  • If no extent is specified, the visible extent of the map will be used to define the area of interest (AOI) and consolidate only those features that intersect that extent.

  • When creating a mobile map package, all maps, basemaps, and data layers will be projected to a common coordinate system. The coordinate system that will be used is the coordinate system of the first input map specified.

  • If the map contains a network layer that references a network dataset, it will be included in the mobile map package as a transportation network for routing and driving directions. All feature classes and tables that the network references will become part of the mobile map package. This may include layers that are not part of the map. For example, if there is only a network layer in the map, the package will include the streets, junctions, and turns feature classes associated with the network.

    For a network dataset to support mobile map packaging, keep the following restrictions in mind:

    • The network dataset must be part of a geodatabase. This excludes networks that are in SDC or shapefile format.
    • The network dataset must be from ArcGIS 10.0 or later. If the network is from an earlier version, upgrade the geodatabase and network.
    • The network dataset cannot have an unknown coordinate system.
    • The network dataset cannot use any Visual Basic or Python script evaluators.
    • The network dataset cannot use any custom COM evaluators.
    • A network dataset that uses live traffic will be packaged, but the live traffic components will not be used since they are not supported.

Parameters

LabelExplanationData Type
Input Map

One or more maps or basemaps that will be packaged into a single .mmpk file.

Map
Output File

The output mobile map package (.mmpk).

File
Input Locator
(Optional)

One or more locators (.loc) that will be included in the mobile map package.

Note:
Locators have the following restrictions:
  • The locator cannot have an unknown coordinate system.
  • The locator or any participating locator in a composite locator cannot be a geocoding service, including services from ArcGIS Enterprise or ArcGIS Online.
Address Locator
Area of Interest
(Optional)

A polygon layer that defines the area of interest. Only those features that intersect this value will be included in the mobile map package.

Feature Layer
Extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • Current Display Extent Map View—The extent will be based on the active map or scene.
  • Draw Extent Square and Finish—The extent will be based on a rectangle drawn on the map or scene.
  • Extent of a Layer Layer—The extent will be based on an active map layer. Choose an available layer or use the Extent of data in all layers option. Each map layer has the following options:

    • All Features Select All—The extent of all features.
    • Selected Features Area from Selected Features—The extent of the selected features.
    • Visible Features Extent Indicator—The extent of visible features.

  • Browse Browse—The extent will be based on a dataset.
  • Intersection of Inputs Intersect—The extent will be the intersecting extent of all inputs.
  • Union of Inputs Union—The extent will be the combined extent of all inputs.
  • Clipboard Paste—The extent can be copied to and from the clipboard.
    • Copy Extent Copy—Copies the extent and coordinate system to the clipboard.
    • Paste Extent Paste—Pastes the extent and coordinate system from the clipboard. If the clipboard does not include a coordinate system, the extent will use the map’s coordinate system.
  • Reset Extent Reset—The extent will be reset to the default value.

When coordinates are manually provided, the coordinates must be numeric values and in the active map's coordinate system. The map may use different display units than the provided coordinates. Use a negative value sign for south and west coordinates.

Extent
Clip Features
(Optional)

Specifies whether the geometry of the output features will be clipped to the specified Area of Interest or Extent parameter value, or remain unaltered.

  • Checked—The geometry of the features will be clipped to the specified Area of Interest or Extent parameter value.
  • Unchecked—Features in the map will be selected and their geometry will remain unaltered. This is the default.

Boolean
Title
(Optional)

The title information that will be added to the properties of the package.

String
Summary
(Optional)

The text that will be used as the output package's summary property.

String
Description
(Optional)

The description information that will be added to the properties of the package.

String
Tags
(Optional)

The tag information that will be added to the properties of the package. Multiple tags can be added or separated by a comma or semicolon.

String
Credits
(Optional)

The credit information that will be added to the properties of the package.

String
Use Limitations
(Optional)

The use limitations that will be added to the properties of the package.

String
Enable Anonymous Use
(Optional)

Specifies whether the mobile map can be used without an Esri Named User account.

  • Checked—Anyone with access to the package can use the mobile map without signing in with an Esri Named User account.
  • Unchecked—Anyone with access to the package must be signed in with an Esri Named User account to use the mobile map. This is the default.

License:

This optional parameter is only available with the Publisher extension.

Boolean
Enable Map Expiration
(Optional)

Specifies whether a time-out will be enabled on the mobile map package.

  • Checked—A time-out will be enabled on the mobile map package.
  • Unchecked—A time-out will not be enabled on the mobile map package. This is the default.
License:

This optional parameter is only available with the Publisher extension.

Boolean
Map Expiration Type
(Optional)

Specifies the type of access a user will have to the expired mobile map package.

  • Allow to openA user of the package will be warned that the map has expired but will be allowed to open it. This is the default.
  • Do not allow to openA user of the package will be warned that the map has expired and will not be allowed to open it.
License:

This optional parameter is only available with the Publisher extension.

String
Expiration Date
(Optional)

The date the mobile map package will expire.

License:

This optional parameter is only available with the Publisher extension.

Date
Expiration Message
(Optional)

A text message that will display when an expired map is accessed.

License:

This optional parameter is only available with the Publisher extension.

String
Keep only the rows which are related to features within the extent
(Optional)

Specifies whether the specified extent will be applied to related data sources.

  • Unchecked—Related data sources will be consolidated in their entirety. This is the default.
  • Checked—Only related data corresponding to records within the specified extent will be consolidated.
Boolean
Reference online content
(Optional)

Specifies whether service layers will be referenced in the package.

  • Unchecked—Service layers will not be referenced in the mobile package. This is the default.
  • Checked—Service layers will be referenced in the mobile package.

Boolean

arcpy.management.CreateMobileMapPackage(in_map, output_file, {in_locator}, {area_of_interest}, {extent}, {clip_features}, {title}, {summary}, {description}, {tags}, {credits}, {use_limitations}, {anonymous_use}, {enable_map_expiration}, {map_expiration_type}, {expiration_date}, {expiration_message}, {select_related_rows}, {reference_online_content})
NameExplanationData Type
in_map
[in_map,...]

One or more maps or basemaps that will be packaged into a single .mmpk file.

Map
output_file

The output mobile map package (.mmpk).

File
in_locator
[in_locator,...]
(Optional)

One or more locators (.loc) that will be included in the mobile map package.

Note:
Locators have the following restrictions:
  • The locator cannot have an unknown coordinate system.
  • The locator or any participating locator in a composite locator cannot be a geocoding service, including services from ArcGIS Enterprise or ArcGIS Online.
Address Locator
area_of_interest
(Optional)

A polygon layer that defines the area of interest. Only those features that intersect this value will be included in the mobile map package.

Feature Layer
extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
clip_features
(Optional)

Specifies whether the geometry of the output features will be clipped to the specified area of interest or extent, or remain unaltered.

  • CLIPThe geometry of the features will be clipped to the specified area_of_interest or extent parameter value.
  • SELECT Features in the map will be selected and their geometry will remain unaltered. This is the default.
Boolean
title
(Optional)

The title information that will be added to the properties of the package.

String
summary
(Optional)

The text that will be used as the output package's summary property.

String
description
(Optional)

The description information that will be added to the properties of the package.

String
tags
(Optional)

The tag information that will be added to the properties of the package. Multiple tags can be added or separated by a comma or semicolon.

String
credits
(Optional)

The credit information that will be added to the properties of the package.

String
use_limitations
(Optional)

The use limitations that will be added to the properties of the package.

String
anonymous_use
(Optional)

Specifies whether the mobile map can be used without an Esri Named User account.

  • ANONYMOUS_USEAnyone with access to the package can use the mobile map without signing in with an Esri Named User account.
  • STANDARDAnyone with access to the package must be signed in with an Esri Named User account to use the mobile map. This is the default.
License:

This optional parameter is only available with the Publisher extension.

Boolean
enable_map_expiration
(Optional)

Specifies whether a time-out will be enabled on the mobile map package.

  • ENABLE_MAP_EXPIRATIONA time-out will be enabled on the mobile map package.
  • DISABLE_MAP_EXPIRATIONA time-out will not be enabled on the mobile map package. This is the default.
License:

This optional parameter is only available with the Publisher extension.

Boolean
map_expiration_type
(Optional)

Specifies the type of access a user will have to the expired mobile map package.

  • ALLOW_TO_OPENA user of the package will be warned that the map has expired but will be allowed to open it. This is the default.
  • DONOT_ALLOW_TO_OPENA user of the package will be warned that the map has expired and will not be allowed to open it.
License:

This optional parameter is only available with the Publisher extension.

String
expiration_date
(Optional)

The date the mobile map package will expire.

License:

This optional parameter is only available with the Publisher extension.

Date
expiration_message
(Optional)

A text message that will display when an expired map is accessed.

License:

This optional parameter is only available with the Publisher extension.

String
select_related_rows
(Optional)

Specifies whether the specified extent will be applied to related data sources.

  • KEEP_ONLY_RELATED_ROWSOnly related data corresponding to records within the specified extent will be consolidated.
  • KEEP_ALL_RELATED_ROWSRelated data sources will be consolidated in their entirety. This is the default.
Boolean
reference_online_content
(Optional)

Specifies whether service layers will be referenced in the package.

  • INCLUDE_SERVICE_LAYERSService layers will be referenced in the mobile package.
  • EXCLUDE_SERVICE_LAYERSService layers will not be referenced in the mobile package. This is the default.
Boolean

Code sample

CreateMobileMapPackage example 1 (Python window)

The following is a Python sample for the CreateMobileMapPackage function that packages multiple maps and basemaps from a project.

import arcpy

arcpy.management.CreateMobileMapPackage(
    ["Basemap1", "Basemap2", "Map1"], r"d:\temp\MobileMapPackage1.mmpk", 
    r"d:\data\MyLocators\AddressLocator.loc", None, "DEFAULT", "SELECT", 
    "Title", "Summary", "description", "Tag", "Credit information", 
    "Usage_Limitations")
CreateMobileMapPackage example 2 (stand-alone script)

The following is a Python sample for the CreateMobileMapPackage function using an area of interest to clip features and setting an expiration date for two weeks from creation.

import arcpy
import datetime

days_valid = 14
expiration_date = (datetime.date.today() + datetime.timedelta(days=days_valid)).strftime("%x")
outputfile = "d:/Data/Output/sandiego.mmpk"

arcpy.management.CreateMobileMapPackage(
    [r"C:\data\Basemap1.mapx", r"C:\data\Map1.mapx"], outputfile, None, 
    r"\\share\layers\AreaOfInterest.lyrx", "DEFAULT", "CLIP", "Title", 
    "Summary", "description", "Tag", "Credits", "Use",
    "STANDARD", "ENABLE_MAP_EXPIRATION",
    "DONOT_ALLOW_TO_OPEN", expiration_date,
    "This map is expired.  Contact the map publisher for an updated map.")

Environments

Special cases

Parallel Processing Factor

If the environment is not specified, the tool will use one half of the available cores.

Related topics