Android UI教程 - Android MapView
Android UI教程 - Android MapView
com.google.android.maps.MapView 控件可以显示地图。
您可以通过XML布局或代码实例化此控件,但使用它的活动必须延伸 MapActivity 。
MapActivity 负责处理多线程请求以加载地图,执行缓存,等等。
例子
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
// w ww.ja v a2 s . co m
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="myAPIKey"
/>
</LinearLayout>