【问题标题】:calling maps.app (Apple maps) with navigation using latitude and longitude通过使用纬度和经度的导航调用 maps.app(Apple 地图)
【发布时间】:2013-08-19 06:11:37
【问题描述】:

我想从我的应用程序中调用地图应用程序,并向其发送一个包含源地址和目标地址(用于导航)的纬度和经度的 url

如何构建链接?

【问题讨论】:

    标签: objective-c apple-maps


    【解决方案1】:

    您应该创建一个MKMapItem 的实例并使用openMapsWithItems:launchOptions: 方法打开地图应用程序。

    检查this reference


    对于 iOS 5(你应该考虑放弃对它的支持)我认为格式是:

    [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
                    currentLocation.latitude, currentLocation.longitude,
                    destinationLocation.latitude, destinationLocation.longitude];
    

    【讨论】:

    • iOS6 的解决方案不错,但我需要支持 iOS5
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-16
    • 1970-01-01
    • 1970-01-01
    • 2014-04-30
    相关资源
    最近更新 更多