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.

Was it helpful?

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
scroll top