I am new to ArcGIS Android Runtime SDK.
I want to make use of .bundle and .bundlex (compact cache files) that are stored on SD card. I want to create map from them.
I was not able to find any sample for this so do anybody have any code snippet for it.
Thanks
Solved! Go to Solution.
Hi Abdul,
Please check out this sample:
Export Tile Cache | ArcGIS for Developers
The Sample uses ExportTileCacheParameters
class to which lets you specify if the downloaded tile cache will be a tile package(tpk) or a compact cache,and the default download location is<EXTERNAL-STORAGE-DIR>/ArcGIS/samples/tiledcache/
I'll bring the main Code Snippet:
// Create an instance of ExportTileCacheTask for the mapService that
// supports the exportTiles() operation
final ExportTileCacheTask exportTileCacheTask = new ExportTileCacheTask( tileURL, null);
// Set up GenerateTileCacheParameters
ExportTileCacheParameters params = new ExportTileCacheParameters( createAsTilePackage, levels, ExportBy.ID, extentForTPK, mMapView.getSpatialReference());
// create tile cache
createTileCache(params, exportTileCacheTask, tileCachePath);
private void createTileCache(ExportTileCacheParameters params, final ExportTileCacheTask exportTileCacheTask, final String tileCachePath) {
// Submit tile cache job and download
exportTileCacheTask.generateTileCache(params, statusListener, new CallbackListener<String>() {
@Override public void onCallback(String path)
{
Log.d("the Download Path = ", "" + path);
// switch to the successfully downloaded local layer
localTiledLayer = new ArcGISLocalTiledLayer(path);
mMapView.addLayer(localTiledLayer);
}
}
}
Hi Abdul,
Please check out this sample:
Export Tile Cache | ArcGIS for Developers
The Sample uses ExportTileCacheParameters
class to which lets you specify if the downloaded tile cache will be a tile package(tpk) or a compact cache,and the default download location is<EXTERNAL-STORAGE-DIR>/ArcGIS/samples/tiledcache/
I'll bring the main Code Snippet:
// Create an instance of ExportTileCacheTask for the mapService that
// supports the exportTiles() operation
final ExportTileCacheTask exportTileCacheTask = new ExportTileCacheTask( tileURL, null);
// Set up GenerateTileCacheParameters
ExportTileCacheParameters params = new ExportTileCacheParameters( createAsTilePackage, levels, ExportBy.ID, extentForTPK, mMapView.getSpatialReference());
// create tile cache
createTileCache(params, exportTileCacheTask, tileCachePath);
private void createTileCache(ExportTileCacheParameters params, final ExportTileCacheTask exportTileCacheTask, final String tileCachePath) {
// Submit tile cache job and download
exportTileCacheTask.generateTileCache(params, statusListener, new CallbackListener<String>() {
@Override public void onCallback(String path)
{
Log.d("the Download Path = ", "" + path);
// switch to the successfully downloaded local layer
localTiledLayer = new ArcGISLocalTiledLayer(path);
mMapView.addLayer(localTiledLayer);
}
}
}
Thanks for the reply.