How to change the color of a MGLPolyline?

后端 未结 2 1148
我在风中等你
我在风中等你 2021-01-27 13:09

How can I change the color of an MGLPolyline? I had looked here but the answer did not work. I also tried some other code but it was too dependant on apple maps. So how can I ch

2条回答
  •  伪装坚强ぢ
    2021-01-27 13:48

    You have to make mapView.delegate = self

    Then implement this method:

    func mapView(_ mapView: MGLMapView, strokeColorForShapeAnnotation annotation: MGLShape) -> UIColor {
    
      return .blue
    }
    

提交回复
热议问题