且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在谷歌地图上移动地图,但保持标记为Android中的当前位置?

更新时间:2022-10-16 09:21:56

You can do it by different ways. Simplest - add marker image to ImageView over map fragment, something like that:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.MapFragment"
    />

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:src="@drawable/marker"
    />

</RelativeLayout>

Also take a look at this question.