GeoWaterEffectLayer

new Cesium.GeoWaterEffectLayer(options)

水面特效图层类
Name Type Description
options Object optional 参数选项:
Name Type Description
effectType Array optional 特效类型,默认值为 "Water"
effectTypeMapField Array optional 特效类型映射要素字段名
height Array optional 水面高度值
url Array optional 贴图路径
waterColor Viewer optional 水面颜色
waveWidth Viewer optional 波纹宽度,范围(0, +Infinity]
flowDirection Viewer optional 水流方向,单位为°,范围[0, 360]
flowSpeed Number optional 水流速度(m/s)
Author:
  • zj
Example:
var effectLayer = new Cesium.GeoWaterEffectLayer({
	url: '/geomap-api/JsCesuimDemo/lib/Cesium/Assets/Textures/grey.png',
	waterColor: new Cesium.Color(0.439, 0.564, 0.788, 0),
	waveWidth: 6,
	flowDirection: 0,
	flowSpeed: 0.7,
});

viewer.effectLayers.add(effectLayer);
effectLayer.setData([
   {
		"type": "Feature",
		"properties": {
			"name": "Water1"
		},
		"geometry": {
		   "type": "Polygon",
		   "coordinates": [
			   [
				   [108.95784047447702, 34.219977705424250, 422],
				   [108.95782804955876, 34.219364587415185, 422],
				   [108.95838631130526, 34.219330390989890, 422],
				   [108.95839328710329, 34.220033491883065, 422]
			   ]
		   ]
		}
	}
]);
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: GeoODFaceEffectLayer
			param:{
				info: pickedFeature,
				pickedInfos: pickedFeatureList
			}
		}

remove()

将图层从视图移除

removeDataSource()

移除数据源
Inherited From:

setData(features)

设置图层相关数据
Name Type Description
features Array.<Object> geojson要素数组,本类只支持Polygon几何对象类型
Example:
effectLayer.setData([
   {
		"type": "Feature",
		"properties": {
			"name": "Water1"
		},
		"geometry": {
		   "type": "Polygon",
		   "coordinates": [
			   [
				   [108.95784047447702, 34.219977705424250, 422],
				   [108.95782804955876, 34.219364587415185, 422],
				   [108.95838631130526, 34.219330390989890, 422],
				   [108.95839328710329, 34.220033491883065, 422]
			   ]
		   ]
		}
	}
]);

setDataSource(dataSource)

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

show()

显示图层