<!-- * @Author: your name * @Date: 2021-05-13 21:02:13 * @LastEditTime: 2021-05-18 22:11:03 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \cesium-vue\src\components\PointEntity\index.vue --> <template> <div></div> </template> <script> import * as Cesium from "cesium/Cesium" export default { props: { viewer: Object }, mounted() { this.init(); }, methods: { init() { this.viewer.entities.add({ name: 'Red tube with rounded corners', polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArray([ -85.0, 32.0, -85.0, 36.0, -89.0, 36.0 ]), material: Cesium.Color.RED, shape: this.computedRadius(6000.0) } }) this.viewer.zoomTo(this.viewer.entities) }, computedRadius(radius) { let positions = [] for (let i = 0; i < 360; i++) { let rs = Cesium.Math.toRadians(i);//角度转为弧度 //计算弧度的位置 positions.push(new Cesium.Cartesian2(radius * Math.cos(rs), radius * Math.sin(rs))) } return positions; } } } </script> <style> </style>
正文
09-Cesium实体Polylinevolume
文章版权声明:除非注明,否则均为
譬如朝露_策温技术开发工作室博客原创文章,转载或复制请以超链接形式并注明出处。
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接