iOS中定位当前位置坐标及转换为火星坐标的方法

2020-01-14 20:05:30丽君

         {

             CLPlacemark * plmark = [placemarks objectAtIndex:0];

            

             NSString * country = plmark.country;

             NSString * city    = plmark.locality;

            

            

             NSLog(@"%@-%@-%@",country,city,plmark.name);

             self->m_locationName.text =plmark.name;

             NSLog(@"%@",self->m_locationName);

         }

        

         NSLog(@"%@",placemarks);

        

     }];

   

    //[geocoder release];

    */

}

// 定位失败时调用

- (void)locationManager:(CLLocationManager *)manager

       didFailWithError:(NSError *)error {

    NSLog(@"定位失败");

}

 

//把手机GPS坐标转换成火星坐标 (google坐标)

-(CLLocationCoordinate2D)zzTransGPS:(CLLocationCoordinate2D)yGps