问题描述
首先,我在班级中实现了位置管理器功能,并且whict工作正常,并为我提供了当前位置。从那个位置我得到了如何从也是如此。我希望我的位置以度数格式显示,如。即位置经理给我+ 37.33019332,-122.02298792,我想要像37°19'49 N ,-122°1'23 E 。我得到的所有东西只是不知道如何得到最后的N和E。
如果我使用 CLLocation.course
,我将获得我的指导课程。
任何帮助都将不胜感激。
First I've implemented location manager functions in my class and whict are working fine, and gives me the current location. From that location I got how to get location degrees from here. but I'm not able to get the direction (i.e. North, South, East, West) I've referred this too. I want the location that I'm getting to be displayed in degrees with direction format like this. i.e. location manager gives me +37.33019332,-122.02298792 and i want something like 37° 19' 49"N, -122° 1' 23"E. I'm getting all things just don't know how to get the last "N" and "E".If i use CLLocation.course
for this I'm getting my direction course.Any help would be appreciated.
推荐答案
这实际上非常简单。纬度从赤道0°开始,北极为90.0,南极为-90.0。基本上,如果纬度在0到90之间,那么你在北半球和南半球的纬度在0到-90之间。
This is actually very simple. Latitudes begin at 0° at the equator with the north pole being 90.0 and the south pole being -90.0. Basically, if the latitude is between 0 and 90, you're in the northern hemisphere and the southern hemisphere for latitude between 0 and -90.
经度基本上是一样的办法。 0°指的是本初子午线,它是贯穿格林威治,英格兰和非洲一部分的虚线。正经度高达180°指的是本初子午线以东的位置,负经度指的是本初子午线以西的地区,最高可达180°。
Longitude basically works the same way. 0° refers to the prime meridian which is the imaginary line that runs through Greenwich, England and a part of Africa. A positive longitude up to 180° refers to locations east of the prime meridian, while negative longitudes refer to areas west of the prime meridian up to 180°.
这篇关于iPhone - 我如何获得基于学位的定位方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!