Namespace: Util

Util

工具类。

Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/openlayers/iclient-ol.js"></script>
<script>
  const result = ol.supermap.Util.getOlVersion();

</script>

// ES6 Import
import { Util } from '@supermapgis/iclient-ol';

const result = Util.setMask();

Methods

hexToRgba(hex, opacity){string}

common/commontypes/Util.js, line 1096

十六进制转 RGBA 格式。

Name Type Description
hex Object

十六进制格式。

opacity number

不透明度Alpha。

Returns:
Type Description
string 生成的 RGBA 格式。

setMask(layers, polygon)

openlayers/core/Util.js, line 390

为图层设置掩膜。

Name Type Description
layers ol.layer.Layer | Array.<ol.layer.Layer>

图层

polygon ol.geom.Geometry | ol.Feature

掩膜矢量要素,支持面类型的要素。

Version:
  • 10.1.0

unsetMask(layers)

openlayers/core/Util.js, line 439

取消图层掩膜。

Name Type Description
layers ol.layer.Layer | Array.<ol.layer.Layer>

图层

Version:
  • 10.1.0