-
- //传入经纬度,将baiduMapView 锁定到以当前经纬度为中心点的显示区域和合适的显示范围
- - (void)setMapRegionWithCoordinate:(CLLocationCoordinate2D)coordinate
- {
- BMKCoordinateRegion region;
- if (!_isSetMapSpan)//这里用一个变量判断一下,只在第一次锁定显示区域时 设置一下显示范围 Map Region
- {
- region = BMKCoordinateRegionMake(coordinate, BMKCoordinateSpanMake(0.05, 0.05));//越小地图显示越详细
- _isSetMapSpan = YES;
- [baiduMapView setRegion:region animated:YES];//执行设定显示范围
- }
- _currentSelectCoordinate = coordinate;
- [baiduMapView setCenterCoordinate:coordinate animated:YES];//根据提供的经纬度为中心原点 以动画的形式移动到该区域
- }