Javascript OpenLayers WMS图层透明度
我想知道如何使用openlayers使wms层透明 每个不透明层的当前javascript如下所示:Javascript OpenLayers WMS图层透明度,javascript,html,openlayers,wms,Javascript,Html,Openlayers,Wms,我想知道如何使用openlayers使wms层透明 每个不透明层的当前javascript如下所示: var lyr_GDPSETAAirtemperatureC = new ol.layer.Tile({ source: new ol.source.TileWMS(({ url: "http://weatherservice", params:
var lyr_GDPSETAAirtemperatureC = new ol.layer.Tile({
source: new ol.source.TileWMS(({
url: "http://weatherservice",
params: {"LAYERS": "GDPS.ETA_TT", "TILED": "true"},
})),
title: "Air temperature (°C)"
对于
ol.layer.Tile
可以设置其opacity
使其透明
new ol.layer.Tile({
opacity: 0.5,
visible: true,
source: new ol.source.TileWMS(({
url: "http://weatherservice",
params: {"LAYERS": "GDPS.ETA_TT", "TILED": "true"},
}))
或者使用visible:false将其全部隐藏起来