| | |
| | | hover:file:bg-blue-100"> |
| | | <CesiumMap style="height: 790px;" :showAnimation = true :showCesiumCompass = true :cesiumId="'cesiumContainer'"></CesiumMap> |
| | | <CesiumMap style="height: 324px;width: 576px;" :showAnimation = false :showCesiumCompass = false :showCrosshair = true :cesiumId="'cesiumContainerYY'" class="eagleye"></CesiumMap> |
| | | <!-- 使用 ElementUI 的 Slider 替代变倍轴 --> |
| | | <div class="zoom-ui-container"> |
| | | <!-- 中间黄色准星框 --> |
| | | <div |
| | | class="reticle" |
| | | :style="{ width: boxWidth + 'px', height: boxHeight + 'px' }" |
| | | ></div> |
| | | <!-- 左下角倍率信息 --> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | roll: 0, // 相机的 roll (滚转) |
| | | aspectRatio: 1.0, // 纵横比 |
| | | color: '#FF0000', // 视锥体颜色 |
| | | id: 'frustumOutline', |
| | | id: 'frustumOutline',//视锥体ID |
| | | positionProperty : new Cesium.SampledPositionProperty(), |
| | | orientation : new Cesium.SampledProperty(Cesium.Quaternion),//无人机朝向 |
| | | // sztOrientation : new Cesium.SampledProperty(Cesium.Quaternion),//云台朝向 |
| | |
| | | holderPitchProperty : new Cesium.SampledProperty(Number),//云台朝向pitch |
| | | holderRollProperty : new Cesium.SampledProperty(Number),//云台朝向roll |
| | | holderZoomProperty : new Cesium.SampledProperty(Number),//变倍 |
| | | currentZoom:1, |
| | | filename :'' |
| | | currentZoom:1,//视锥体变倍 |
| | | filename :'',//文件名字 然后读取时间轴日期 |
| | | zoomRatio: 1,//默认变倍数 |
| | | minZoom: 1,//最小变倍 |
| | | maxZoom: 56,//最大变倍 |
| | | baseBoxSize: 576,//默认box宽度 |
| | | } |
| | | }, |
| | | mounted() { |
| | | }, |
| | | computed: { |
| | | boxWidth() { |
| | | return this.baseBoxSize / this.zoomRatio; |
| | | }, |
| | | boxHeight() { |
| | | return (this.baseBoxSize *(9/16)) / this.zoomRatio; // 高度保持 4:3 比例 |
| | | } |
| | | }, |
| | | methods: { |
| | | async handleKMZUpload(event) { |
| | |
| | | setTimeout(()=>{ |
| | | this.showGZ() |
| | | },1000) |
| | | this.flyPoint() |
| | | }, |
| | | flyPoint(){ |
| | | let lon = this.waypoints[0].lng |
| | | let lat = this.waypoints[0].lat |
| | | let height = 5000 |
| | | window['cesiumContainer'].viewer.camera.flyTo({ |
| | | destination : Cesium.Cartesian3.fromDegrees(lon, lat, height) |
| | | }); |
| | | }, |
| | | // 读取文件为ArrayBuffer |
| | | readFileAsArrayBuffer(file) { |
| | |
| | | const holderZoom = this.holderZoomProperty.getValue(currentTime) |
| | | if(holderZoom) { |
| | | this.currentZoom = holderZoom ==1? 1 :(holderZoom /23.76237623) |
| | | this.zoomRatio = holderZoom ==1? 1 :(holderZoom /23.76237623) |
| | | } |
| | | |
| | | this.updateFrustum(); |
| | |
| | | .eagleye{ |
| | | position: absolute; |
| | | right: 30px; |
| | | bottom: 50px; |
| | | bottom: 55px; |
| | | border: 1px solid white; |
| | | } |
| | | </style> |
| | | <style scoped> |
| | | .zoom-ui-container { |
| | | width: 576px; |
| | | height: 324px; |
| | | position: absolute; |
| | | right: 30px; |
| | | bottom: 55px; |
| | | /* background-color: red; */ |
| | | z-index: 9; |
| | | |
| | | } |
| | | /* 黄色准星框 */ |
| | | .reticle { |
| | | position: absolute; |
| | | left: 50%; |
| | | top: 50%; |
| | | border: 2px dashed orange; |
| | | transform: translate(-50%, -50%); |
| | | pointer-events: none; |
| | | } |
| | | |
| | | /* ElementUI 滑块样式区域 */ |
| | | .zoom-bar-slider { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 50px; |
| | | height: 200px; |
| | | } |
| | | |
| | | /* 左下角倍率标签 */ |
| | | .zoom-info { |
| | | position: absolute; |
| | | bottom: 35px; |
| | | left: 340px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="完成动作" prop="finishAction"> |
| | | <el-select v-model="ruleForm.finishAction" placeholder="起飞爬升"> |
| | | <el-select v-model="ruleForm.finishAction" placeholder="完成动作"> |
| | | <el-option v-for="dict in dji_finish_type" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"></el-option> |
| | | </el-select> |
| | |
| | | deviceId:null, |
| | | drawer:false, |
| | | ruleForm:{ |
| | | autoFlightSpeed:14, |
| | | globalTransitionalSpeed:15 |
| | | flyToWaylineMode:'safely', |
| | | autoFlightSpeed:10, |
| | | globalTransitionalSpeed:10, |
| | | globalWaypointTurnMode:'toPointAndStopWithDiscontinuityCurvature', |
| | | mappingHeadingMode:'followWayline', |
| | | gimbalPitchMode:'usePointSetting', |
| | | finishAction:'goHome', |
| | | }, |
| | | |
| | | } |
| | |
| | | height: airPoint.height, |
| | | isStartAndEndPoint: false, |
| | | actions:airPoint.children[0].actions || [], |
| | | waypointName: airPoint.label, |
| | | coordinatePointReq: { |
| | | height: airPoint.children[0].height, |
| | | latitude:airPoint.children[0].latitude, |
| | |
| | | this.ruleForm.routePointList = routePointList |
| | | console.log(this.ruleForm) |
| | | console.log('生成航线') |
| | | buildKmz(this.ruleForm).then(res=>{ |
| | | if(res.code == 200) { |
| | | this.$message({ |
| | | message: '生成航线成功', |
| | | type: 'success' |
| | | }) |
| | | const link = document.createElement('a'); |
| | | link.href = res.msg; // 设置下载链接 |
| | | // link.download = 'filename.ext'; // 可选:指定文件名 |
| | | document.body.appendChild(link); // 将链接添加到 DOM |
| | | link.click(); // 模拟点击下载 |
| | | document.body.removeChild(link); // 下载后移除链接 |
| | | } |
| | | }) |
| | | // buildKmz(this.ruleForm).then(res=>{ |
| | | // if(res.code == 200) { |
| | | // this.$message({ |
| | | // message: '生成航线成功', |
| | | // type: 'success' |
| | | // }) |
| | | // const link = document.createElement('a'); |
| | | // link.href = res.msg; // 设置下载链接 |
| | | // // link.download = 'filename.ext'; // 可选:指定文件名 |
| | | // document.body.appendChild(link); // 将链接添加到 DOM |
| | | // link.click(); // 模拟点击下载 |
| | | // document.body.removeChild(link); // 下载后移除链接 |
| | | // } |
| | | // }) |
| | | }, |
| | | lineSet(){ |
| | | this.drawer =true |