我正在使用iPhone應用程序,使用UIWebView
加載Google地址及其工作正常。 然後,我試圖從UIWebView
獲得觸摸位置latitude
和longitude
的值,但我不知道,如何做到這一點?是否有可能做到這一點?請幫我如何從iPhone中的UIWebView獲取觸摸位置的緯度和經度值?
由於提前
我嘗試這樣做:
webView=[[UIWebView alloc]initWithFrame:CGRectMake(0, 40, 320,376)];
webView.delegate=self;
webView.scalesPageToFit=YES;
NSLog(@"URL:%@",[user valueForKey:@"google_Address"]);
NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=37.785834,-122.406417&output=embed"];
NSURL *url=[NSURL URLWithString:googleMapsURLString];
NSURLRequest *requestObj=[NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
使用MapKit而不是webview來打開地圖。 – spider1983