Android百度地图常用方法汇总(AndroidSDK_v2.4.1)

1.地图初始化

private void initMapView() {
 mapView = (MapView) this.findViewById(R.id.bmapView);
 // 设置启用内置的缩放控件 
 mapView.setBuiltInZoomControls(true); 
 mapView.getController().setZoom(15);
 // 调整地图中心点   
    mapView.getController().setCenter(new GeoPoint((int) (39.915 * 1E6), (int) (116.404 * 1E6))); 
}

2.获取地图中心点坐标

GeoPoint pos = mapView.getMapCenter();

猜你喜欢

转载自chenzheng8975.iteye.com/blog/2083254
今日推荐