Hello Esri Community,
I know how to load a .TPK File instead of an online base map. I have used the sample esri application map maker in the past to make a small tpk map which puts it in a zip folder and I can just call that.
I have started to learn to use ArcGIS Pro and have began trying to make bigger maps. Do I just need to take the tpk files and put them in a folder and zip or can you just call the files?
This is where I am confused because the maps I've generated before came ready to go. The Maps I created on ArcGIS pro go inside my ArcGIS pro program so I am looking for guidance.
Can you help?
Cheers!
Solved! Go to Solution.
Armando:
If you are creating maps in ArcGIS Pro, the best way to open those in Runtime is to export the data to a Mobile Map Package - https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/mobile-map-package.htm
Once you have a Mobile Map Package (.mmpk file) you can open in Runtime with the following code - https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Maps/Ope...
If you are wanting to only share a basemap, you can also create a TPK file directly in Pro with this tool - https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-map-tile-package.htm
However, the Mobile Map Package has some advantages in that it retains the structure of your map, with operational layers and basemap layers, and it can be queried and interacted with like your map in Pro. A TPK is more static and loses individual attributes on features and such.
Long story short, if you just want a basemap, a TPK or VTPK will work great. If you want to bring your Pro Maps to Runtime, MMPK is the way to go.
Armando:
If you are creating maps in ArcGIS Pro, the best way to open those in Runtime is to export the data to a Mobile Map Package - https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/mobile-map-package.htm
Once you have a Mobile Map Package (.mmpk file) you can open in Runtime with the following code - https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Maps/Ope...
If you are wanting to only share a basemap, you can also create a TPK file directly in Pro with this tool - https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-map-tile-package.htm
However, the Mobile Map Package has some advantages in that it retains the structure of your map, with operational layers and basemap layers, and it can be queried and interacted with like your map in Pro. A TPK is more static and loses individual attributes on features and such.
Long story short, if you just want a basemap, a TPK or VTPK will work great. If you want to bring your Pro Maps to Runtime, MMPK is the way to go.
Lucas,
Thank you very much for that information.
Hello All,
Can you please provide suggestions for code below:
I have implemented below code snippet of Android ArcGIS for displaying the Basemap from cache(downloaded and saved in SD card) without having internet connection, but it is not working and displays the white map blank screen.
val tileCache1 =TileCache(externalCacheDir.toString() + folderpath")
val newTiledLayer1 = ArcGISTiledLayer(tileCache1)
map!!.basemap = Basemap(newTiledLayer1)
//mapView.setViewpoint(mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE))
mapView.map = map
Any Suggestions how to display Basemap offline from downlaeded .tpk file?
@Amitkhillan This is probably worth posting in the Android space as they may have a better idea what is going on
@LucasDanzinger Thanks for the suggestion. Finally, I achieved the output which was required.
Hello,
I am in the same situation. I try to display in an Android application a .tpk file.
Can you, please, help me with some advice. How did you succeeded to display the .tpk file? How did you said above, right now I have only a blank white screen with Esri logo in bottom-right corner and nothing else.
The code is below:
String base = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+
"/myTPKFile.tpk";
TileCache tileCache = new TileCache(base);
ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer(base);
Basemap basemap = new Basemap(tiledLayer);
ArcGISMap map = new ArcGISMap(basemap);
mmapView.setMap(map);
Thank you,