Cesium中内置了水面效果的shader,通过添加图元(Primitive),能够在Cesium的地图上实现水面流动的效果,借助互联网上搜索、并进行了修改。
下载了一块水系的geojson数据,因为按照代码,需要根据polygon的坐标进行勾画。
关键实现代码:
//_polygonArr 为polygon的坐标
let waterPrimitive = new Cesium.Primitive({
allowPicking: false,
geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.PolygonGeometry({
polygonHierarchy: new Cesium