سؤال

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.

هل كانت مفيدة؟

المحلول

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;
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top