GPS location on iOS and Android(iOS 和 Android 上的 GPS 定位)
问题描述
我对 Android 应用程序的编程经验有限,对 iOS 完全没有.我未来项目的一部分是让我的应用程序能够在 Android 和 iOS 上使用 GPS 记录当前位置.
I have limited experience programming Android apps and none at all for iOS. Part of a future project of mine is to make my app be able to record the current location using GPS possibly on both Android and iOS.
是否可以像在 Google 地球中一样为两个平台以通用横轴墨卡托"格式获取 GPS 坐标?如果没有,有没有办法将坐标计算为这种格式?
Can the GPS coordinates be taken in "Universal Transverse Mercator" format like in Google Earth for both platforms? If not, is there some way to calculate the coordinates to this format?
有没有人知道他们各自 API 中的函数返回什么格式?
Any chance anyone would know what format the functions in their respective APIs return?
推荐答案
API 将提供一个位置对象(Android 的 Location 类和 iOS 的 CLLocation 类).两个 API 都有纬度和经度的 getter,它们是 floats.纬度和经度是 WGS84 参考椭球的 GPS 坐标.
The API will provide a location object (class Location for Android and CLLocation for iOS). Both API have getters for latitude and longitude, which are floats. Latitude and longitude are the GPS coordinates wrt to the WGS84 reference elipsoid.
如果您需要将这些转换为其他坐标系,则网络中应该有很多参考.
If you need to transform these into some other coordinate system there should be lots of references in the web.
这篇关于iOS 和 Android 上的 GPS 定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS 和 Android 上的 GPS 定位
基础教程推荐
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
