Kamil Powałowski
Kamil Powałowski

Reputation: 267

Osmdroid disable double tap zoom

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.

Upvotes: 2

Views: 2617

Answers (1)

Ifor
Ifor

Reputation: 2835

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;
}

Upvotes: 3

Related Questions