Ich habe die folgende Karte, und die Adresse, die ich bekomme, wenn Sie die Kamera mit OnCameraIdleListener zentrieren, aber wie Sie im Bild sehen können, erhalten Sie die Adresse der Mitte des Markers nicht das untere, was du willst. Ich freue mich über Vorschläge. Und sorry für mein EnglischWie bekomme ich die genaue Position eines Overlay-Markers
im Bild sollte die Adresse sein "sucre ..." keine L.Jaimes ......
@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);
}
}
My Map Fragment
<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>