SWIFT: google maps draw waypoint polyline

前端 未结 4 1925
被撕碎了的回忆
被撕碎了的回忆 2021-01-07 09:12

Hi I wonder if there is a method to draw a waypoint between two or more markers in google maps iOS. I don\'t want to draw straight lines... but use just public roads. Here i

4条回答
  •  萌比男神i
    2021-01-07 09:56

    private func drowRoute(){
    
    let path = GMSMutablePath()
        path.addLatitude(self.lat!, longitude: self.long!)
        path.addLatitude(self.destLat!, longitude: self.destLong!)
    let polyline = GMSPolyline(path: path)
    polyline.strokeWidth = 2.0
    polyline.strokeColor = UIColor.blue
    polyline.geodesic = true
    polyline.map = mappView
    
    }
    

提交回复
热议问题