androidarcgisarcgis-runtimearcgis-android-api

How can I use Base map from GIBS in Arcgis android Sdk


I want to use latest imagery from NSA GIBS in arcgis android sdk is it Possible? Also can I download tiles from above service to cache/offline map?

I have tried: WMSLayer class from arcgis android and WebTiledLayer
Following code I used For WebTiledLayer

    mMapView = (MapView) findViewById(R.id.mapView);


    String templateUri = "https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Terra_Aerosol/default/2014-04-09/GoogleMapsCompatible_Level6/{level}/{row}/{col}.png";

    // webtile layer
    final WebTiledLayer webTiledLayer = new WebTiledLayer(templateUri);
    webTiledLayer.loadAsync();
    webTiledLayer.addDoneLoadingListener(new Runnable() {
        @Override
        public void run() {
            if (webTiledLayer.getLoadStatus() == LoadStatus.LOADED) {
                // use webtile layer as Basemap

                final ArcGISMap map = new ArcGISMap(new Basemap(webTiledLayer));

                mMapView.setMap(map);

                // custom attributes
            }else {
                webTiledLayer.getLoadError().printStackTrace();
            }
        }
    });

And result was an empty map


Solution

  • I've just tested your code and it seems to work just fine. Have you requested internet permissions in your manifest?

    <uses-permission android:name="android.permission.INTERNET" />
    

    Try dropping your code in the onCreate of this sample--it'll work.