Search code examples
iphonesearchgoogle-maps-api-3street-address

Searching addresses with Google API


I am writing an iphone application when you give a search text, it locate possible addresses.

I was thinking there maybe some Google API for this. I have seen several applications with this feature.

Can anyone provide some information on this?


Solution

  • If you've found the API you want (looks like you have), the basic idea is to use NSURLRequest, NSURLConnection, and NSMutableData to construct a url (ie. http://maps.googleapis.com/maps/api/geocode/output?parameters) and load the resulting data into your application.

    From there, I would make use of a JSON parsing lib to convert the result string into an NSDictionary, so that you can use it easily in your app. This one is my favorite: http://code.google.com/p/json-framework/

    good luck!