次のマップと、OnCameraIdleListenerを使用してカメラをセンタリングするときのアドレスを取得しますが、イメージでわかるように、マーカーの中心のアドレスを取得しています、あなたが望むものではありません。 私は何か提案を感謝します。そして、画像で私の英語オーバーレイマーカーの正確な位置を取得する方法
を気の毒アドレスは
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
tools:context="com.mobifire.edwin.mobifire.UserMaps" />
<ImageView
android:id="@+id/imvCurrentMarker"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_a_marker" />
</RelativeLayout>
@Override
public void onCameraIdle() {
Log.i(TAG, "onCameraIdle");
LatLng position = mMap.getCameraPosition().target;
if (position != null) {
mCurrentLocation.setLatitude(position.latitude);
mCurrentLocation.setLongitude(position.longitude);
retrieveAddress(position);
}
}
マイマップフラグメントでなければなりません