关于cesium:记录入门cesiumcesium全球动态贴图使用场景气象海冰分布时序

57次阅读

共计 1486 个字符,预计需要花费 4 分钟才能阅读完成。

hint:

"@supermap/vue-iclient3d-webgl": "^1.0.9"

计划一:

imageList = [{image:require("../../static/Image_15.png")},
        {image:require("../../static/Image_16.png")},
        {image:require("../../static/Image_17.png")},
        {image:require("../../static/Image_18.png")},
        {image:require("../../static/Image_19.png")},
        {image:require("../../static/Image_20.png")},
        {image:require("../../static/Image_21.png")},
        {image:require("../../static/Image_22.png")},
        {image:require("../../static/Image_23.png")},
        {image:require("../../static/Image_24.png")},
        {image:require("../../static/Image_25.png")},
        {image:require("../../static/Image_26.png")},
        {image:require("../../static/Image_27.png")},
        {image:require("../../static/Image_28.png")},
        {image:require("../../static/Image_29.png")},
        {image:require("../../static/Image_30.png")}
      ]



setInterval(() =>{let newPic = that.imageList.shift()
      viewer.imageryLayers.remove()
      let c = viewer.imageryLayers.addImageryProvider(new Cesium.SingleTileImageryProvider({url : newPic.image}));
      that.imageList.push(newPic)
      setTimeout(() =>{viewer.imageryLayers.remove(c)
      },430)
    },230)

论断:十分吃性能,切图太快了就不行。
计划二:
采纳了 CallbackProperty 类回调函数提早计算,它能够实时自我调用。要求:肯定是寰球贴图。

this.entities = viewer.entities.add({
      rectangle: {
            coordinates: Cesium.Rectangle.fromDegrees(
                    -180.0,
                    -90.0,
                    180.0,
                    90.0
                  ),
            granularity:Cesium.Math.RADIANS_PER_DEGREE*10,
            material: new Cesium.ImageMaterialProperty({image:new Cesium.CallbackProperty(() => {let newPic = imageList.shift()
                imageList.push(newPic)
                    return newPic.image;
                }, false)
            })
        }
    });

论断:最开始没有设置 granularity 的时候,只有 2 帧率,改成默认值 10 倍当前有大略 60 帧率。

正文完
 0