本文使用的是arcgis-android:10.2.6-2,使用前请先配置好环境,ancgis for android环境配置请参考点击打开链接。
activity_main.xml:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
< RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools" android:layout_width = "match_parent"
android:layout_height = "match_parent" android:paddingLeft = "@dimen/activity_horizontal_margin"
android:paddingRight = "@dimen/activity_horizontal_margin"
android:paddingTop = "@dimen/activity_vertical_margin"
android:paddingBottom = "@dimen/activity_vertical_margin" tools:context = ".MainActivity" >
< com.esri.android.map.MapView
android:id = "@+id/map"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent" >
</ com.esri.android.map.MapView >
< Button
android:id = "@+id/dw"
android:layout_width = "200dp"
android:layout_height = "50dp"
android:text = "定位" />
</ RelativeLayout >
|
MainActivity.java
1
2
3
4
5
6
|