How to draw a MKPolyline on a MapView?

前端 未结 3 1366
轻奢々
轻奢々 2020-12-14 16:27

I have an array of points to be drawn on a map, its already decoded:

- (void) drawRoute:(NSArray *) path {
    NSInteger numberOfSteps = path.count;

    CLL         


        
3条回答
  •  自闭症患者
    2020-12-14 16:43

    Just create MKPolyline with coordinates & add that polyLine to map view.

    MKPolyline *polyLine = [MKPolyline polylineWithCoordinates:coordinates count:numberOfSteps];
        [map addOverlay:polyLine];
    

    You will find an tutorial here on how to draw polyline over some coordinates. Edit: The url does not seems valid anymore. You can find the archived version of this url here.

提交回复
热议问题