How to draw a MKPolyline on a MapView?

前端 未结 3 1368
轻奢々
轻奢々 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条回答
  •  Happy的楠姐
    2020-12-14 16:33

    MKPolyline *polyline = [MKPolyline polylineWithCoordinates:coordinates count:self.allPins.count];
    [self.mapView addOverlay:polyline];
    

    Check this http://pinkstone.co.uk/how-to-draw-an-mkpolyline-on-a-map-view/ and for swift http://rshankar.com/how-to-add-mapview-annotation-and-draw-polyline-in-swift/

提交回复
热议问题