-(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
This is not from Baidu, it is from Baidu- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
The bottom layer of Baidu will call those methods starting with CL. All of them are valuable. It is recommended to delete them and leave them to Baidu SDK for processing
You just need to call - (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
ringa_lee2017-04-17 14:21:15
Original, this didUpdateLocations proxy method will be called multiple times, because when positioning, if the phone moves, the longitude and latitude will also change accordingly. This method is the corresponding changed longitude and latitude
When I made Baidu Maps, the positioning requirements were not used -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
The following
- (void)mapViewWillStartLocatingUser:(BMKMapView *)mapView
- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
- (void)mapViewDidStopLocatingUser:(BMKMapView *)mapView