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:
<SPAN class="com" style="color: #808080;">// Settings.LocalDataPath = "C:\\Data\\Users\\Public\\Pictures\\Camera Roll\\ArcGIS\\MS_PM_BaseMap.tpk"; - when loading from Pictures Library</SPAN><SPAN class="pln" style="color: #000000;">
</SPAN><SPAN class="com" style="color: #808080;">// Settings.LocalDataPath = "ms-appdata:///local/MS_PM_BaseMap.tpk"; - when file is in Local Storage</SPAN><SPAN class="pln" style="color: #000000;">
</SPAN><SPAN class="com" style="color: #808080;">// Settings.LocalDataPath = "isostore:/MS_PM_BaseMap.tpk"; - another try...</SPAN><SPAN class="pln" style="color: #000000;">
</SPAN><SPAN class="kwd" style="color: #00008b;">
var</SPAN><SPAN class="pln" style="color: #000000;"> tpk </SPAN><SPAN class="pun" style="color: #000000;">=</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="kwd" style="color: #00008b;">new</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="typ" style="color: #2b91af;">ArcGISLocalTiledLayer</SPAN><SPAN class="pun" style="color: #000000;">(</SPAN><SPAN class="typ" style="color: #2b91af;">Settings</SPAN><SPAN class="pun" style="color: #000000;">.</SPAN><SPAN class="typ" style="color: #2b91af;">LocalDataPath</SPAN><SPAN class="pun" style="color: #000000;">);</SPAN><SPAN class="pln" style="color: #000000;">
tpk</SPAN><SPAN class="pun" style="color: #000000;">.</SPAN><SPAN class="pln" style="color: #000000;">ID </SPAN><SPAN class="pun" style="color: #000000;">=</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="str" style="color: #800000;">"tpk"</SPAN><SPAN class="pun" style="color: #000000;">;</SPAN><SPAN class="pln" style="color: #000000;">
await tpk</SPAN><SPAN class="pun" style="color: #000000;">.</SPAN><SPAN class="typ" style="color: #2b91af;">InitializeAsync</SPAN><SPAN class="pun" style="color: #000000;">();</SPAN>
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?