【问题标题】:Swift Encode Lat&Lon to PolylineSwift 将 Lat&Lon 编码为折线
【发布时间】:2018-09-25 14:21:46
【问题描述】:

我有一个纬度和经度列表,想在地图上显示它作为路径。我可以使用 GMSPath(fromEncodePath: polyline) 在地图上显示折线。

如何将经纬度列表转换为折线或在地图上显示?

非常感谢!

【问题讨论】:

    标签: swift google-maps latitude-longitude polyline


    【解决方案1】:

    您可以像这样从坐标创建路径

    let path = GMSMutablePath()
    path.add(CLLocationCoordinate2DMake(29.520,30.856))
    path.add(CLLocationCoordinate2DMake(25.17,40.1235))
    let pLine = GMSPolyline.init(path: path)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-07
      • 2018-09-05
      • 1970-01-01
      • 1970-01-01
      • 2014-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多