Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making TileOverlays transparent

I'm currently working on a App that uses a custom TileSource to display data on Google Maps. I get those data in form of *.png images, and I'm using the URLTileProvider.

Everything is working well, but I'm now trying to make the TileLayer transparent, or at least, partly. The goal is, that the layer is visible but the underlying Google Maps still shines through. Somehow I'm stuck, as I do not know how to achieve this.

  • I did not find a way to fully implement a custom TileProvider, it seems one can only extend URLTileProvider
  • Serverside imagemanipulation is not possible, as the data is given
  • There are no options to make a TileOverlay transparent? (alpha, opacity, transparency)

I'd be very helpful if someone could hint me in the right direction, or tell me whether the Google Maps API V2 for Android really does not support this feature.

like image 938
Elysium Avatar asked Jan 14 '13 16:01

Elysium


People also ask

How to make transparent overlays?

The process is a matter of creating brushstroke or shapes and styling them to suit your needs. The real magic happens in the file savings process. To get the transparent attribute, transparent overlays are save as specific file types. The file type is what will make them transparent.

How do you make a transparent background with a picture?

Here's how: Upload the image to PhotoScissors. Deep neural networks process it and render the background pixels transparent automatically. All done! Now just save the image as a PNG to preserve the background transparency and use the image wherever you want.

What is overlay in web design?

But, as the word “overlay” implies, it’s supposed to “lay over” your background image or collage of images. When you put text or other elements on top of your overlay, they will stand out and pop more than if they were simply on the image alone.

Where can I find free image overlays?

Online graphics editors such as Canva come with the host of image overlays that you can choose from. Many of the design assets included with online editors are free. Most of them, at least the most premium and worthwhile overlays are paid.


1 Answers

At this moment it is not possible to specify transparency for TileOverlay in android maps sdk v2. Unfortunately setTransparency(float) method is available for GroundOverlay only.. The only way to do this - is to implement your own TileProvider and change png 'on-the-fly' to change alpha channel.

like image 186
Pavel Dudka Avatar answered Sep 22 '22 04:09

Pavel Dudka