Google Map API V2 - How do I keep a marker in the center of the screen while user is scrolling the map ?
My purpose is to let user choose a location. I use the follo
This is the solution
private GoogleMap mMap;
private Marker markerCenter;
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(mMap.getCameraPosition().target);
markerCenter = mMap.addMarker(markerOptions);
mMap.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() {
public void onCameraMove() {
markerCenter.setPosition(mMap.getCameraPosition().target);
}
});
}