我如何设置一个WMS请求层Android的谷歌地图API的不透明度明度、不透、如何设置、地图

2023-09-05 04:46:41 作者:ヾ用眼泪诠释伤悲

您好我已经按照此页面上的说明: http://www.azavea.com/blogs/labs/2013/01/wms-on-android/ 使用WMS请求从利用Geoserver谷歌地图叠加图像。它的工作了。问题是我想要的层/图像要少一点可见(更透明),以使图中可以看出更多。一直在寻找了几天,但我似乎无法找到使用Java的Andr​​oid解决方案。请帮忙。非常感谢!

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!

推荐答案

要做到这一点,最好的方法是编辑XML文件中宣称,特定的图像/层。你有映射要用户看到XML元素的inspite该层下方(可能是一个按钮),这是在地图上其更好的顶部以配置XML元素使其是透明的。

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.

这是一个小的code片段,展示了如何做到这一点:

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!!