【发布时间】:2012-09-12 09:30:08
【问题描述】:
我有一个移动网站,我有一个链接可以从我的网站中打开 Google 地图应用程序。然而,现在有了新版本的 ios6,谷歌地图的原生版本不再存在,现在链接打开到基于 safari 的谷歌地图。我宁愿在本地 Apple 地图应用程序中打开它。我该怎么做?
感谢大家的帮助!
【问题讨论】:
我有一个移动网站,我有一个链接可以从我的网站中打开 Google 地图应用程序。然而,现在有了新版本的 ios6,谷歌地图的原生版本不再存在,现在链接打开到基于 safari 的谷歌地图。我宁愿在本地 Apple 地图应用程序中打开它。我该怎么做?
感谢大家的帮助!
【问题讨论】:
您使用maps.apple.com,而不是使用以前的 Google 域 maps.google.com。这将与运行 5.x 及更低版本的旧设备保持兼容。
看起来像这样:
http://maps.apple.com/maps?q=cupertino
大部分参数是相同的,但请参阅 Apple 文档了解更多详细信息:
【讨论】:
你想要什么?
打开地图网络游猎或打开地图应用程序?
试试这个
CLLocation * currentLocation;
NSURL *requestUrl;
CLLocationCoordinate2D storedLocation;
CLLocationCoordinate2D start = { (storedLocation.latitude), (storedLocation.longitude) };
//Bitiş Yeri
CLLocationCoordinate2D end = { ([koordinatX floatValue]), ([koordinatY floatValue]) };
NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f", start.latitude, start.longitude, end.latitude, end.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];
【讨论】: