| | |
| | | <el-form-item> |
| | | <el-button |
| | | size="small" |
| | | v-if="$store.state.previewLayer.type =='mpt'" |
| | | @click="setcropping" |
| | | >裁剪</el-button> |
| | | <el-button |
| | | size="small" |
| | | v-if="$store.state.previewLayer.type !='mpt'" |
| | | @click="locateTo" |
| | | >定位</el-button> |
| | | <el-button |
| | | size="small" |
| | | v-if="$store.state.previewLayer.type !='mpt'" |
| | | @click="showTileset" |
| | | >显隐</el-button> |
| | | <el-button |
| | | size="small" |
| | | @click="underground" |
| | | v-if="$store.state.previewLayer.type !='mpt'" |
| | | @click="setUndergroundMode" |
| | | >地下</el-button> |
| | | <el-button |
| | | v-if="$store.state.previewLayer.type != '3dml' && |
| | | $store.state.previewLayer.type !='cpt'" |
| | | size=" |
| | | small" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | size="small" |
| | | @click="pickupCoords" |
| | | >拾取</el-button> |
| | | <el-button |
| | | v-if="$store.state.previewLayer.type != '3dml' && |
| | | $store.state.previewLayer.type !='cpt'" |
| | | size=" |
| | | small" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | size="small" |
| | | @click="reload" |
| | | > |
| | | 重载 |
| | | </el-button> |
| | | <el-button |
| | | v-if="modelForm.modelid == null && $store.state.previewLayer.type != '3dml'&& |
| | | $store.state.previewLayer.type !='cpt'" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | size="small" |
| | | @click="getModeKeyId" |
| | | >模型主键</el-button> |
| | | <el-button |
| | | v-if="$store.state.previewLayer.type != '3dml'&& |
| | | $store.state.previewLayer.type !='cpt'" |
| | | $store.state.previewLayer.type !='cpt' |
| | | " |
| | | size="small" |
| | | @click="resave" |
| | | >保存</el-button> |
| | |
| | | <el-form-item |
| | | label="经度:" |
| | | v-if="$store.state.previewLayer.type != '3dml'&& |
| | | $store.state.previewLayer.type !='cpt'" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="modelForm.lon" |
| | | @input="update" |
| | | ></el-input> |
| | | <el-slider |
| | | v-model="modelForm.lon" |
| | | @input="update" |
| | | :min="73" |
| | | :step="0.001" |
| | | :max="135" |
| | | ></el-slider> |
| | | |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="纬度:" |
| | | v-if="$store.state.previewLayer.type != '3dml'&& |
| | | $store.state.previewLayer.type !='cpt'" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="modelForm.lat" |
| | | @input="update" |
| | | ></el-input> |
| | | <el-slider |
| | | v-model="modelForm.lat" |
| | | @input="update" |
| | | :min="3" |
| | | :step="0.001" |
| | | :max="54" |
| | | ></el-slider> |
| | | |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="高度:" |
| | | v-if="$store.state.previewLayer.type != '3dml'&& |
| | | $store.state.previewLayer.type !='cpt'" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="modelForm.height" |
| | | @input="update" |
| | | ></el-input> |
| | | <el-slider |
| | | v-model="modelForm.height" |
| | | :min="-800" |
| | | :step="1" |
| | | @input="update" |
| | | :max="8800" |
| | | ></el-slider> |
| | | |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="角度:" |
| | | v-if="$store.state.previewLayer.type != '3dml'&& |
| | | $store.state.previewLayer.type !='cpt'" |
| | | $store.state.previewLayer.type !='cpt'&& |
| | | $store.state.previewLayer.type !='mpt'" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="modelForm.yaw" |
| | | @input="update" |
| | | ></el-input> |
| | | <el-slider |
| | | v-model="modelForm.yaw" |
| | | :min="0" |
| | | @input="update" |
| | | :step="0.1" |
| | | :max="360" |
| | | ></el-slider> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="透明度:"> |
| | | <!-- <el-form-item label="透明度:"> |
| | | <el-input |
| | | size="small" |
| | | v-model="modelForm.alpha" |
| | | @input="update" |
| | | ></el-input> |
| | | <el-slider |
| | | v-model="modelForm.alpha" |
| | | @input="update" |
| | | :min="0" |
| | | :step="0.01" |
| | | :max="1" |
| | | ></el-slider> |
| | | </el-form-item> |
| | | |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | |
| | | info: '', |
| | | icon: '', |
| | | bak: '', |
| | | Id: '' |
| | | Id: '', |
| | | |
| | | }, |
| | | options: [ |
| | | { |
| | |
| | | isJpg: false, |
| | | src: '' |
| | | }, |
| | | modelType: ['ifc', 'fbx', 'rvt', '3dml', 'cpt'], |
| | | modelType: ['ifc', 'fbx', 'rvt', '3dml', 'cpt', 'osgb', 'las', 'laz'], |
| | | editModelFlag: false, |
| | | modelForm: { |
| | | lon: 119, |
| | |
| | | yaw: 0, |
| | | alpha: 1, |
| | | modelid: null, |
| | | west: null, |
| | | south: null, |
| | | east: null, |
| | | north: null, |
| | | }, |
| | | app: { |
| | | tileset: null, |
| | |
| | | this.init3DMap(); |
| | | }, |
| | | methods: { |
| | | //裁剪 |
| | | setcropping() { |
| | | var that = this; |
| | | sgworld.Creator.SimpleGraphic.clear() |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | sgworld.Creator.createSimpleGraphic( |
| | | "rectangle", {}, |
| | | function (entity) { |
| | | that.modelForm.east = Cesium.Math.toDegrees( |
| | | entity.rectangle.coordinates.getValue().east |
| | | ); |
| | | that.modelForm.north = Cesium.Math.toDegrees( |
| | | entity.rectangle.coordinates.getValue().north |
| | | ); |
| | | that.modelForm.west = Cesium.Math.toDegrees( |
| | | entity.rectangle.coordinates.getValue().west |
| | | ); |
| | | that.modelForm.south = Cesium.Math.toDegrees( |
| | | entity.rectangle.coordinates.getValue().south |
| | | ); |
| | | |
| | | } |
| | | ); |
| | | }, |
| | | setUndergroundMode() { |
| | | if (window.UndergroundMode) { |
| | | this.$refs && |
| | |
| | | new Cesium.Cesium3DTileset({ |
| | | name: rs.cnName, |
| | | url: url, //192.168.20.106,to4 |
| | | maximumScreenSpaceError: 64, // 最大屏幕空间错误:16 |
| | | maximumScreenSpaceError: url.indexOf("/pnts/") > -1 ? 16 : 64, // 最大屏幕空间错误:16 |
| | | maximumMemoryUsage: 768, // 最大内存:512 |
| | | dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false |
| | | skipLevelOfDetail: true, // 在遍历时候跳过详情:false |
| | |
| | | var res = this.$store.state.previewLayer; |
| | | var type = res.type; |
| | | res.ulr = res.url.replace("{host}", iisHost); |
| | | |
| | | if (type == 'DEM') { |
| | | window.terrainLayer.deleteObject(); |
| | | // Viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider(); |
| | | // window.terrainLayer = null; |
| | | |
| | | window.terrainLayer = null; |
| | | window.terrainLayer = new Cesium.CesiumTerrainProvider({ |
| | | url: res.url |
| | | }); |
| | |
| | | roll: 0.0 |
| | | } |
| | | });*/ |
| | | |
| | | var wkt = this.$wkt.parse(res.geom); |
| | | var height = this.getHeight(wkt.coordinates[2]); |
| | | Viewer.camera.flyTo({ |
| | |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], height), |
| | | }); |
| | | } else if (type == '3dml' || type == 'fbx' || type == 'ifc' || type == 'rvt' || type == 'cpt') { |
| | | } else if (type == '3dml' || type == 'fbx' || type == 'ifc' || type == 'rvt' |
| | | || type == 'cpt' || type == 'osgb' || type == 'las' || type == 'laz') { |
| | | if (this.app.tileset) viewer.scene.primitives.remove(this.app.tileset); |
| | | |
| | | this.app.tileset = this.createTileset(res); |
| | | var that = this; |
| | | |
| | | this.editModelFlag = true; |
| | | Viewer.scene.primitives.add(this.app.tileset).readyPromise.then(function (ts) { |
| | | |
| | | that.setModleLocatin() |
| | |
| | | }); |
| | | |
| | | } else if (res.url.indexOf('.mpt') != -1) { |
| | | this.editModelFlag = true; |
| | | |
| | | Viewer.imageryLayers.removeAll(); |
| | | var url = res.url.split(';') |
| | | sgworld.Creator.createImageryProvider('mpt影像', "wms", { |
| | | |
| | | var ops = { |
| | | url: url[0], |
| | | layers: url[1] |
| | | }, "0", undefined, true, ""); |
| | | } |
| | | if (res.json && JSON.parse(res.json).west) { |
| | | var val = JSON.parse(res.json) |
| | | |
| | | ops.rectangle = Cesium.Rectangle.fromDegrees(val.west, val.south, val.east, val.north) |
| | | } |
| | | sgworld.Creator.createImageryProvider('mpt影像', "wms", ops, "0", undefined, true, ""); |
| | | |
| | | |
| | | |
| | | |
| | | } else if (res.url.indexOf('menuLayer') != -1) { |
| | | this.setShowModelLayer(); |
| | | } |
| | |
| | | }, |
| | | |
| | | async resave() { |
| | | if (!this.modelForm.modelid) { |
| | | return this.$message('未选择模型主键ID'); |
| | | |
| | | if (this.$store.state.previewLayer.type != "mpt") { |
| | | if (!this.modelForm.modelid) { |
| | | return this.$message('未选择模型主键ID'); |
| | | } |
| | | } else { |
| | | sgworld.Creator.SimpleGraphic.clear() |
| | | } |
| | | |
| | | this.$store.state.previewLayer.json = JSON.stringify(this.modelForm); |
| | | |
| | | if (this.$store.state.previewLayer.url) { |
| | |
| | | this.reload(); |
| | | }, |
| | | reload() { |
| | | sgworld.Analysis.UndergroundMode(this.app.under, this.modelForm.alpha) |
| | | var json = JSON.stringify(this.modelForm); |
| | | var url = this.$store.state.previewLayer.url.replace("{host}", iisHost); |
| | | if (!url) return; |
| | |
| | | that.modelForm.lat = y; |
| | | that.modelForm.height = z; |
| | | that.pickupCoords(); |
| | | that.reload(); |
| | | |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }, |
| | | // 保留小数位 |
| | |
| | | return Math.round(d * p) / p; |
| | | }, |
| | | update() { |
| | | if (!this.modelForm.lon || isNaN(this.modelForm.lon)) { |
| | | var args = this.getEditTilesetArgs(); |
| | | this.modelForm.lon = args.lon == null ? 0 : args.height; |
| | | return |
| | | } |
| | | if (!this.modelForm.lat || isNaN(this.modelForm.lat)) { |
| | | var args = this.getEditTilesetArgs(); |
| | | this.modelForm.lat = args.lat == null ? 0 : args.height; |
| | | return |
| | | } |
| | | if (!this.modelForm.height || isNaN(this.modelForm.height)) { |
| | | var args = this.getEditTilesetArgs(); |
| | | this.modelForm.height = args.height == null ? 0 : args.height; |
| | | return |
| | | } |
| | | if (!this.modelForm.yaw || isNaN(this.modelForm.yaw)) { |
| | | this.modelForm.yaw = 0; |
| | | return |
| | | } |
| | | // if (!this.modelForm.alpha || isNaN(this.modelForm.alpha)) { |
| | | |
| | | // if (this.app.under) { |
| | | // |
| | | // this.modelForm.alpha = sgworld._Analysis._UndergroundMode._alpha; |
| | | // } else { |
| | | // this.modelForm.alpha = 1 |
| | | // } |
| | | // if (!this.modelForm.lon || isNaN(this.modelForm.lon)) { |
| | | // var args = this.getEditTilesetArgs(); |
| | | // this.modelForm.lon = args.lon == null ? 0 : args.height; |
| | | // return |
| | | |
| | | // } |
| | | // if (!this.modelForm.lat || isNaN(this.modelForm.lat)) { |
| | | // var args = this.getEditTilesetArgs(); |
| | | // this.modelForm.lat = args.lat == null ? 0 : args.height; |
| | | // return |
| | | // } |
| | | // if (!this.modelForm.height || isNaN(this.modelForm.height)) { |
| | | // var args = this.getEditTilesetArgs(); |
| | | // this.modelForm.height = args.height == null ? 0 : args.height; |
| | | // return |
| | | // } |
| | | // if (!this.modelForm.yaw || isNaN(this.modelForm.yaw)) { |
| | | // this.modelForm.yaw = 0; |
| | | // return |
| | | // } |
| | | |
| | | this.setTilesetArgs(this.modelForm); |
| | | sgworld.Analysis.UndergroundMode(this.app.under, this.modelForm.alpha) |
| | | }, |
| | |
| | | }, |
| | | //显隐 |
| | | showTileset() { |
| | | |
| | | if (!this.app.tileset) return; |
| | | this.app.tileset.show = !this.app.tileset.show; |
| | | }, |
| | |
| | | name: 'tsTest', |
| | | skipLevelOfDetail: true, // 在遍历时候跳过详情:false |
| | | baseScreenSpaceError: 1024, |
| | | maximumScreenSpaceError: 64, // 最大屏幕空间错误:16,数值加大能让最终成像变模糊 |
| | | maximumScreenSpaceError: res.url.indexOf("/pnts/") > -1 ? 16 : 64, // 最大屏幕空间错误:16,数值加大能让最终成像变模糊 |
| | | skipScreenSpaceErrorFactor: 16, |
| | | skipLevels: 1, |
| | | immediatelyLoadDesiredLevelOfDetail: false, |
| | |
| | | }); |
| | | }, |
| | | setEditModelLayer(res) { |
| | | this.editModelFlag = true; |
| | | |
| | | if (res.json) { |
| | | |
| | | var json = JSON.parse(res.json) |
| | | this.modelForm = json; |
| | | this.reload(); |
| | |
| | | setModleLocatin() { |
| | | var res = this.$store.state.previewLayer; |
| | | var type = res.type; |
| | | |
| | | if (this.modelType.indexOf(type) != -1) { |
| | | if (type != '3dml') { |
| | | this.setEditModelLayer(res) |