Get Place Location

家住魔仙堡 提交于 2019-12-12 03:48:34

问题


I need put information about place, where is iPhone now, to UILable in my screen. [Country][City][Street] and maybe coordinates [lat][lng]. For example in my UILable should be:

Your location is German, Berlin, Tiergarten

Can someone show me really simple code how can i get such information that put in my UILable?


回答1:


The MapKit framework (part of iPhone OS 3.0) provides this for you. Specifically the MKPlacemark object, which you can obtain for a set of co-ordinates using an MKReverseGeocoder.




回答2:


You need access to a reverse geocoding service, which will take your lat/lon coordinates as input and return some kind of structured address of that location.

Google's is available here: http://code.google.com/apis/maps/documentation/geocoding/index.html#ReverseGeocoding



来源:https://stackoverflow.com/questions/1551475/get-place-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!