您的位置:首页 > 移动开发 > IOS开发

IOS开发实例-获取用户当前地理坐标

2014-10-15 14:59 295 查看
法一:在使用高德地图时,有个代理方法:
-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation在这方法内写
double gps_lat = userLocation.coordinate.latitude;double gps_lng = userLocation.coordinate.longitude;

法二:转自http://www.2cto.com/kf/201402/279078.html1.导入CoreLocation.frameWork2.通过CLLocationManager类获取位置信息 }
// 地理位置发生改变时触发代理方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息