-
Notifications
You must be signed in to change notification settings - Fork 0
/
MapWrapper.m
33 lines (25 loc) · 1.11 KB
/
MapWrapper.m
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
//
// MapWrapper.m
//
// Created by Derrick Walker on 2/21/12.
// Copyright (c) 2012 Derrick Walker. All rights reserved.
//
#import "MapWrapper.h"
@implementation MapWrapper
#pragma mark -
#pragma mark Public Methods
+ (void)openInGoogleMaps:(NSString *)apQuery
{
[ [UIApplication sharedApplication] openURL: [NSURL URLWithString: [NSString stringWithFormat:@"http://maps.apple.com/maps?q=%@", apQuery] ] ];
}
+ (void)openInGoogleMapsWithLatitude:(float)aLat andLongitude:(float)aLong
{
[ [UIApplication sharedApplication] openURL: [NSURL URLWithString: [NSString stringWithFormat:@"http://maps.apple.com/maps?ll=%f,%f",aLat, aLong] ] ];
}
+ (void)openInGoogleMaps:(CLLocationCoordinate2D)aStartAddress withDestination:(CLLocationCoordinate2D)aDestination
{
NSString *vpMapsURLString = [NSString stringWithFormat:@"http://maps.apple.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f",
aStartAddress.latitude, aStartAddress.longitude, aDestination.latitude, aDestination.longitude];
[ [UIApplication sharedApplication] openURL: [NSURL URLWithString:vpMapsURLString] ];
}
@end