| | |
| | | ]) |
| | | // 清除所有标记点 |
| | | function removeAllPoint () { |
| | | console.log(cesiumExample, 'cesiumExample') |
| | | if (cesiumExample) { |
| | | cesiumExample.entities.removeAll() |
| | | cesiumExample?.entities?.removeAll() |
| | | } |
| | | } |
| | | // 添加标记点 |
| | | function addPoint (pointOption:pointOption) { |
| | | if (!pointOption.longitude && !pointOption.latitude) return |
| | | cesiumExample.entities.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(pointOption.longitude, pointOption.latitude), |
| | | billboard: pointOption.billboard, |
| | |
| | | } |
| | | // 飞行 flyto |
| | | function flyTo (pointOption:pointOption, time: number = 3) { |
| | | if (!pointOption.longitude && !pointOption.latitude) return |
| | | const destination = Cesium.Cartesian3.fromDegrees(pointOption.longitude, pointOption.latitude, 1000) |
| | | const duration = time |
| | | cesiumExample.camera.flyTo({ |