【发布时间】:2012-11-19 07:12:52
【问题描述】:
我在 iPhone 应用程序中工作,使用 UIWebView 加载 Google 地图地址,它工作正常。
然后我尝试从UIWebView 获取触摸位置latitude 和longitude 值,但我不知道,该怎么做?是否有可能做到这一点?请帮帮我
提前致谢
我试过了:
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 打开地图。
标签: iphone ios google-maps webview latitude-longitude