-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
CLLocation *cation =[locations objectAtIndex:0];
NSLog(@"纬度--%f",cation.coordinate.latitude);
NSLog(@"经度--%f",cation.coordinate.longitude);
[self.locationManager stopUpdatingLocation];//停止更新位置
}
大家讲道理2017-04-17 14:21:15
這不是百度的,百度的是- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
百度底層會呼叫那些CL開頭的方法,所有是有值的,建議刪除交給百度SDK處理
你只用調取- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
ringa_lee2017-04-17 14:21:15
樓主,此didUpdateLocations代理方法,是會調用多次的,因為定位的時候,如果手機移動的話,經緯度也會跟著變化,此方法就是隨之改變的經緯度
我做百度地圖的時候定位需求沒用到-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
以下幾種
- (void)mapViewWillStartLocatingUser:(BMKMapView *)mapView
- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
- (void)mapViewDidStopLocatingUser:(BMKMapView *)mapView