Saving a mobile map package from a vtpk file

150
5
Jump to solution
2 weeks ago
padmalcom
Occasional Contributor

Hi, we want to load a vtpk file and create a mobile map package from an smaller envelope of that vector tile package. My approach is:

File tpkFile = new File("C:\\Users\\admin\\Downloads\\map.vtpk");
TileCache cache = new TileCache(tpkFile.getAbsolutePath());
ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer(cache);
ArcGISMap map = new ArcGISMap(new Basemap(tiledLayer));
OfflineMapTask offlineMapTask = new OfflineMapTask(map);

But the last line throws an IllegalArgumentException with the error message "onlineMap must be a web map". Can you provide help how to create a mobile map package from a vtpk file?

0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor

@padmalcom 

What you are trying to do here isn't possible I'm afraid; not in the Maps SDK alone.

The offline map tasks which generates a mobile map package is for use with a web map which is published in ArcGIS Online or your own Enterprise environment.  The creation of the mobile map package is a server side operation and there is no logic in the Maps SDK to perform this operation.

The solution here might be to publish your vector tile data into a webmap and you can use that to request a smaller area using the offline workflows.  

I should also make you aware that the Maps SDK for Java is being deprecated this year so you may want to consider using one of the other Native Maps SDKs for a new project.

Does that help?

View solution in original post

0 Kudos
5 Replies
MarkBaird
Esri Regular Contributor

@padmalcom 

What you are trying to do here isn't possible I'm afraid; not in the Maps SDK alone.

The offline map tasks which generates a mobile map package is for use with a web map which is published in ArcGIS Online or your own Enterprise environment.  The creation of the mobile map package is a server side operation and there is no logic in the Maps SDK to perform this operation.

The solution here might be to publish your vector tile data into a webmap and you can use that to request a smaller area using the offline workflows.  

I should also make you aware that the Maps SDK for Java is being deprecated this year so you may want to consider using one of the other Native Maps SDKs for a new project.

Does that help?

0 Kudos
padmalcom
Occasional Contributor

Hi @MarkBaird, thanks for your fast reply. Unfortunately, we can not follow the offline map workflow since ArcGIS Enterprise on Kubernetes does not support downloading maps to a mobile map packages. That is why we are desperately looking for a workaround to create mobile map packages on server side.

Thank you furthermore for the deprecation hint.

0 Kudos
MarkBaird
Esri Regular Contributor

@padmalcom I've reached out to someone on the Enterprise Kubernetes team to find out more about this limitation you've found. 

MarkBaird
Esri Regular Contributor

I have raised this with the ArcGIS Enterprise Kubernetes team to explain the project difficulties you are experiencing with the offline workflows.  They acknowledge this is a gap in functionality which they are considering for a future release.  I would also suggest you reach out to customer services or your local distributor to report the issue.

There is also the ArcGIS Enterprise Ideas board: https://community.esri.com/t5/arcgis-enterprise-ideas/idb-p/arcgis-enterprise-ideas

padmalcom
Occasional Contributor

Thanks @MarkBaird, we reported the missing feature to our ESRI contact.

0 Kudos