问题
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!
回答1:
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!!
来源:https://stackoverflow.com/questions/27936381/how-do-i-set-the-opacity-of-a-wms-requested-layer-in-android-google-maps-api