I have a custom MKOverlay
and MKOverlayView
. When the MKOverlayView
is created, I can set the alpha
of the view:
-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context {
DatasetOverlay *datasetOverlay = (DatasetOverlay *)self.overlay;
UIImage *image = [UIImage imageWithData:datasetOverlay.imageData];
CGImageRef imageReference = image.CGImage;
MKMapRect theMapRect = [self.overlay boundingMapRect];
CGRect theRect = [self rectForMapRect:theMapRect];
CGContextScaleCTM(context, 1.0, -1.0);
CGContextTranslateCTM(context, 0.0, -theRect.size.height);
CGContextSetAlpha(context, 1);
CGContextDrawImage(context, theRect, imageReference);
}
But I want to be able to change the alpha
of the view after its draw.
How can I do that?
I am have not worked much with Core Graphics yet.