使用传单热图控制热图的不透明度

问题描述:

我正在使用leaflet.js,heatmap插件。

I am using leaflet.js , heatmap plugin.

有一个名为L.heatLayer的小类(源代码 https://github.com/Leaflet/Leaflet.heat/blob/gh-pages/src/HeatLayer.js

There is one tiny class called L.heatLayer (source code https://github.com/Leaflet/Leaflet.heat/blob/gh-pages/src/HeatLayer.js)

没有不透明度的选项

这些选项只是

options: {
maxZoom: 18,
radius: 25,
blur: 15,
max: 1.0},

有什么方法可以使用这个leaflet.js heatLayer控制不透明度?非常感谢

Is there any way I can control the opacity using this leaflet.js heatLayer ? Thank you very much

你可以通过css完成。 Heatmap是类leaflet-heatmap-layer的画布

You can do it through css. Heatmap is a canvas of class leaflet-heatmap-layer

.leaflet-heatmap-layer {
opacity: .5;
}