ArcGIS for Android 禁止地图旋转
话不多说,直接上代码!!!
public class LoadMap extends AppCompatActivity {// 地图private MapView mapView;private ArcGISMap map;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// 设置地图显示mapView = new MapView(this);mapView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT));//去logomapView.setAttributionTextVisible(false);ArcGISRuntimeEnvironment.setLicense("runtimelite,1000,rud4449636536,none,NKMFA0PL4S0DRJE15166");// 添加天地图底图WebTiledLayer webTiledLayer2 = TianDiTuMethodsClass.CreateTianDiTuTiledLayer(TianDiTuMethodsClass.LayerType.TIANDITU_IMAGE_MERCATOR);Basemap tdtBasemap2 = new Basemap(webTiledLayer2);WebTiledLayer webTiledLayer22 = TianDiTuMethodsClass.CreateTianDiTuTiledLayer(TianDiTuMethodsClass.LayerType.TIANDITU_IMAGE_ANNOTATION_CHINESE_MERCATOR);tdtBasemap2.getBaseLayers().add(webTiledLayer22);// 创建地图map = new ArcGISMap(tdtBasemap2);mapView.setMap(map);mapView.setViewpoint(new Viewpoint(26.356295, 106.42, 1000000));// 将地图视图添加到布局中FrameLayout mapViewContainer = findViewById(R.id.mapViewContainer);mapViewContainer.addView(mapView);// 禁止地图旋转mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mapView) {@Override public boolean onRotate(MotionEvent event, double rotationAngle) {return false;}});}
}
然后就不能旋转了哦!!!