How to draw arc/curve line with MKOverlayView on MKMapView

前端 未结 4 1986
猫巷女王i
猫巷女王i 2020-12-05 15:28

Help needed now. I can draw lines with MKPolyline and MKPolylineView, but how to draw an arc or curve lines between two coordinates on the MKMapView? Great thanks.

4条回答
  •  既然无缘
    2020-12-05 15:48

    Reading the documentation, it seems that you can create an instance of MKOverlayPathView and assign an arbitrary CGPathRef object to its path property. This path can contain both straight lines and arcs.

    I don't know (and the documentation doesn't mention) in what format the coordinates of the path should be (MKMapPoint or CLLocationCoordinate2D come to mind) but you can probably find that out by experimenting a bit.

提交回复
热议问题