Harita
Harita

Reputation: 21

How to do reverse geocoding using google maps on the iPhone

i am making an application in which i am showing current location on google map through web services. now i want to show the latitude, longitude, address , building & floor type when we click on current location on google. i don't know how to do it. if anybody has any solution so tell me.

Upvotes: 2

Views: 2600

Answers (2)

tony.tc.leung
tony.tc.leung

Reputation: 2990

here is a tutorial that does exactly what you need. Firstly, you need to use CLLocationManager to find your current location's coordinates. With the coordinates, use the MKReverseGeocoder to find the corresponding placemark. With the placemark you can place it on your map and also extract information such as latitude, longitude, address etc. however, you will not be able to get your building and floor type information.

Upvotes: 1

Nathan de Vries
Nathan de Vries

Reputation: 15511

The MapKit framework does exactly what you describe, including both the display of a map, overlaying the users' current position on the map, and allowing you to reverse-geocode the users' current position into information about that coordinate (country, suburb, postcode etc.).

You should take a look at the documentation for the MapKit framework and the MKReverseGeocoder class. MKReverseGeocoder will give you an instance of MKPlacemark so you'll probably also want to check out the documentation for that too.

Upvotes: 3

Related Questions