0

How can I alter the opacity of my MKOverlay?

It is currently see-through - which I don't want.

Pangolin
  • 7,284
  • 8
  • 53
  • 67

1 Answers1

1

I have found deep into the references how to do it:

In TileMap example one draws stuff in drawMapRect:zoomScale:inContext.

In there is the following line:

CGContextSetAlpha(context, tileAlpha);

The variable tileAlpha is what you need to set.

This is what the reference said:

A value that specifies the opacity level. Values can range from 0.0 (transparent) to 1.0 (opaque). Values outside this range are clipped to 0.0 or 1.0.

Hope this helps someone in the future.

Pangolin
  • 7,284
  • 8
  • 53
  • 67
  • Since they are immutable, this is very helpful, though I'm unsure if the overlay's views can have their alphas changed, have to keep looking. – Stephen J Mar 13 '12 at 17:36