AnsweredAssumed Answered

How to add mxd as layer to a MapView

Question asked by john.daues on Oct 6, 2015
Latest reply on Oct 8, 2015 by rastrauch

I have Android/Java code that adds layer to a MapView, calling a RESTful service, like so:

 

    mDynamicServiceLayer = new ArcGISDynamicMapServiceLayer(getResources().getString(R.string.some_url));

    mMapView.addLayer(mDynamicServiceLayer);

 

This works fine. I want to also add a layer that is an mxd file on the device

 

    <string name="mxd_file">file://storage/emulated/0/Download/mymap.mxd</string>

    mDynamicServiceLayer = new ArcGISDynamicMapServiceLayer(getResources().getString(R.string.mxd_file));

    mMapView.addLayer(mDynamicServiceLayer);

 

This throws the exception:

 

    java.lang.IllegalStateException: Scheme 'file' not registered.

 

I also tried:

 

    ArcGISLocalTiledLayer layer = new ArcGISLocalTiledLayer(getResources().getString(R.string.mxd_file));

    mMapView.addLayer(layer);

 

which gives this error:

    Failed to ensure directory: /storage/extSdCard/Android/data/arcgis_mmd_maplegends/cache

 

How do I do this?

Outcomes