【发布时间】:2014-05-23 19:09:45
【问题描述】:
我正在尝试在 UIWebview 上加载谷歌地图并调用 http://maps.google.com/?saddr=22.718019,75.884460&daddr=33.391823,-111.961731&zoom=10&output=embed,但它显示错误“Google Maps Embed API 必须在 UIWebview 的 iFrame 中使用”它之前可以工作,但现在无法正常工作。我正在尝试像这样在 iframe 中加载这个 URL
NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f&zoom=10",[self.startLat floatValue], [self.startLon floatValue], [self.destLat floatValue],[self.destLon floatValue]];
NSString *embedHTML = [NSString stringWithFormat:@"<iframe width=\"300\" height=\"250\" src=\"%@\" frameborder=\"0\" allowfullscreen></iframe>" ,googleMapsURLString];
NSString *html = [NSString stringWithFormat:embedHTML];
但它不工作并给出一些 WebKitError。
请帮忙.. 谢谢!
【问题讨论】:
标签: ios objective-c google-maps iframe