ArcGIS Api For Android学习之(二)加载地图续-加载sd卡中的切片数据

来源:互联网 发布:javaweb数据库 编辑:程序博客网 时间:2024/05/22 12:13

1.     ArcGIS Server的服务切片文件拷贝到AndRoid设备SD卡的根目录下.

 

 

 

2.     在在eclipse中新建项目,核心代码如下:

 

 publicclass LocalTiledLayerextends Activity{

 

 

 

    MapViewmap =null;

 

    ArcGISLocalTiledLayerlocal;

 

 

 

    /** Called when the activity is firstcreated. */

 

    publicvoid onCreate(Bundle savedInstanceState) {

 

        super.onCreate(savedInstanceState);

 

        setContentView(R.layout.main);

 

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

 

       

 

        //the data is stored on the SDCARD

 

        //the data is created as a tiled cache

 

        local = new ArcGISLocalTiledLayer(“file:///mnt/sdcard/idw/图层);

 

        map.addLayer(local);

 

       

 

       

 

    }

 

}

原创粉丝点击