views:

23

answers:

1

All,

I have a need to display information on a MapView object. No problems there.

The issue is that there are times when the MapView object displays map details that visually compete with my overlay data.

So, what I'd like to do is provide a way to "scale back" the MapView object visually by using an alpha channel.

bold*Can an alpha value get applied to a MapView object? If so, how?*bold

Alternatively, I was thinking that perhaps a separate all black overlay might provide the same results. Scale the alpha of this overlay and I might end up with the same overall effect.

Insight please.

Thanks.

Rich

A: 

Are you sure you want to do this? It might be better to revisit your overlay's graphic design... simply giving them a thicker border might be a cheap solution to the problem.

First suggestion would be to subclass MapView and override dispatchDraw() with something like this:

@Override protected void dispatchDraw(Canvas canvas) {

  // Firstly let MapView draw
  super.dispatchDraw(canvas);

  // Draw a translucent fill on top of it
  canvas.drawColor(0x7FFFFFFF);

  // TODO: Draw my overlay
}
Reuben Scratton
The graphics design (overlay) is pretty well set, so that's less of an option. In fact, the real issue are the icon text labels: these are "clashing" with the MapView details. Hence the desire to alpha the MapView. Thanks.
richbl