不需要显示地图 就获得用户当前经纬度 超简单的方法
来源:互联网 发布:java 书籍推荐 编辑:程序博客网 时间:2024/06/05 11:48
1.遵循协议
CLLocationManagerDelegate,AMapSearchDelegate,AMapLocationManagerDelegate
2. API
MAMapServices.sharedServices().apiKey =APIKey
AMapLocationServices.sharedServices().apiKey = APIKey
AMapSearchServices.sharedServices().apiKey = APIKey
AMapNaviServices.sharedServices().apiKey = APIKey
search =AMapSearchAPI()
search?.delegate =self
mapLacationManager.delegate =self
3.方法
//MARK:_调用获取用户地理位置信息
func getMapData() {
mapLacationManager =AMapLocationManager()
mapLacationManager.allowsBackgroundLocationUpdates =true
mapLacationManager.requestLocationWithReGeocode(true) { (location, regecode, error) in
print(location)
if (location !=nil) {
self.LONGITUDES = location.coordinate.longitude
self.LATITUDES = location.coordinate.latitude
print("self.LONGITUDES:\(self.LONGITUDES)")
print("self.LATITUDES:\(self.LATITUDES)")
} else {
print(error)
}
}
}
4。最后切记 调用哦
- 不需要显示地图 就获得用户当前经纬度 超简单的方法
- google显示当前地图的经纬度
- 经纬度的最简单获得方法
- 百度地图显示历史轨迹时经纬度的处理方法
- C#获得当前经纬度
- 百度地图---获取当前的位置返回的是汉字显示而不是经纬度
- android获取当前经纬度,并用地图显示跟踪
- 高德地图设置当前地图的经纬度范围
- 获得当前用户的密码
- 根据指定的经纬度显示地图位置
- 获得当前IP的位置及经纬度的web服务
- 用手机gps定位获得准确的百度地图经纬度
- MapKit点击地图获得改点的经纬度,并标大头针!
- 02 使用百度地图获得当前位置的经纬度
- 百度地图定位无法获得经纬度的解决方案
- 一个借用地点获得经纬度的百度地图程序
- Unity 获得当前经纬度 用于求 设备间的距离
- 不同地图坐标系的经纬度转换方法
- CALayer分类
- 实现AIDL接口的Binder连接池
- 数据库大小,表大小及行数统计
- struts2的s:iterator 标签 详解
- 【分享】兼容ie6-9和现代浏览器以及ios,android,pad等触屏设备的异步文件上传插件
- 不需要显示地图 就获得用户当前经纬度 超简单的方法
- 时间复杂度
- 项目报_SecPolicyCreateSSL错误
- zookeeper之watcher机制
- 关于Android Studio项目的Gradle构建
- springmvc4 spring4 swagger配置问题
- hive-sqoop案例
- NSArray分类
- 使用DialogFragment实现底部弹窗布局