GeoCylinderEffectLayer

new Cesium.GeoCylinderEffectLayer(options)

动态柱体特效图层类
Name Type Description
options Object optional 参数选项:
Name Type Description
height Number optional 统一的高度坐标
heightMapField String optional 统一的高度坐标映射字段,值由指定字段值决定
particlesColor Cesium.Color optional 柱体环绕粒子颜色
particlesColorMapField String optional 粒子颜色映射字段,值由指定字段值决定
cylinderColor Cesium.Color optional 柱体颜色
cylinderColorMapField String optional 柱体颜色映射字段,值由指定字段值决定
length Number optional 柱体长度
lengthMapField String optional 柱体长度映射字段,值由指定字段值决定
topRadius Number optional 柱体顶部半径
topRadiusMapField String optional 柱体顶部半径映射字段,值由指定字段值决定
bottomRadius Number optional 柱体底部半径
bottomRadiusMapField String optional 柱体底部半径映射字段,值由指定字段值决定
particlesImageUrl String optional 粒子贴图路径
Author:
  • zj
Example:
//动态柱体特效图层类
effectLayer = new Cesium.GeoCylinderEffectLayer({
	particlesColor: Cesium.Color.GOLD, 
	//指定粒子颜色映射字段
	particlesColorMapField: "particlesColor",					
	cylinderColor: Cesium.Color.GOLD,
	//指定柱体颜色映射字段
	cylinderColorMapField: "cylinderColor",
	length: 100,
	lengthMapField: "length",
	topRadius: 8*0.1,
	bottomRadius: 8,
	particlesImageUrl: '/geomap-api/JsCesuimDemo/resource/images/particles.png'
});

//添加到地图/地球上
effectLayer.addTo(viewer);
effectLayer.setData([
	{
		"type": "Feature",
		"properties": {
			"name": "Cylinder1",
			"length": 300,
			"particlesColor": "rgba(0,0,255,1)",
			"cylinderColor": "rgba(0,0,255,1)"
		}, 
		"geometry": {
			"type": "Point",
			"coordinates": [108.9587516378286, 34.21978169947116, 450],
		}
	},
	{
		"type": "Feature",
		"properties": {
			"name": "Cylinder2",
			"particlesColor": "rgba(255,0,255,1)",
			"cylinderColor": "rgba(255,0,255,1)"
		}, 
		"geometry": {
			"type": "Point",
			"coordinates": [108.9598516378286, 34.21998169947116, 450],
		}
	},
	//如无指定映射字段值,则为实体图层对象属性指定值
	{
		"type": "Feature",
		"properties": {
			"name": "Cylinder2",
		}, 
		"geometry": {
			"type": "Point",
			"coordinates": [108.9577516378286, 34.21998169947116, 450],
		}
	}
]);
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要素数组,本类只支持Point几何对象类型
Example:
effectLayer.setData([
	{
		"type": "Feature",
		"properties": {
			"name": "Cylinder1",
			"length": 300,
			"particlesColor": "rgba(0,0,255,1)",
			"cylinderColor": "rgba(0,0,255,1)"
		}, 
		"geometry": {
			"type": "Point",
			"coordinates": [108.9587516378286, 34.21978169947116, 450],
		}
	},
	{
		"type": "Feature",
		"properties": {
			"name": "Cylinder2",
			"particlesColor": "rgba(255,0,255,1)",
			"cylinderColor": "rgba(255,0,255,1)"
		}, 
		"geometry": {
			"type": "Point",
			"coordinates": [108.9598516378286, 34.21998169947116, 450],
		}
	},
	//如无指定映射字段值,则为实体图层对象属性指定值
	{
		"type": "Feature",
		"properties": {
			"name": "Cylinder2",
		}, 
		"geometry": {
			"type": "Point",
			"coordinates": [108.9577516378286, 34.21998169947116, 450],
		}
	}
]);

setDataSource(dataSource)

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

show()

显示图层