【问题标题】:How to use PolyLine to draw path between two coordinates in Swift iOS如何在 Swift iOS 中使用 PolyLine 在两个坐标之间绘制路径
【发布时间】:2014-06-19 13:15:15
【问题描述】:

苹果的文档中提到并解释了这种方法。有人可以指导我如何使用它吗?

 convenience init(coordinates coords: CMutablePointer<CLLocationCoordinate2D>, count: Int)

【问题讨论】:

    标签: ios swift


    【解决方案1】:

    可以这样使用它:

    let c1 = CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0)
    let c2 = CLLocationCoordinate2D(latitude: 1.0, longitude: 1.0)
    var a = [c1, c2]
    
    var polyline = MKPolyline(coordinates: &a, count: a.count)
    

    我在文档中看不到创建 MKPolylines 的“更快捷”的方式...我假设他们仍在此处构建桥梁。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-06
      • 2019-06-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多