Skip to content

Commit f2574ba

Browse files
author
Marcin Iwanicki
committed
Merge branch 'master' of github.com:marciniwanicki/OCGoogleDirectionsAPI
2 parents fe64f19 + 772378a commit f2574ba

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ It's really simple. To get directions you need to do <b>4 easy steps</b>.
3131
#import <OCGoogleDirectionsAPI/OCGoogleDirectionsAPI.h>
3232
````
3333

34-
2. Secondly you must provide your Google API Key. The method `application:didFinishLaunchingWithOptions:` in AppDelegate seams to be a good place for this code.
34+
2. Secondly you can provide your Google API Key. The method `application:didFinishLaunchingWithOptions:` in AppDelegate seams to be a good place for this code.
35+
However the API Key is now optional. Please check [API Key section](https://developers.google.com/maps/documentation/directions/#api_key) to decide if you need the key or not.
3536

3637
```objc
37-
[OCDirectionsAPIClient provideAPIKey:@"<YOUR KEY>"];
38+
[OCDirectionsAPIClient provideAPIKey:@"<YOUR API KEY>"];
3839
```
3940
4041
3. Prepare a `OCDirectionsRequest` object to specify route(s) you want to retrieve from the service.
4142
4243
```objc
43-
OCDirectionsRequest *request = [OCDirectionsRequest requestWithOriginString:@"<ORIGIN>" andDestinationString:@"<DESTINATION>" sensor:NO];
44+
OCDirectionsRequest *request = [OCDirectionsRequest requestWithOriginString:@"<ORIGIN>" andDestinationString:@"<DESTINATION>"];
4445
```
4546

4647
4. Create an instance of `OCDirectionsAPIClient` and call `directions:response:` method to retrieve required data (`OCDirectionsResponse`) asynchronously.
@@ -60,6 +61,16 @@ It's really simple. To get directions you need to do <b>4 easy steps</b>.
6061
// some code
6162
}];
6263
```
64+
65+
Some init methods of `OCDirectionsAPIClient`:
66+
67+
```objc
68+
- (instancetype)initWithKey:(NSString *)key;
69+
70+
- (instancetype)initWithNoKeyUseHttps:(BOOL)useHttps;
71+
72+
- (instancetype)initWithKey:(NSString *)key useHttps:(BOOL)https;
73+
```
6374

6475
<b>Sequence diagram</b>
6576

@@ -74,12 +85,20 @@ That's all! It's quite easy, isn't it? If you like to know a bit more about requ
7485
To create an isntance of `OCDirectionsRequest` you can use one of the following factory methods.
7586

7687
```objc
88+
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationLocation:(CLLocation *)destination;
89+
7790
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationLocation:(CLLocation *)destination sensor:(BOOL)sensor;
7891

92+
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationLocation:(CLLocation *)destination;
93+
7994
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationLocation:(CLLocation *)destination sensor:(BOOL)sensor;
8095

96+
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationString:(NSString *)destination;
97+
8198
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationString:(NSString *)destination sensor:(BOOL)sensor;
8299

100+
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationString:(NSString *)destination;
101+
83102
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationString:(NSString *)destination sensor:(BOOL)sensor;
84103
```
85104

0 commit comments

Comments
 (0)