简体   繁体   中英

How do I set the opacity of a WMS requested layer in Android Google Maps API

Hi I've followed the instructions on this page: http://www.azavea.com/blogs/labs/2013/01/wms-on-android/ to overlay an image using WMS request to Google Maps from Geoserver. It's working already. The problem is I want the layer/image to be a little less visible (more transparent) so that the map can be seen more. Been searching for days but I can't seem to find solutions using Java Android. Please help. Thank you very much!

The best way to do this is to edit that particular image/layer declared in the XML file. As you have map beneath that layer which you want users to see inspite of an XML element (might be a button) which is at the top of the map its better to configure that XML element so that it is transparent.

This is a small code snippet that shows how to do that:

<ImageButton android:id="@+id/button/layer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_your_button/layer"
android:background="@android:color/transparent"> 

Hope this would Help!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM