I want to add a button in map that center the map on user current position, but it should be activated only if the user navigate in map and his current position is no longer displayed on map.
to detect the navigation I used the onTouchEvent
method.
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
Log.e("Touch", Integer.toString(event.getAction()));
int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN) {
touchStarted = true;
} else if (action == MotionEvent.ACTION_MOVE) {
if (event.getPointerCount() > 3)
moveStarted = true;
return true;
}
return true;
}
but how I detect that my current position is no longer on screen?