Skip to content

Simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework.

Notifications You must be signed in to change notification settings

AnilVarghese/LMGeocoder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LMGeocoder

LMGeocoder is a simple wrapper for geocoding and reverse geocoding dynamically from user input. It is blocked-based geocoder, use both Google Geocoding API and Apple iOS Geocoding Framework.

Installation

  • Drag the LMGeocoder folder into your project.
  • Add the CoreLocation.framework to your project.
  • Add the -fno-objc-arc compiler flag to SBJson files in Target Settings > Build Phases > Compile Sources.

Requirements

LMGeocoder requires iOS 7.0 or above and ARC.

Usage

Import the LMGeocoder.h header (see sample Xcode project in /LMGeocoderDemo)

Geocoding

[[LMGeocoder sharedInstance] geocodeAddressString:addressString
                                          service:kLMGeocoderGoogleService
                                completionHandler:^(LMAddress *address, NSError *error) {
                                    if (address && !error) {
                                        NSLog(@"Coordinate: (%f, %f)", address.coordinate.latitude, address.coordinate.longitude);
                                    }
                                    else {
                                        NSLog(@"Error: %@", error.description);
                                    }
                                }];

Reverse Geocoding

[[LMGeocoder sharedInstance] reverseGeocodeCoordinate:coordinate
                                              service:kLMGeocoderGoogleService
                                    completionHandler:^(LMAddress *address, NSError *error) {
                                        if (address && !error) {
                                            NSLog(@"Address: %@", address.formattedAddress);
                                        }
                                        else {
                                            NSLog(@"Error: %@", error.description);
                                        }
                                    }];

License

LMGeocoder is licensed under the terms of the MIT License.

Say Hi

About

Simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published