Reputation: 115
I have loaded google map application in iphone . I am using UIWebView Control in that Control i loaded google maps like following
UIWebView *webView;
NSString *url = [NSString stringWithFormat: @"http://maps.google.com/maps?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA"];
NSURL *aURL = [NSURL URLWithString:url];
webView.backgroundColor = [UIColor whiteColor];
NSURLRequest *aRequest = [NSURLRequest requestWithURL:aURL];
webView.dataDetectorTypes=UIWebViewNavigationTypeBackForward;
webView.scalesPageToFit = YES;
webView.autoresizesSubviews = YES;
webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
//set the web view and acceleration delagates for the web view to be itself
[webView loadRequest:aRequest];
Its work fine with pin point.But i want to display address in google maps application when they click the pin.The pin (i.e its denoted A).
Can anyone help me ?
Thanks in advance......
One more help What i given in the parameters of " q " should be applied in the search box of google maps.I want to avoid this . Any help would be appreciated ?
Upvotes: 1
Views: 741
Reputation: 9113
use MapKit (MKMapView object) instead of a webview pointed to a google map image and use Google Map API to retrieve coordinates of the address.
You can use AddressAnnotation object to create a pin and the addAnnotation method of MKMapView to add it to your map.
Have fun !
Upvotes: 2