简体   繁体   English

iOS和Android上的GPS位置

[英]GPS location on iOS and Android

I have limited experience programming Android apps and none at all for iOS. 我对Android应用程序进行编程的经验有限,而对于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. 我未来的项目的一部分是使我的应用程序能够在Android和iOS上使用GPS记录当前位置。

Can the GPS coordinates be taken in "Universal Transverse Mercator" format like in Google Earth for both platforms? 是否可以在两个平台上都像Google Earth一样以“通用横轴墨卡托”格式获取GPS坐标? If not, is there some way to calculate the coordinates to this format? 如果没有,是否有某种方法可以计算此格式的坐标?

EDIT: Any chance anyone would know what format the functions in their respective APIs return? 编辑:任何人都有可能知道各自API中的函数返回的格式是什么?

The API will provide a location object (class Location for Android and CLLocation for iOS). 该API将提供一个位置对象(适用于Android的Location类和适用于iOS的CLLocation类)。 Both API have getters for latitude and longitude, which are floats . 两种API都有用于纬度和经度的getter,即floats Latitude and longitude are the GPS coordinates wrt to the WGS84 reference elipsoid. 纬度和经度是WGS84参考椭球的GPS坐标。

If you need to transform these into some other coordinate system there should be lots of references in the web. 如果需要将它们转换为其他坐标系,则网络中应该有很多参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM