| | |
| | | <el-input v-model="form.face" placeholder="请输入朝向" style="width:90%;"/> |
| | | <i class="el-icon-map-location" @click="gettiles3dCam" title="预览"></i> |
| | | </el-form-item> |
| | | <el-form-item label="海拔高度" prop="altitude"> |
| | | <el-input v-model="form.altitude" placeholder="请输入海拔高度" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | <template slot="cesium"> |
| | |
| | | this.$refs.cesiumMapSelctPoint.showPickPoint({ |
| | | longitude: +this.form.longitude, |
| | | latitude: +this.form.latitude, |
| | | height: +this.form.height, |
| | | deviceHeight: +this.form.deviceHeight, |
| | | }) |
| | | console.log(this.modelListData) |
| | | let url = this.modelListData.filter(item=>item.id == this.form.modelId)[0].modelRoute |
| | | console.log(url) |
| | | this.modelUrl = url |
| | | const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.height); |
| | | const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.deviceHeight); |
| | | console.log(position) |
| | | // 设置模型方向(可选) |
| | | let model = viewer.entities.getById("MyModel"); |
| | |
| | | console.log(data) |
| | | this.$set(this.form, 'longitude', data.longitude) |
| | | this.$set(this.form, 'latitude', data.latitude) |
| | | this.$set(this.form, 'height', data.altitude) |
| | | this.$set(this.form, 'deviceHeight', data.altitude) |
| | | this.$refs.form.validateField('longitude') |
| | | this.$refs.form.validateField('latitude') |
| | | this.$refs.form.validateField('height') |
| | | this.$refs.form.validateField('deviceHeight') |
| | | }, |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | console.log(this.form) |
| | | this.form.longitude = Number(this.form.longitude) |
| | | this.form.latitude = Number(this.form.latitude) |
| | | this.form.height = Number(this.form.height) |
| | | this.form.deviceHeight = Number(this.form.deviceHeight) |
| | | this.form.face = Number(this.form.face) |
| | | this.form.altitude = Number(this.form.altitude) || 0 |
| | | if (valid) { |
| | | this.$api.save('tower/device/', 'id', Object.assign({}, this.form)).then(res => { |
| | | this.form = {} |
| | |
| | | this.$message.error("请输入纬度"); |
| | | return; |
| | | } |
| | | if (!this.form.height) { |
| | | if (!this.form.deviceHeight) { |
| | | this.$message.error("请输入高度"); |
| | | return; |
| | | } |
| | | //动态经纬度朝向 加载模型位置预览 |
| | | // const position = Cesium.Cartesian3.fromDegrees(0, 0, 0); |
| | | const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.height); |
| | | const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.deviceHeight); |
| | | // 设置模型方向(可选) |
| | | // const heading = Cesium.Math.toRadians(135); // 朝东南方向 |
| | | let model = viewer.entities.getById("MyModel"); |