How do I add a Gradient to MKPolylineView? Initially I tried doing
MKPolylineView *lineView = [[MKPolylineView alloc] initWithPolyline:overlay];
CAGradientLayer *gradient = [CAGradientLayer layer];
//.. configure gradient object
[lineView.layer insertSublayer:gradient atIndex:0];
But that showed nothing on the map (I see the line when I set the strokeColor property). What do I need to do?
Tutorials for general map overlays talk about overriding drawMapRect in MKOverlayView but I'm not sure what to do in that function and which layer to add the gradient to.