Osmdroid disable double tap zoom
-
11-12-2019 - |
Question
Is there a way to disable zoom on double tap in MapView from Osmdroid? I disable pitch-zooming by calling
mapView.setMultiTouchControls(false);
But I don't know what to call for double tap.
Solution
I set my own onTouchListener with my own gestureDetector to intercept the onDoubleTap. This effectivly stops the mapview doing it's standard doubletap.
some code snippets.
mGestureDetector = new GestureDetector(this, this);
mMapView.setOnTouchListener(mOnTouchListener);
public OnTouchListener mOnTouchListener = new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (mGestureDetector.onTouchEvent(event))
return true;
else
return false;
}
};
@Override
public boolean onDoubleTap(MotionEvent arg0) {
Log.v(TAG, "onDoubleTap");
return true;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow