android can't load local tile file

4436
2
07-17-2015 05:24 AM
jinkazf
New Contributor

Use the official sample ExportTileCacheTask download tile file;

1.jpg

2.png

code

public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        map = (MapView)findViewById(R.id.map);

        File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/mapsource/samples/World_Street_Map");

        String externalStorageState = Environment.getExternalStorageState();

    

        if (file.exists()) {

            ArcGISLocalTiledLayer arcGISLocalTiledLayer = new ArcGISLocalTiledLayer("file://"+file.getAbsolutePath());

            map.addLayer(arcGISLocalTiledLayer);

            map.enableWrapAround(true);

             map.setEsriLogoVisible(true);

        }

3.png

file exist

4.png

Q 1. can't show native map ?

Q 2. I have another tile layers file, but it not contain mapserver.json file. so I can't get InitExtent Value ,How get it and set to mapView?

        

0 Kudos
2 Replies
EricBader
Occasional Contributor III

Have you posted this question to the Android forum?

ArcGIS Runtime SDK for Android

0 Kudos
Shaulezrac
New Contributor

Remove "file://"+

0 Kudos