海量点

2023-11-13  本文已影响0人  xueyueshuai
    // 海量点
    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']
      })
    }
上一篇下一篇

猜你喜欢

热点阅读