GeoBrightkiteLayer

new Cesium.GeoBrightkiteLayer(options)

灯火图图层
Name Type Description
options Object 参数选项:
Name Type Default Description
viewer Viewer optional 三维球
color Color Cesium.Color.fromCssColorString('rgba(255, 122, 40, 0.8)') optional 点的颜色,设置该属性后,所有的点的颜色一致
colorMapField String optional 点颜色映射字段,设置该属性后,点的颜色从属性中取值
pixelSize Number 5.0 optional 点的尺寸大小,单位像素
pixelSizeMapField String optional 点的尺寸映射字段,设置该属性后,将从属性中取值
outlineColor Color Cesium.Color.fromCssColorString('rgba(255, 122, 40, 0.3)') optional 点的轮廓颜色。设置与color颜色一致但透明度更小的颜色 会在视觉上产生一种点的模糊感的效果
outlineColorMapField Color optional 轮廓颜色映射字段
outlineWidth Number 0.0 optional 轮廓宽度,单位像素
outlineWidthMapField String optional 轮廓宽度映射字段
animation Boolean true optional 是否开启动画效果
speed Number 200 optional 动画速度,大于0,值越大,动画速度越慢,值越小,动画速度越快
minimumScaleSize Number 0.3 optional 点的最小尺寸因子,范围[0,1]。比如如果点的大小是5像素,则开启动画时缩放的最小尺寸是5*0.3=1.5像素。
Author:
  • liuhonglei
Examples:
var geoBrightkiteLayer = new Cesium.GeoBrightkiteLayer({
     viewer: viewer,
     color: Cesium.Color.fromCssColorString('rgba(255, 122, 40, 0.8)'),
     pixelSize: 5.0,
     outlineColor: Cesium.Color.fromCssColorString('rgba(255, 122, 40, 0.3)'),
     outlineWidth: 1.0,
     animation: true,
     speed: 200,
     minimumScaleSize: 0.3
});
geoBrightkiteLayer.addTo(viewer);
// 静态数据
var data = [
     {
         type: 'Feature',
         geometry: {
             type: 'Point',
             coordinates: [120, 30]
         },
         properties: {}
     },
     ...
];
geoBrightkiteLayer.setData(data);
// 请求数据
Cesium.Resource.fetchJson({
     url: 'http://' + Cfg.host + '/' + Cfg.projectName + '/JsCodeDemo_new/data/yuzhou.json'
}).then((result) => {
     var data = [];
     for (var i = 0; i < result.features.length; i++) {
         var feature = {
             type: 'Feature',
             properties: {},
             geometry: {
                 type: 'Point',
                 coordinates: [
                     result.features[i].attributes.X,
                     result.features[i].attributes.Y
                 ]
             }
         };
         data.push(feature);
     }
     geoBrightKiteLayer.setData(data);
});
Demo:

Extends

Methods

addTo(map)

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

destroy()

销毁图层对象
Inherited From:

getData()

获取图层数据
Inherited From:

getDataSource()

获取数据源
Inherited From:

hide()

设置图层隐藏
Inherited From:

pickFeatures(pickedFeatures, windowPosition, geographicPosition, eventType)Object

拾取图层中的要素
Name Type Description
pickedFeatures Array 场景中被拾取的对象集合,需要在图层自己内部判断识别出属于自己的,并挂接上图层的属性信息
windowPosition Cartesian2 画布的二维坐标
geographicPosition Object 地理位置,{ lng: lng, lat: lat, height: height }
eventType ScreenSpaceEventType 事件类型
Returns:
返回固定形态的结构数据
Inherited From:
Example:
//返回结构参考样例
{
			houseCode: fwCode,
			floorCode: floor,
			eventType: ScreenSpaceEventType.LEFT_CLICK,
			originalLayer: geoSingleBuildingLayer
			param:{
				info: pickedFeature,
				pickedInfos: pickedFeatureList
			}
		}

remove()

清空图层中图元
Inherited From:

removeDataSource()

移除数据源
Inherited From:

render()

渲染
Inherited From:

setData(data)

设置图层数据源
Name Type Description
data Array 数据,数据格式为点要素数组

setDataSource(dataSource)

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

show()

设置图层显示
Inherited From: