ArcGIS Pro - Input types for CreateMobileMapPackage

1968
2
Jump to solution
05-02-2016 03:11 PM
GlennWilson1
New Contributor III

What are the input types for the CreateMobileMapPackage function?  So far, I've only been able to get it to work with MXD files, however, I can't modify MXD files in ArcGIS Pro, which is the only version in which I can run the function.  This means I have to have two versions of ArcGIS open just to do simple modifications.  It's maddening. 

Please tell me I'm missing something and it's really easy. 😉

Thanks!

0 Kudos
1 Solution

Accepted Solutions
GlennWilson1
New Contributor III

That's the page that gave me the original information for the mxd.  What wasn't readily apparent to me from the documentation was how to reference the current document in ArcGIS Pro.  The documentation says the input is a map or basemap to include in the mmpk, but it doesn't explicitly say how to reference the map or basemap.  I tried typing in the specific layer name, but that didn't work.

I gave it the .mxd file and it processed, thus my workflow of utilizing both ArcGIS versions.

The only version of the file I had for ArcGIS Pro was the project file.  I eventually put it in model builder and realized that you can give it the name of a map tab and the process will work -- and that makes perfect sense in hindsight, but I'm still not sure how to best approach my problem.  But that's a topic for a different thread.

What I've done so far is to either use the model-builder to select the map and export it, or use the python command and pass the name of the map tab.  So for anyone else who's a Pro newbie like myself, if you create a new project named MyProject, and you have a map tab named Map1, you can use the model builder to select Map1, or you can utilize the

CreateMobileMapPackage_management (in_map, output_file, {in_locator}, {area_of_interest}, {extent}, {clip_features}, {title}, {summary}, {description}, {tags}, {credits}, {use_limitations})

and insert "Map1" in place of the in_map variable.

arcpy.management.CreateMobileMapPackage("Map1", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations")

I have also used it to generate a mmpk for a mxd file like:

arcpy.management.CreateMobileMapPackage(r"c:\data\mymap.mxd", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations")

You can also click on a map tab, then under the Share toolbar, click Map file in the "Save as" group to save a mapx version of the map.  Then the documentation example given in Dan's link works perfectly.

You can then utilize the following to generate the mmpk file for the mapx file you just created:

arcpy.management.CreateMobileMapPackage(r"c:\data\mymap.mapx", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations")

I hope this is helpful!

View solution in original post

0 Kudos
2 Replies
GlennWilson1
New Contributor III

That's the page that gave me the original information for the mxd.  What wasn't readily apparent to me from the documentation was how to reference the current document in ArcGIS Pro.  The documentation says the input is a map or basemap to include in the mmpk, but it doesn't explicitly say how to reference the map or basemap.  I tried typing in the specific layer name, but that didn't work.

I gave it the .mxd file and it processed, thus my workflow of utilizing both ArcGIS versions.

The only version of the file I had for ArcGIS Pro was the project file.  I eventually put it in model builder and realized that you can give it the name of a map tab and the process will work -- and that makes perfect sense in hindsight, but I'm still not sure how to best approach my problem.  But that's a topic for a different thread.

What I've done so far is to either use the model-builder to select the map and export it, or use the python command and pass the name of the map tab.  So for anyone else who's a Pro newbie like myself, if you create a new project named MyProject, and you have a map tab named Map1, you can use the model builder to select Map1, or you can utilize the

CreateMobileMapPackage_management (in_map, output_file, {in_locator}, {area_of_interest}, {extent}, {clip_features}, {title}, {summary}, {description}, {tags}, {credits}, {use_limitations})

and insert "Map1" in place of the in_map variable.

arcpy.management.CreateMobileMapPackage("Map1", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations")

I have also used it to generate a mmpk for a mxd file like:

arcpy.management.CreateMobileMapPackage(r"c:\data\mymap.mxd", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations")

You can also click on a map tab, then under the Share toolbar, click Map file in the "Save as" group to save a mapx version of the map.  Then the documentation example given in Dan's link works perfectly.

You can then utilize the following to generate the mmpk file for the mapx file you just created:

arcpy.management.CreateMobileMapPackage(r"c:\data\mymap.mapx", r"c:\data\mymap.mmpk", None, None, "DEFAULT", "SELECT", "My Map Title", "My Map's Summary", "Description", "tag1, tag2", "Credit Information", "Use Limitations")

I hope this is helpful!

0 Kudos