动态柱体特效图层类
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
参数选项:
|
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
检查指定的几何类型是否为图层对象所支持
Name | Type | Description |
---|---|---|
geometryType |
String | Array.<String> | 被检查的几何类型 |
supportGeometryType |
Array.<String> | 支持的几何类型列表,如果为空则为本图层的supportGeometryType属性值 |
绑定到三维地图
Name | Type | Description |
---|---|---|
map |
viewer |
- Inherited From:
销毁图层对象
- Inherited From:
获取图层数据
- Inherited From:
获取数据源
- Inherited From:
隐藏图层
拾取图层中的要素
Name | Type | Description |
---|---|---|
pickedFeatures |
Array | 场景中被拾取的对象集合,需要在图层自己内部判断识别出属于自己的,并挂接上图层的属性信息 |
windowPosition |
Cartesian2 | 画布的二维坐标 |
Returns:
返回固定形态的结构数据
Example:
//返回结构参考样例
{
eventType: ScreenSpaceEventType.LEFT_CLICK,
originalLayer: GeoODFaceEffectLayer
param:{
info: pickedFeature,
pickedInfos: pickedFeatureList
}
}
将图层从视图移除
移除数据源
- Inherited From:
设置图层相关数据
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],
}
}
]);
设置数据源
Name | Type | Description |
---|---|---|
dataSource |
GeoDataSource |
- Inherited From:
显示图层