存储用户当前的地理坐标,不要用string ,直接用float即可。string无法保持数据,原因暂不明

/**
 用户位置更新后,会调用此函数
 @param mapView 地图View
 @param userLocation 新的用户位置
 在实际使用中,只需要    [mapView setShowsUserLocation:YES];    mapView.delegate = self;   两句代码就可以启动下面的方法。疑问,为什么我的位置没有移动的情况下,这个方法循环被调用呢?
 */
- (void)mapView:(BMKMapView *)mapView didUpdateUserLocation:(BMKUserLocation *)userLocation
{
    
    if (userLocation != nil) {
        NSLog(@"%f %f", userLocation.location.coordinate.latitude, userLocation.location.coordinate.longitude);
//存储用户当前的地理坐标,不要用string ,直接用float即可。string无法保持数据,原因暂不明。 f_strUserLocationLat
= userLocation.location.coordinate.latitude]; f_strUserLocationLng = userLocation.location.coordinate.longitude]; } }
原文地址:https://www.cnblogs.com/ygm900/p/3092633.html