2011-01-07 35 views

回答

8

我花了一點時間,但我有一個解決方案。我所做的是在多個手指觸摸屏幕時停止事件傳播。

mapView.setOnTouchListener(new OnTouchListener() { 
     public boolean onTouch(View v, MotionEvent event) { 
      if(event.getPointerCount() > 1) { 
       return true; 
      } 
      return false; 
     } 
    }); 
+0

我發現,當你使用'mapView.setBuiltInZoomControls(真);','onTouch()'只調用一次(第一次),所以這種方法是沒有用的。 ..你認爲這是一個MapView的錯誤? – Murphy

+0

我真的不知道。在我的應用程序中,我將setBuiltInZoomControls設置爲false,並實現了我自己的控件。 –

+1

我已經嘗試過,如果您使用的是內置的變焦控件,則不起作用 – user590849

8

禁用所有手勢:

mapView.getMap().getUiSettings().setAllGesturesEnabled(false); 

僅禁用變焦

mapView.getMap().getUiSettings().setZoomControlsEnabled(false); 
-2

這裏是一個小把戲來欺騙捏縮放:P(設置縮放級別,並設置相同的水平maxZoom

var myOptions1 = { 
      //Coordinates of the map's center 
      center: new google.maps.LatLng(152,125), 
      //Zoom level 
      zoom: 15, // or any level of zoom you want to preload your map 
      maxZoom:15 // same as the zoom value makes sure the map is not zoomed, 

//其他o ptions是按您的要求

0
final UiSettings uiSettings = map.getUiSettings(); 
uiSettings.setZoomControlsEnabled(true); 
uiSettings.setZoomGesturesEnabled(false);