错误信息:
invalid address or address of corrupt block 0x78db1e38 passed to dlfree
原因分析:使用一个循环去访问一个方法时候产生该错误,推测可能因为访问的方法中需要去调用
百度地图API。所以添加线程,并且做了延时,加上方法同步后,没有再报出该错。
//设置缩放级别,默认级别为12
MapStatusUpdate mapstatusUpdate = MapStatusUpdateFactory.zoomTo(19);;
baiduMap.setMapStatus(mapstatusUpdate);
//设置地图中心点
MapStatusUpdate mapstatusUpdatePoint = MapStatusUpdateFactory.newLatLng(hmPos);
baiduMap.setMapStatus(mapstatusUpdatePoint );
//mapView.showScaleControl(false);//默认是true,显示缩放按钮
//mapView.showZoomControls(false);//默认是true,显示比例尺
缩放尝试:
/*LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Object stepBikeLine : bikingRouteResult.getRouteLines().get(0).getAllStep()){
LatLng latLng = ((BikingRouteLine.BikingStep) stepBikeLine).getEntrance().getLocation();
builder.include(latLng);
}
mBaidumap.setMapStatus(MapStatusUpdateFactory
.newLatLngBounds(builder.build()));*/
/* if (isFirstLoc) {// 定位完成将地图中心移至位置处
isFirstLoc = false;
LatLng ll = new LatLng(mLocationResult.latitude,
mLocationResult.longitude);
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(ll).zoom(18.0f);
mBaidumap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}*/
/*
if (mMapList == null || mMapList.isEmpty()) {
mRoutePlanBikePresenter.setSearchPOIProcess(flag);
} else {
int countDoThing = -1;
for (final BikeLineStepBean bean : mMapList){
countDoThing++;
if (countDoThing == (mMapList.size() - 1)) {
new Thread(new Runnable() {
@Override
public void run() {
mRoutePlanBikePresenter.setSearchNearbyProcess(flag, bean.getNodeLatlng(),
RoutePlanBikePresenter.ENUM_NEAR_SEARCH.YES_NEAR_SEARCH);
}
}).start();
} else if(countDoThing == 0){
mRoutePlanBikePresenter.setSearchNearbyProcess(flag, bean.getNodeLatlng(),
RoutePlanBikePresenter.ENUM_NEAR_SEARCH.YES_NEAR_FIRST);
} else {
new Thread(new Runnable() {
@Override
public void run() {
mRoutePlanBikePresenter.setSearchNearbyProcess(flag, bean.getNodeLatlng(),
RoutePlanBikePresenter.ENUM_NEAR_SEARCH.YES_NEAR_CONTINU);
}
}).start();
}
}
}*/