I am trying to figure out how to use a new MKOverlayPathRenderer
class.
In my app I previously used MKOverlayPathView
when building with iOS 6 SDK,
but it does not seem to work with iOS 7 SDK unfortunately.
So I am trying to move my app from MKOverlayPathView
to
MKOverlayPathRenderer
, but have no success so far.
MKPolylineRenderer
works OK, but MKOverlayPathRenderer
does not.
The code gets called, but no overlay is drawn on a map.
Does anybody have a working example for MKOverlayPathRenderer
?
First you have to make sure that you set
lineWidth
andstrokeColor
Then In your renderer class, you have to override
-(void) createPath
methodif you want custom drawing, you would like to override this
-(void) drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
method.