Android and GoogleMaps: disable mapView drag and drop

Android and GoogleMaps: can I turn off dragging and dropping mapView without disabling the zoom feature to zoom in? thanks for the answer

0
source share
2 answers

Use the GestureDetector and SimpleOnGestureListener , use onFling() to determine the distance between the user the finger path from the first touch to release using .getX() and getY() from each MotionEvent and do nothing for x > SOMEMAXVALUE and y > SOMEMAXVALUE . Hope you find your way.

0
source

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

0
source

Source: https://habr.com/ru/post/920753/


All Articles