新人求助,Android百度地图开发,怎么设置新的中心点

2025-05-15 08:49:53
推荐回答(2个)
回答1:

//初始化地图
//定义中心点
GeoPoint point = new GeoPoint((int) (4.818* 1E6),(int) (1.697 * 1E6));
mMapView = (MapView)findViewById(R.id.bmapView);
mMapView.getController().enableClick(true);
//缩放级别
mMapView.getController().setZoom(8);
//设置中心点
mMapView.getController().setCenter(point);

回答2:

最新版本设置方法:
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(point);
mBaiduMap.animateMapStatus(u);
point为LatLng类型