0

I need to draw the border for the Polyline on my Mapview

enter image description here

Here is the screenshot that I need to implement but I am getting the poly line without the border.

enter image description here

Code Work:

- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id <MKOverlay>)overlay {

    MKPolylineRenderer *renderer = [[MKPolylineRenderer alloc] initWithPolyline:overlay];

    renderer.strokeColor = [UIColor rle_lightBurGundy];

    renderer.fillColor = [UIColor rle_whiteColor];

    renderer.lineWidth = 4.0;

    return renderer;
}
dahiya_boy
  • 9,298
  • 1
  • 30
  • 51
Nandhakumar
  • 64
  • 2
  • 12

1 Answers1

0

Check out this thread Draw MKPolyline Fill Color. Chandni - Systematix' s answer is a good way to solve your issue ... you need to make an custom renderer that will draw 2 paths (the border and the main polyline). He linked a github exemple you can check the ASPolylineRenderer.h/.m Github link : https://github.com/nighthawk/ASPolylineView

Holyverz
  • 11
  • 4