I guess this should work:
mMap.getCameraPosition().target
Question
I need to get the location of the center of my map-fragment. Of course it is not the center of the screen. I want to do something every time this location changes.
Every time the user moves/scrolls the map, I need the location of the center of my fragment and do something with them.
So, any Idea of how can I do that?
Thank you in advance for your help.
EDIT:
So I implemented OnCameraChangeListener and added onCameraChange but it never executes:
@Override
public void onCameraChange(CameraPosition arg0) {
Log.v("tag", "onCameraChange");
mLatitude = arg0.target.latitude;
mLongitude = arg0.target.longitude;
Log.v("tag", "onCameraChange "+mLatitude+" "+mLongitude);
}
Solution
I guess this should work:
mMap.getCameraPosition().target