GeoODLineEffectLayer

new Cesium.GeoODLineEffectLayer(options)

OD动态线特效图层类
Name Type Description
options Object optional 参数选项:
Name Type Default Description
effectType String optional 特效类型,值可以为"ODLineFly","ODLineGround","ODLineVertical"之一,默认值为“ODLineFly”
effectTypeMapField String optional 特效类型映射字段,图层中的特效实体类型由指定的要素对象字段值决定
height Number optional 高度
heightMapField String optional 高度值由指定字段值决定
color Color optional 颜色
colorMapField String optional 颜色值由指定字段值决定
baseLineColor Color color.withAlpha(0.2) optional 线的基准色
baseLineColorMapField String optional 基准色由字段值决定
taperPower Number 0.99999 optional 拖尾线变窄的程度,值越小,拖尾线越细
taperPowerMapField String optional 值由字段值决定
width Number optional 飞线宽度
widthMapField String optional 飞线宽度值由指定字段值决定
duration Number optional 边框颜色
durationMapField String optional 边框颜色值由指定字段值决定
sampleMaxHeight Number optional 边框宽度
sampleMaxPoint Number optional 半径
isParabola Array optional 高度
Author:
  • zj
Example:
effectLayer = new Cesium.GeoODLineEffectLayer({
	color: new Cesium.Color(0, 1.0, 0.5, 1.0),
	width: 2.0,
	duration: 5
});
viewer.effectLayers.add(effectLayer);
effectLayer.setData([
	{
		"type": "Feature",
		"properties": {
			"name": "ODLine1",
		}, 
		"geometry": {
			"type": "LineString",
			"coordinates": [[108.95941461215891, 34.2197731622.101, 489.1], [108.96087018650488, 34.219774276548435, 424.70]],
		}
	},
	{
		"type": "Feature",
		"properties": {
			"name": "ODLine2",
		}, 
		"geometry": {
			"type": "LineString",
			"coordinates": [[108.95941461215891, 34.2197731622.101, 489.1], [108.96097122668127, 34.2193674089985, 423.70]],
		}
	}
]);
Demo:

Extends

Methods

_checkSupportGeometryType(geometryType, supportGeometryType)

检查指定的几何类型是否为图层对象所支持
Name Type Description
geometryType String | Array.<String> 被检查的几何类型
supportGeometryType Array.<String> 支持的几何类型列表,如果为空则为本图层的supportGeometryType属性值

addTo(map)

绑定到三维地图
Name Type Description
map viewer
Inherited From:

destroy()

销毁图层对象
Inherited From:

getData()

获取图层数据
Inherited From:

getDataSource()

获取数据源
Inherited From:

hide()

隐藏图层

pickFeatures(pickedFeatures, windowPosition)Object

拾取图层中的要素
Name Type Description
pickedFeatures Array 场景中被拾取的对象集合,需要在图层自己内部判断识别出属于自己的,并挂接上图层的属性信息
windowPosition Cartesian2 画布的二维坐标
Returns:
返回固定形态的结构数据
Example:
//返回结构参考样例
{
			eventType: ScreenSpaceEventType.LEFT_CLICK,
			originalLayer: GeoWaterEffectLayer
			param:{
				info: pickedFeature,
				pickedInfos: pickedFeatureList
			}
		}

remove()

将图层从视图移除

removeDataSource()

移除数据源
Inherited From:

setData(features)

设置图层相关数据
Name Type Description
features Array.<Object> geojson要素数组,本类只支持LineString几何对象类型
Example:
effectLayer.setData([
	{
		"type": "Feature",
		"properties": {
			"name": "ODLine1",
		}, 
		"geometry": {
			"type": "LineString",
			"coordinates": [[108.95941461215891, 34.2197731622.101, 489.1], [108.96087018650488, 34.219774276548435, 424.70]],
		}
	},
	{
		"type": "Feature",
		"properties": {
			"name": "ODLine2",
		}, 
		"geometry": {
			"type": "LineString",
			"coordinates": [[108.95941461215891, 34.2197731622.101, 489.1], [108.96097122668127, 34.2193674089985, 423.70]],
		}
	}
]);

setDataSource(dataSource)

设置数据源
Name Type Description
dataSource GeoDataSource
Inherited From:

show()

显示图层