1

I'm developing Windows Phone 8.1 client for our company ArcGIS maps. Online layers works fine, but I need to deliver offline maps (Map Tile Package - .tpk file) to users with bad connectivity. My problem is that not every user has device with Storage Card, and I try to save .tpk file to Internal Storage of Phone, i.e. Pictures Library folder.

I can succesfully read .tpk file from there to StorageFile, so the app has the permission to read, but I cannot initialize ArcGISLocalTiledLayer from this file. Even when I copy file to App Local Store, still cannot initialize ArcGISLocalTiledLayer from this file. I tried different path formats:

// Settings.LocalDataPath = "C:\\Data\\Users\\Public\\Pictures\\Camera Roll\\ArcGIS\\MS_PM_BaseMap.tpk"; - when loading from Pictures Library
// Settings.LocalDataPath = "ms-appdata:///local/MS_PM_BaseMap.tpk"; - when file is in Local Storage
// Settings.LocalDataPath = "isostore:/MS_PM_BaseMap.tpk"; - another try...

var tpk = new ArcGISLocalTiledLayer(Settings.LocalDataPath);
tpk.ID = "tpk";
await tpk.InitializeAsync();

on InitializeAsync() I get exception "Failed to open file. May not be a valid tile package.". When file is saved on StorageCard, initialization works fine. Is it possible to use .tpk file from any location in phone's internal storage?

1

FYI (for others with the same issue), you'll find additional discussion here: https://geonet.esri.com/thread/162953

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.