// 海量点
addPoints(list) {
let viewer = this.viewer
let Cesium = getCesium()
let color = new Cesium.Color.fromCssColorString('#FED976').withAlpha(0.6);
//Primitive方式
let pointPrimitives = viewer.scene.primitives.add(
new Cesium.PointPrimitiveCollection()
);
list.forEach((item) => {
let primitive = pointPrimitives.add({
id: item['mmsi'],
pixelSize: 6,
color: color,
position: Cesium.Cartesian3.fromDegrees(item['lon'] / 1000000, item['lat'] / 1000000)
});
primitive.type = 'ship'
primitive.shipId = item['mmsi']
})
}
网友评论