new GeoFeatureThemeLayer(name, options)
Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
new L.supermap.GeoFeatureThemeLayer(name, options);
</script>
// ES6 Import
import { GeoFeatureThemeLayer } from '@supermap/iclient-leaflet';
new GeoFeatureThemeLayer(name, options);
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
专题图名。 |
||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
参数。
|
Fires
Extends
Events
-
beforefeaturesadded
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 73 -
添加数据之前触发。
Properties:
Name Type Description features
Array.<ServerFeature> | Array.<ThemeFeature> | Array.<GeoJSONObject> | ServerFeature | ThemeFeature | GeoJSONObject 要素。
-
inherited changelayer
leaflet/overlay/theme/ThemeLayer.js, line 538 -
图层属性改变之后触发。
Properties:
Name Type Description layer
Object 图层。
property
string 图层属性。
-
inherited featuresremoved
leaflet/overlay/theme/ThemeLayer.js, line 216 -
删除的要素成功之后触发。
Properties:
Name Type Description features
Array.<FeatureVector> 删除失败的要素数组。
succeed
boolean 要输是否删除成功,true 为删除成功,false 为删除失败。
Methods
-
addFeatures(features)
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 65 -
添加数据。
Name Type Description features
Array.<ServerFeature> | Array.<ThemeFeature> | Array.<GeoJSONObject> | ServerFeature | ThemeFeature | GeoJSONObject 待添加的要素。
-
clear()
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 238 -
清除的内容包括数据(features)、专题要素、缓存。
-
clearCache()
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 229 -
清除缓存数据。
-
createThematicFeature(feature){Array.<FeatureVector>}
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 188 -
创建专题要素。
Name Type Description feature
FeatureVector 要创建的要素。
Returns:
Type Description Array.<FeatureVector> 返回矢量要素。 -
inherited destroyFeatures(features)
leaflet/overlay/theme/ThemeLayer.js, line 140 -
销毁要素。
Name Type Description features
Array.<FeatureVector> | FeatureVector 将被销毁的要素。
-
getCacheCount(){number}
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 250 -
获取当前缓存数量。
Returns:
Type Description number 返回当前缓存数量。 -
inherited getEvents(){Object}
leaflet/overlay/theme/ThemeLayer.js, line 54 -
获取图层事件。
Returns:
Type Description Object 返回图层事件。 -
inherited getFeatureById(featureId){Array.<FeatureVector>}
leaflet/overlay/theme/ThemeLayer.js, line 281 -
返回指定 ID 的矢量要素,不存在则返回 null。
Name Type Description featureId
number 要素 ID。
Returns:
Type Description Array.<FeatureVector> 返回图层中的要素。 -
inherited getFeatures(filter){Array.<FeatureVector>}
leaflet/overlay/theme/ThemeLayer.js, line 244 -
查看当前图层中的有效数据。
Name Type Description filter
function 可选 根据条件过滤要素的回调函数。
Returns:
Type Description Array.<FeatureVector> 返回图层中的要素。 -
inherited getLocalXY(coordinate)
leaflet/overlay/theme/ThemeLayer.js, line 436 -
地理坐标转为像素坐标。
Name Type Description coordinate
Array -
getShapesByFeatureID(featureID){Array}
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 272 -
通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
Name Type Description featureID
number 要素 ID。
Returns:
Type Description Array 返回图形数组。 -
inherited off(event, callback, context)
leaflet/overlay/theme/ThemeLayer.js, line 397 -
移除事件监听。
Name Type Description event
Event 监听事件。
callback
function 回调函数。
context
string 信息。
-
inherited on(event, callback, context)
leaflet/overlay/theme/ThemeLayer.js, line 381 -
监听事件。监听专题要素事件。
Name Type Description event
Event 监听事件。
callback
function 回调函数。
context
string 信息。
-
inherited onRemove(map)
leaflet/overlay/theme/ThemeLayer.js, line 72 -
删除某个地图。
Name Type Description map
L.Map Leaflet Map 对象。
-
redraw()
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 220 -
重绘该图层。
-
redrawThematicFeatures(bounds)
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 117 -
重绘所有专题要素。 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。 地图漫游时调用此方法进行图层刷新。
Name Type Description bounds
L.Bounds 重绘的范围。
-
removeAllFeatures()
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 108 -
清除当前图层所有的矢量要素。
-
removeFeatures(features)
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 98 -
删除专题图中 features。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
Name Type Description features
Array.<FeatureVector> | FeatureVector | function 要删除的要素或用于条件删除的回调函数。
-
setMaxCacheCount(cacheCount)
leaflet/overlay/theme/GeoFeatureThemeLayer.js, line 259 -
设置最大缓存数量。
Name Type Description cacheCount
number 最大缓存量。
-
inherited setOpacity(opacity)
leaflet/overlay/theme/ThemeLayer.js, line 346 -
设置图层的不透明度,取值 [0-1] 之间。
Name Type Description opacity
number 不透明度。
-
inherited deprecated toFeature(features){FeatureVector}
leaflet/overlay/theme/ThemeLayer.js, line 496 -
转为 iClient 要素,该方法将被弃用,由
ThemeLayer#toiClientFeature
代替。Name Type Description features
Array.<ServerFeature> | Array.<ThemeFeature> | Array.<GeoJSONObject> | ServerFeature | ThemeFeature | GeoJSONObject 待转要素。
Returns:
Type Description FeatureVector 转换后的 iClient 要素。 -
inherited toiClientFeature(features){Array.<FeatureVector>}
leaflet/overlay/theme/ThemeLayer.js, line 461 -
转为 iClient 要素。
Name Type Description features
Array.<ServerFeature> | Array.<ThemeFeature> | Array.<GeoJSONObject> | ServerFeature | ThemeFeature | GeoJSONObject 待转要素。
Returns:
Type Description Array.<FeatureVector> 转换后的 iClient 要素。 -
inherited update(bounds)
leaflet/overlay/theme/ThemeLayer.js, line 311 -
更新图层。
Name Type Description bounds
L.Bounds 图层范围。