• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

LMGeocoder

LMGeocoder is a simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework.

CI Status Version License Platform

Features

  • Wrapper for Geocoding and Reverse geocoding with blocked-based coding.
  • Use both Google Geocoding API and Apple iOS Geocoding Framework.

Requirements

iOS 8.0 or higher

Installation

LMGeocoder is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LMGeocoder'

Swift Version

https://github.com/lminhtm/LMGeocoderSwift

Usage

Geocoding

[[LMGeocoder sharedInstance] geocodeAddressString:addressString
                                          service:LMGeocoderServiceGoogle
                               alternativeService:LMGeocoderServiceApple
                                completionHandler:^(NSArray *results, NSError *error) {
                                    if (results.count && !error) {
                                        LMAddress *address = [results firstObject];
                                        NSLog(@"Coordinate: (%f, %f)", address.coordinate.latitude, address.coordinate.longitude);
                                    }
                                }];

Reverse Geocoding

[[LMGeocoder sharedInstance] reverseGeocodeCoordinate:coordinate
                                              service:LMGeocoderServiceGoogle
                                   alternativeService:LMGeocoderServiceApple
                                    completionHandler:^(NSArray *results, NSError *error) {
                                        if (results.count && !error) {
                                            LMAddress *address = [results firstObject];
                                            NSLog(@"Address: %@", address.formattedAddress);
                                        }
                                    }];

Cancel Geocode

[[LMGeocoder sharedInstance] cancelGeocode];

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

License

LMGeocoder is available under the MIT license. See the LICENSE file for more info.

Author

Minh Nguyen