Android Google Maps: disable dragging in MapFragment

前端 未结 6 870
死守一世寂寞
死守一世寂寞 2020-12-29 17:52

Can I disable drag functionality when the user tries to drag the map with his fingers without disturbing the Zoom in and Zoom out?

Any one please suggest an idea

6条回答
  •  佛祖请我去吃肉
    2020-12-29 18:25

    you can use isScrollGesturesEnabled for map

    java:

    googleMap.getUiSettings().setZoomGesturesEnabled(false);

    kotlin

    googleMap?.uiSettings?.isScrollGesturesEnabled = false
    

提交回复
热议问题