new GeoJsonFeatureCollection(viewer, cacher)
GeoJson要素集构造函数
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
viewer |
Viewer | Cesium.Viewer | |
cacher |
Boolean | false | 是否缓存所有API调用(用于延后执行),默认false; |
Extends
Members
-
<readonly> featureMap :Map
-
要素Map,如果图层是隐藏的,或者尚无真实数据加载,返回的map为空;
Type:
- Map
- Inherited From:
- Overrides:
-
<readonly> viewer :Cesium.Viewer
-
视图实例
Type:
- Cesium.Viewer
- Inherited From:
- Overrides:
Methods
-
add(id, value)
-
添加要素
Parameters:
Name Type Description idString | Number 要素id valueObject 要素对象 - Inherited From:
- Overrides:
Returns:
返回添加的要素对象- Type
- Object
-
animation(style)
-
给数据集设置特效
Parameters:
Name Type Description styleObject 样式对象,具体参考geojson样式文件中有关特效的样式参数,参考:https://cimcube.glodon.com/openservice/user-guide/405?categoryId=2448&origin=homepage -
clearFeatureEffect()
-
清除要素效果
-
disableAnimation()
-
取消animation()设置的特效,还原要素原本特效配置
-
disableBreath()
-
关闭呼吸
-
disableHighLight()
-
取消高亮,恢复本来颜色
-
get(id)
-
根据id获取要素 如果图层是隐藏的,或者尚无真实数据加载,不会得到任何对象;
Parameters:
Name Type Description idString | Number 要素id - Inherited From:
- Overrides:
Returns:
查询到的要素对象- Type
- Object
-
getCenter()
-
获取数据集中心坐标
Returns:
返回中心点笛卡尔坐标- Type
- Cesium.Cartesian3
-
has(id)
-
根据id查询要素是否存在 如果图层是隐藏的,或者尚无真实数据加载,总是返回false
Parameters:
Name Type Description idString | Number 要素id - Inherited From:
- Overrides:
Returns:
是否存在- Type
- Boolean
-
hide()
-
隐藏
-
remove(id)
-
删除要素
Parameters:
Name Type Description idString | Number 要素id - Inherited From:
- Overrides:
Returns:
- Type
- void
-
setBreath(opts)
-
设置呼吸
Parameters:
Name Type Description optsObject 呼吸参数 Properties
Name Type Description colorString 呼吸效果颜色,默认绿色 radiusNumber 呼吸半径-单位:px,阈值:[1,50],默认:5px durationNumber 呼吸时长-单位s,默认为:2s,阈值区间:[1,10] intervalNumber 呼吸间隔-单位s,默认为:0,阈值区间:[0,10] fadeRatioNumber 呼吸衰减系数,阈值:[0,1],0表示无效果,1表示效果最大,默认:0.5 -
setFeatureEffect(mode, options)
-
要素效果设置
Parameters:
Name Type Description modeGlodon.CIMCube.Global.Defines.FeatureEffectMode 要素效果模式 optionsObject 参数对象,参考setHighLight、setFlash、animation、setBreath等方法参数 -
setFlash( [opts])
-
设置高亮
Parameters:
Name Type Argument Description optsObject <optional>
闪烁参数 Properties
Name Type Argument Default Description colorString | Cesium.Color <optional>
Cesium.Color.YELLOW 闪烁颜色,默认黄色 durationNumber <optional>
2 图斑闪烁时长,单位秒 countNumber <optional>
2 闪烁的次数 Example
const opts={ // 图斑闪烁颜色 color: 'yellow', //图斑闪烁时长,默认2s duration: 2, // 闪烁的次数 count: 2, } -
setHighLight( [color] [, displayOnTop])
-
设置高亮
Parameters:
Name Type Argument Default Description colorString | Cesium.Color <optional>
Cesium.Color.YELLOW 高亮颜色,默认黄色 displayOnTopBoolean <optional>
false 是否置顶高亮 -
show()
-
显示