Disable moving around in mapview

前端 未结 9 779
执念已碎
执念已碎 2020-12-16 11:06

Is it possible to disable moving inside the google map?

9条回答
  •  感情败类
    2020-12-16 11:36

    I created customMapView that extends MapView and override the onInterceptTouchEvent method.

    public class customMapView extends MapView {
        public customMapView(Context context) {
            super(context);
        }
    
        public customMapView(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
        }
    
        public customMapView(Context context, AttributeSet attributeSet, int i) {
            super(context, attributeSet, i);
        }
    
        public customMapView(Context context, GoogleMapOptions googleMapOptions) {
            super(context, googleMapOptions);
        }
    
        @Override
        public boolean onInterceptTouchEvent(MotionEvent ev) {
    
    //      return super.onInterceptTouchEvent(ev);
            return true;
        }
    
    }
    

提交回复
热议问题