随笔分类 - cesium
摘要:首先安装 canvas2image npm install canvas2image --save 因为项目基于vue,所以需要在canvas2image的最后面 加上 export default Canvas2Image 然后在页面中引入canvas2image.js 重点: 还需要在cesiu
阅读全文
摘要:let startPoint = this.viewer.entities.add( //viewer.entities.add 添加实体的方法 { name: '测量距离', //这个属性跟页面显示的内容没有关系,只是一个属性 position: this.Cesium.Cartesian3.fr
阅读全文
摘要:computed: { handler() { return new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas) } } //获取经纬度的方法 getPosition() { const _this = this //这
阅读全文
摘要:思路: 先输入经纬度,然后判断经纬度的格式,如果格式正确的话 就拿到输入的经纬度 在地球上对应的位置去标点 并且相机的位置中心也飞往该点 先实现标点 相机中心点 showPoints(lng, lat) { // 接受两个参数 lng经度 lat纬度 this.viewer.entities.rem
阅读全文
摘要:1.添加后,删除原图层(多用于切换图源) 先把之前的图层都删除掉 this.viewer.imageryLayers.removeAll() 可以通过 this.viewer.imageryLayers._layer 查看图层的数量 然后添加你的图层 var newSource = this.vie
阅读全文
摘要:删除所有的图层 this.viewer.imageryLayers.removeAll() 删除单个图层 this.viewer.imageryLayers.remove(变量名) 变量名是你在往地球上添加图层时定义的,如: this.zoning = this.viewer.imageryLaye
阅读全文
摘要:如果还不会配置和引入的话,可以去看一下我的这两篇文章 https://www.cnblogs.com/reround/p/11943717.htmlhttps://www.cnblogs.com/reround/p/12020661.html 1.给页面添加一个div#cesiumContainer
阅读全文
摘要:首先安装 html2Canvas 和 jspdf npm i html2canvas -S npm i jspdf -S 然后在vue页面引入 import html2Canvas from 'html2canvas' import JsPDF from 'jspdf' 最后实现: html2Can
阅读全文
摘要:cesium里面没有指南针 需要安装其他的插件: cesium-navigation-es6 npm i cesium-navigation-es6 -S 安装好之后在mainjs里引入 import CesiumNavigation from 'cesium-navigation-es6' 配置一
阅读全文
摘要:computed: { handler() { return new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas) } } 在事件的外面先定义一下 const _this = this (因为在setInputAction
阅读全文
摘要:之前写了一遍博客关于vue+cesium的搭建,后面是在index.html里通过script引入的,但是后面要用到指南针的时候发现指南针没法引入了 之前的链接: https://www.cnblogs.com/reround/p/11943717.html 后来慢慢调试发现原来是cesium的版本
阅读全文
摘要:【可以看我的博客里另外一篇 import引入 ,可以不用script引入】 地址:https://www.cnblogs.com/reround/p/12020661.html 最近做项目要用到cesium,然后参照网上的一些步骤,最后发现报错了,其中有两种错比较多: ① This dependen
阅读全文