iphone - 从 Objective-C 使用 Url 调用谷歌地图

标签 iphone objective-c cocoa-touch google-maps

我调用谷歌地图的 url 来显示给定纬度和经度的位置。 我怎样才能用图钉在 map 上标记这个位置?

 NSString *latlong = [NSString stringWithFormat:@"%@,%@", einBetrieb.lat, einBetrieb.lng];
 NSString *url = [NSString stringWithFormat: @"http://maps.google.com/maps?ll=%@",
      [latlong stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];

关心卡格拉尔

最佳答案

试试这个网址:

NSString *url = [NSString stringWithFormat: @"http://maps.google.com/maps?q=%@", [latlong stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

这应该可以满足您的需求。用“q”替换“ll”

关于iphone - 从 Objective-C 使用 Url 调用谷歌地图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3728345/

相关文章:

ios - 从 iPhone 设备上传视频失败但在模拟器上完美运行错误 :'Cannot read file'

iphone - 如何在 textview 中找到任何单词的位置或获取 rect 并将按钮放在其上?

iphone - 自动布局和表格 View 标题

iphone - 埃塞俄比亚 unicode 在 iPhone 模拟器上显示为方框

iphone - iOS:为什么我不能将 nil 设置为 NSDictionary 值?

iphone - UIWebView 和 Safari 渲染不同

c++ - ReactiveCocoa 可以与纯 c++ ViewModel 一起使用吗?

objective-c - NSUserDefaults 标准用户默认值

cocoa-touch - 从 cocoa http获取请求中提取数据

iphone - XCode静态分析器: Analyzer skipped this file due to parse errors