简体   繁体   English

如何在Android Google Maps API中设置WMS请求图层的不透明度

[英]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. 嗨,我已经按照此页面上的说明进行操作: http : //www.azavea.com/blogs/labs/2013/01/wms-on-android/ ,它使用WMS请求从Geoserver向Google Maps叠加了图像。 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. 搜寻了几天,但似乎无法找到使用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. 最好的方法是编辑XML文件中声明的特定图像/图层。 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. 当您在该层下面有地图时,您希望用户看到一个XML元素(可能是一个按钮),尽管它位于地图的顶部,所以最好配置该XML元素使其透明。

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!! 希望这会有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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