AnsweredAssumed Answered

Why can't I load a vtpk in the runtime?

Question asked by Crittermap on May 29, 2018

There are ZERO examples for loading a ArcGISVectorTiledLayer from a local vtpk.

When do you plan to support that as mentioned in the documentation?

I assumed that's because it is so simple you can do it just by looking at the documentation.

However, I would like to ask for help because it isn't working.

I tried this:

mMap = new ArcGISMap();

File contourFile = new File(basedir + "wacountour.vtpk");

Log.i(TAG, "File " + contourFile.getAbsolutePath() + " exists? " + contourFile.exists());

String contourUri = Uri.fromFile(contourFile ).toString();

ArcGISVectorTiledLayer waContoursvtpk = new ArcGISVectorTiledLayer(contourFile.getAbsolutePath());
File mapFile = new File(basedir + "washingtonmap.vtpk");

Log.i(TAG, "File " + mapFile.getAbsolutePath() + " exists? " + mapFile.exists());

String mapUri = Uri.fromFile(mapFile).toString();

//ArcGISVectorTiledLayer usMap = new ArcGISVectorTiledLayer("https://www.arcgis.com/sharing/rest/content/items/91d7cbde681040449a01d853d5e30c84/resources/styles/root.json?f=pjson");
ArcGISVectorTiledLayer waMapvtpk = new ArcGISVectorTiledLayer(mapFile.getAbsolutePath());


mMap.getBasemap().getBaseLayers().add(waMapvtpk);
mMap.getBasemap().getBaseLayers().add(waContoursvtpk);

 

This fails without any helpful information whatsoever.

Failure is

7003 Invalid response

or

14 File not found.

Depending on the exact arguments to the constructor.

I have checked and made sure the files exist using File.exist().

 

I have checked the same vtpk files in ArcGIS Pro and they show as expected.

Outcomes