AnsweredAssumed Answered

Android local tiled layer (ArcGISLocalTiledLayer) not rendering

Question asked by kunal.mehta@sap.com on Sep 16, 2014

I am implementing offline functionality in my application, and following the samples to download tiled cache as a .TPK file. When adding the layer the layer does not get displayed. Here is the relevant code snippet:

 

 

// Set up GenerateTileCacheParameters

  ExportTileCacheParameters params = new ExportTileCacheParameters(true, desiredLevels, ExportBy.ID, extentForTPK, _map.getSpatialReference());

....

....

 

 

// Submit tile cache job and download

  exportTileCacheTask.generateTileCache(params, statusListener,

  new CallbackListener<String>() {

       private boolean errored = false;

 

       @Override

       public void onError(Throwable e) {

 

       }

 

       @Override

       public void onCallback(String path) {

            if (!errored) {

                 Log.d(TAG, "Tiled cache successfully download to path: "+ path);

            }

 

            _localTiledLayer = new ArcGISLocalTiledLayer(path);    

            _map.removeAll();

            _map.addLayer(_localTiledLayer);

 

       }

  }, tileCachePath);

 

 

If I follow the sample and download the compact cache by setting the first parameter in ExportTileCacheParameters() to false, _localTiledLayer loads and renders just fine.

 

Note: I verified that the .tpk file gets saved successfully on the filesystem.

 

Can someone point me our what am I missing?

Outcomes