0

I want to place a Geolocation button near my UISearchBar, which on clicking, it should return the zip (eg. 20043). I will be using the value from the ZIP to get the list of buildings near me.

I would appreciate it if someone could help me with the location Button, and what are the methods to implement to return just the ZIP (integer) ? And would a custom UIButton work for the location button ?

Thank you!

Legolas
  • 12,145
  • 12
  • 79
  • 132
  • possible duplicate of [Getting zip-code + 4 from latitude/longitude](http://stackoverflow.com/questions/1343683/getting-zip-code-4-from-latitude-longitude) or [Get ZIP code from latitude longitude](http://stackoverflow.com/questions/3564852/get-zip-code-from-latitude-longitude) or [Get the ZIP code of the current location](http://stackoverflow.com/questions/3596549/) or [Get street address](http://stackoverflow.com/questions/158557/) – jscs Jun 27 '11 at 19:05
  • or [Find city and ZIP for Location](http://stackoverflow.com/questions/30962/finding-city-and-zip-code-for-a-location) – jscs Jun 27 '11 at 19:11

1 Answers1

0

In iOS 4 there is no forward geocoded (turning an address into lat/long), there are some enhancements to this in iOS 5 (this is under NDA, so you'll need to visit the Apple developers site).

If you're looking for something now, here is a forward geocoder you can use: http://blog.sallarp.com/ipad-iphone-forward-geocoding-api-google/

As for the button, there is this project that has many of the commonly used map kit buttons: https://github.com/myell0w/MTLocation

christo16
  • 4,843
  • 5
  • 42
  • 53