| | |
| | | this.deleteEntities(pointEntities) |
| | | // 水面线连线 |
| | | let cartesians = [] |
| | | //防止切换面板后渲染水面出错 |
| | | this.map.scene.globe.depthTestAgainstTerrain = true; |
| | | for (let i = 0; i < data.length; i++) { |
| | | cartesians.push(new Cesium.Cartesian3.fromDegrees(data[i].lng, data[i].lat,data[i].sw)) |
| | | let temp = this.map.entities.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(data[i].lng, data[i].lat,data[i].sw), |
| | | point: { |
| | | color: Cesium.Color.RED, |
| | | color: Cesium.Color.fromBytes(0, 255, 0), |
| | | pixelSize: 11, |
| | | //防止地形遮挡住点 |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | |
| | | // 清空使用 |
| | | pointEntities.push(temp) |
| | | } |
| | | //防止切换面板后渲染水面出错 |
| | | this.map.scene.globe.depthTestAgainstTerrain = true; |
| | | //防止切换面板后渲染点位过小 |
| | | if (this.map.entities.values.length>pointEntities.length){ |
| | | for (var i = 0; i < pointEntities.length; i++) { |
| | | this.pointEntities[i].point.pixelSize._value=30; |
| | | this.pointEntities[i].point.color._value=Cesium.Color.fromBytes(255, 0, 0); |
| | | this.pointEntities[i].point.color._value=Cesium.Color.fromBytes(0, 255, 0); |
| | | } |
| | | } |
| | | |