【问题标题】:How to open iOS 6 maps from a mobile website?如何从移动网站打开 iOS 6 地图?
【发布时间】:2012-09-12 09:30:08
【问题描述】:

我有一个移动网站,我有一个链接可以从我的网站中打开 Google 地图应用程序。然而,现在有了新版本的 ios6,谷歌地图的原生版本不再存在,现在链接打开到基于 safari 的谷歌地图。我宁愿在本地 Apple 地图应用程序中打开它。我该怎么做?

感谢大家的帮助!

【问题讨论】:

    标签: iphone html ios mobile


    【解决方案1】:

    您使用maps.apple.com,而不是使用以前的 Google 域 maps.google.com。这将与运行 5.x 及更低版本的旧设备保持兼容。

    看起来像这样:

    http://maps.apple.com/maps?q=cupertino
    

    大部分参数是相同的,但请参阅 Apple 文档了解更多详细信息:

    Apple URL Scheme Reference: Map Links

    【讨论】:

      【解决方案2】:

      你想要什么?

      打开地图网络游猎或打开地图应用程序?

      试试这个

      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]];
      

      【讨论】:

      • 这看起来像是针对移动应用程序,而不是网站(问题是什么)。
      猜你喜欢
      • 1970-01-01
      • 2014-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多