How would I go about using other layers with those in a Mobile Map package?
The examples assume i want the
ArcGISTiledLayer tiledLayerBaseMap = new ArcGISTiledLayer("http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer");
mMap.getBasemap().getBaseLayers().add(tiledLayerBaseMap);
No errors. The basemap seems to be added. I just never see it.
<CODE class=""><SPAN class="">// Create a MobileMapPackage from the offline map directory path</SPAN><SPAN class="">final</SPAN> MobileMapPackage offlineMapPackage = <SPAN class="">new</SPAN> MobileMapPackage(mMobileMapPackage); offlineMapPackage.loadAsync(); offlineMapPackage.addDoneLoadingListener(<SPAN class="">new</SPAN> Runnable() { <SPAN class="">@Override</SPAN> <SPAN class="">public void run() </SPAN>{ <SPAN class="">// Get the title from the package metadata</SPAN> System.out.println(<SPAN class="">"Title: "</SPAN> + offlineMapPackage.getItem().getTitle()); <SPAN class="">// Get the map from the package and set it to the MapView</SPAN> mMapView.setMap(offlineMapPackage.getMaps().get(<SPAN class="">0</SPAN>)); } });
But suppose the MobileMap lacks a basemap or some other layer that is packaged separately.
The following things DON'T work.
1. Load map from package, then add layers to it.
<CODE class=""><CODE class="">2. Try to detach the layers from the mobile map packagemap and place it in an already created map. <BR />mMap = mapPackage.getMaps().get(0);
ArcGISMap defaultMap = new ArcGISMap(Basemap.Type.TOPOGRAPHIC_VECTOR,44.417,-112.08,11);
</CODE><PRE class="lia-code-sample line-numbers language-none"><SPAN style="color: #808080; font-style: italic;">for(int i=0;i<mMap.getBasemap().getBaseLayers().size(); i++)
</SPAN><SPAN style="color: #808080; font-style: italic;">{
</SPAN><SPAN style="color: #808080; font-style: italic;"> Layer l = mMap.getBasemap().getBaseLayers().remove(0);
</SPAN><SPAN style="color: #808080; font-style: italic;"> defaultMap.getBasemap().getBaseLayers().add(l);
</SPAN><SPAN style="color: #808080; font-style: italic;">}
</SPAN><SPAN style="color: #808080; font-style: italic;">for(int j=0;j<mMap.getOperationalLayers().size(); j++)
</SPAN><SPAN style="color: #808080; font-style: italic;">{
</SPAN><SPAN style="color: #808080; font-style: italic;"> Layer o = mMap.getOperationalLayers().remove(0);
</SPAN><SPAN style="color: #808080; font-style: italic;"> defaultMap.getOperationalLayers().add(o);
</SPAN><SPAN style="color: #808080; font-style: italic;">}</SPAN></PRE><CODE class=""><BR />This works even less. The map is completely invalid and only shows gray. Not even a grid. <BR /><BR />What might still work:<BR /><BR />3. Unpack the mobile map package and load the .geodatabase(s) individually from file. Look for them in the p14 folder. <BR />4. Distribute .geodatabase files and other files separately. <BR />Since .geodatabase is not one of the file types allowed as a portal item in ArcGIS Online, I don't think that is intended. <BR /><BR /><BR />