I have an MKMapView and am adding an overlay (MKOverlay) to it.
I would like the overlay to make the map view underneath to appear black & white (i.e. monochrom
The most proper route, which sadly isn't yet available on iOS would be:
Your MKOverlay
is at some point being used to create an MKOverlayView
, which will have a CALayer
as it descends from UIView
. You can attach CIFilter
s as compositingFilter
s to CALayer
s, which dictate how the view is composited with the background. You could attach a filter of type CIColorMonochrome
to that.
Because that option isn't available, you're going to have to leap through some major hurdles to do the work for yourself. You'll probably need to implement your own custom MKOverlayView
that in its drawView
uses the techniques given in Apple's QA1703 to get the pixel contents of the map view in the relevant area (be careful not to end up in an infinite recursive loop though), transform those into black and white and present them as your view.
Is that something it's worth investigating further or would you be happier to substitute the effect than to really delve into this stuff?