Integrate Google Maps API into an iPhone app

后端 未结 10 2285
南笙
南笙 2020-12-23 10:51

Update: iPhone SDk 3.0 now addresses the question here, however the NDA prevents any in depth discussion. Log in to the iPhone Dev Center if you need more info.

Ok

10条回答
  •  执念已碎
    2020-12-23 11:23

    I have created SVGeocoder, a simple forward and reverse geocoder class for iOS. It uses the Google Geocoding API, returns SVPlacemark objects (an MKPlacemark subclass with a coordinate property) and uses blocks.

    This is how you geocode an address string:

    [SVGeocoder geocode:addressString
             completion:^(NSArray *placemarks, NSError *error) {
                 // do something with placemarks, handle errors
             }];
    

    You can also reverse geocode a coordinate like this:

    [SVGeocoder reverseGeocode:CLLocationCoordinate2DMake(45.53264, -73.60518)
                    completion:^(NSArray *placemarks, NSError *error) {
                        // do something with placemarks, handle errors
                    }];
    

提交回复
热议问题