MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / setOpacity

Method setOpacity

src/openlayers/overlay/theme/Theme.js:178–189  ·  view source on GitHub ↗

* @function Theme.prototype.setOpacity * @description 设置图层的不透明度,取值范围:[0-1]。 * @param {number} opacity - 不透明度。

(opacity)

Source from the content-addressed store, hash-verified

176 * @param {number} opacity - 不透明度。
177 */
178 setOpacity(opacity) {
179 if (opacity !== this.opacity) {
180 this.opacity = opacity;
181 var element = this.div;
182 CommonUtil.modifyDOMElement(element, null, null, null,
183 null, null, null, opacity);
184
185 if (this.map !== null) {
186 this.dispatchEvent({type: 'changelayer', value: {layer: this, property: "opacity"}});
187 }
188 }
189 }
190
191 /**
192 * @function Theme.prototype.addFeatures

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected