0

Android and GoogleMaps: Can I disable the mapView dragging without disable the pinch to zoom function? Thx for answer

Phobos
  • 3
  • 1

2 Answers2

0

Use GestureDetector and SimpleOnGestureListener, use onFling() to detect the distance between the path user did with his finger from the first touch till the release with .getX() and getY() from each MotionEvent and do nothing for x > SOMEMAXVALUE and y > SOMEMAXVALUE. I hope you'll find your way.

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
0

I suggest overridding dispatchDraw() in MapView class and check if the center is the one you want. Use getController().setCenter(...) to recenter the map. Just an alternative to what other people suggested.

Maurice Lam
  • 354
  • 2
  • 12