forked from TransitApp/SVGeocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSVGeocoder.h
More file actions
executable file
·61 lines (43 loc) · 2.32 KB
/
SVGeocoder.h
File metadata and controls
executable file
·61 lines (43 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// SVGeocoder.h
//
// Created by Sam Vermette on 07.02.11.
// Copyright 2011 samvermette.com. All rights reserved.
//
// https://github.com/samvermette/SVGeocoder
// http://code.google.com/apis/maps/documentation/geocoding/
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "SVPlacemark.h"
#define SVGeocoderComponentRoute @"route"
#define SVGeocoderComponentLocality @"locality"
#define SVGeocoderAdministrativeArea @"administrative_area"
#define SVGeocoderPostalCode @"postal_code"
#define SVGeocoderCountry @"country"
typedef enum {
SVGeocoderZeroResultsError = 1,
SVGeocoderOverQueryLimitError,
SVGeocoderRequestDeniedError,
SVGeocoderInvalidRequestError,
SVGeocoderJSONParsingError
} SVGecoderError;
typedef void (^SVGeocoderCompletionHandler)(NSArray *placemarks, NSHTTPURLResponse *urlResponse, NSError *error);
@interface SVGeocoder : NSOperation
// Set static Google Maps API Key for all requests.
// The key will be included in the request if it's
// not nil.
+ (void)setGoogleMapsAPIKey:(NSString*)key;
+ (SVGeocoder*)geocode:(NSString *)address completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address region:(CLRegion *)region completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address region:(CLRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)reverseGeocode:(CLLocationCoordinate2D)coordinate completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLRegion *)region completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithCoordinate:(CLLocationCoordinate2D)coordinate completion:(SVGeocoderCompletionHandler)block;
- (void)start;
- (void)cancel;
@end