# new ThemeLayer(name, options)
参数:
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
name |
string | 专题图图层名称。 |
|
options |
Object | 可选参数。 |
|
id |
string | 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。 |
|
opacity |
number | 1 | 图层透明度。 |
继承关系
- L.Layer
方法
# getFeatureBy(property, value)
在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,返回此 feature(并且只返回第一个)。
参数:
名称 | 类型 | 描述 |
---|---|---|
property |
string | 要的某个属性名。 |
value |
string | 对应属性名得值。 |
# getFeaturesByAttribute(attrName, attrValue)
通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
参数:
名称 | 类型 | 描述 |
---|---|---|
attrName |
string | key 值。 |
attrValue |
string | value 值。 |
返回所有匹配的要素数组。
Array
# off(event, callback, context)
移除专题要素事件监听。
参数:
名称 | 类型 | 描述 |
---|---|---|
event |
Event | 监听事件。 |
callback |
function | 回调函数。 |
context |
string | 信息。 |
# on(event, callback, context)
添加专题要素事件监听。添加专题要素事件监听。
参数:
名称 | 类型 | 描述 |
---|---|---|
event |
Event | 监听事件。 |
callback |
function | 回调函数。 |
context |
string | 信息。 |
# removeFeatures(features)
从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
参数:
名称 | 类型 | 描述 |
---|---|---|
features |
Array.<zondy.Feature.Vector> | 将被删除的要素。 |