Rendering Mobile Map Packages

4463
15
11-29-2016 08:30 AM
MarkCederholm
Occasional Contributor III

I'm seeing the same problems with Mobile Map Packages in the 100.0 release that I saw in the Beta.  I cannot zoom or pan to the full extent of the data, and not all features are rendering properly.  Is this issue still being worked on for a future release?

Tags (1)
0 Kudos
15 Replies
MarkCederholm
Occasional Contributor III

FYI, I was able to work around the pan/zoom issue by moving the layers to a new map instead of just assigning the MMPK map to the mapview.  However, not all layers are present when I try to grab them, which is a head-scratcher.  I may need to get tech support involved with this one.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi Mark,

Have you tried setting the extent of your map before creating the mmpk?

http://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-mobile-map-package.htm

"If an extent is not specified, the visible extent of your map will be used to define the area of interest and consolidate only those features that intersect that extent."

Cheers

Mike

0 Kudos
MarkCederholm
Occasional Contributor III

I've been explicitly setting the extent, and even when it's zoomed WAY out it makes no difference.

0 Kudos
MarkCederholm
Occasional Contributor III

After revisiting the issue, I've determined that while ArcGIS Pro has no trouble re-importing MMPKs that I create, there seem to be some bugs and/or compatibility issues with Runtime.  These are the three issues I'm running into:

  1. Definition queries are not being honored
  2. Labels do not display by default if enabled in the MMPK
  3. Layers symbolized on multiple fields will not appear in the map

While the first two seem like actual bugs, the third may simply be a feature that's not yet supported.  Esri did create a bug number (BUG-000102308 ) but I don't think it's worded well:  it's not the MMPK itself that has problems, but the way Runtime is creating a map from it.

0 Kudos
DonKemlage
Esri Contributor

Hi Mark,

This may be a bug that we are currently working on. Try the following workaround and see if is helps:

Before you set the MapView.Map property to contain the .MMPK's map, add a base layer that has a larger initial extent (ideally the same base layer that you might have used in ArcGIS Pro to create the .MMPK). Then after you set the MapView.Map property, remove the base layer. The layers in the .MMPK will display at the extent as they were originally created in ArcGIS Pro. The unintended side effect of this workaround is that you can now zoom out past the original extent that was specific in ArcGIS Pro (but at least you can see all of the data).

Here is some sample code to demonstrate the workaround:

string thePathToMMPK = "C:\\Temp\\CurrentDisplayExtent.mmpk";
MobileMapPackage theMMPK = Await MobileMapPackage.OpenAsync(thePathToMMPK);
IReadOnlyList<Map> theMaps = theMMPK.Maps;
Map myMap = theMaps[0];

// WORKAROUND - Part1 (Add a base layer with a larger viewable extent)
var serviceUri = new Uri(http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer);
ArcGISMapImageLayer baseLayer = new ArcGISMapImageLayer(serviceUri);
myMap.Basemap.BaseLayers.Add(baseLayer);

MyMapView.Map = myMap;

// WORKAROUND - Part2 (Remove the base layer)
LayerCollection myLayerCollection = MyMapView.Map.Basemap.BaseLayers;
myLayerCollection.RemoveAt(0);

I hope this helps.

-Don

0 Kudos
DonKemlage
Esri Contributor

Hey Mark,

Great news! This issue has been fixed with ESRI's latest version of the ArcGIS Runtime for .NET (v100.1) that was just released yesterday (6/29/2017). Read all about the Update 1 capabilities in the blog post: https://blogs.esri.com/esri/arcgis/2017/06/29/arcgis-runtime-sdk-update-1-is-now-available/

-Don

0 Kudos
MarkCederholm
Occasional Contributor III

Great, I look forward to checking it out.

0 Kudos
MarkCederholm
Occasional Contributor III

Well, I don't know which issue you think is fixed, but I'm still having to use the add baselayer workaround on my example MMPK in order to zoom out beyond a certain scale.  However, I can at least pan to the end of the data now.  Anyway, I'll keep looking into MMPK issues with 100.1, and report any problems directly to tech support.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi Mark,

What version of ArcGIS Pro are you using to create your MMPK?

Cheers

Mike

0 Kudos