-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapInWebViewController.m
More file actions
38 lines (29 loc) · 943 Bytes
/
MapInWebViewController.m
File metadata and controls
38 lines (29 loc) · 943 Bytes
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
//
// MapInWebViewController.m
// XolawareUI
//
// Created by me on 2012.04.08.
#include "xolawareOpenSourceCopyright.h" // Copyright (c) 2012 xolaware.
#import "MapInWebViewController.h"
// the only reason to use this over MapKit is because it has the nav bar
// and voice-activated UI from the direct connection to the web page
#define MAP_URL "http://maps.google.com/maps?q="
@implementation MapInWebViewController
@synthesize webView;
@synthesize locationInMap = _locationInMap;
- (NSURL*)googleURL
{
NSString* googleLoc
= [_locationInMap stringByReplacingOccurrencesOfString:@" " withString:@"+"];
return [NSURL URLWithString:[@MAP_URL stringByAppendingString:googleLoc]];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self.webView loadRequest:[NSURLRequest requestWithURL:[self googleURL]]];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
@end