Skip to content
aferre edited this page Jun 4, 2011 · 13 revisions

cf Google Geocoding API page for the behaviour of the WS.

Install

Just copy afGMapsGeocodingRequest and afGoogleMapsAPIRequest files to your project (you need both ASIHTTP and JSON frameworks for the wrapper to work).

How to use

Create a request: afGMapsGeocodingRequest *req =[afGMapsGeocodingRequest geocodingRequest];

`req.afDelegate = self;`

`[req setUseSensor:YES];`

`[req setUseHTTPS:YES];`

`[req setLatlng:self.latlngTF.text];`

`[req startAsynchronous];`

Then, simply make your class inherit the afGoogleMapsGeocodingDelegate protocol, and implement the following delegate functions:

-(void) afGeocodingWSStarted:(afGMapsGeocodingRequest *)ws;

-(void) afGeocodingWS:(afGMapsGeocodingRequest *)ws gotAdress:(NSString *) dist;

-(void) afGeocodingWS:(afGMapsGeocodingRequest *)ws gotCoordinates:(NSString *) coord;

-(void) afDistanceWSFailed:(afGMapsDistanceRequest *)ws withError:(NSString *)er;

Clone this wiki locally