添加一个UIWebView控件,UIWebView *myWebView;
在适当的地方添加下面的代码:
//获取路线
NSMutableString *googleSearch = [NSMutableString stringWithFormat:@"http://ditu.google.cn/maps?f=d&source=s_d&saddr='北京'&daddr=31.186371,121.489885&hl=zh&t=m&dirflg=h"];[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[googleSearch stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
本文演示如何在iOS应用中使用UIWebView加载Google地图,实现从北京到坐标点的路线导航。

被折叠的 条评论
为什么被折叠?



