| | |
| | | window.pickedFeature = sgworld.Viewer.scene.pick(event.position); |
| | | if (Cesium.defined(window.pickedFeature)) { |
| | | if (window.pickedFeature.primitive instanceof Cesium.Cesium3DTileset) { |
| | | if (window.pickedFeature && window.pickedFeature.getProperty) { |
| | | if (window.pickedFeature) { |
| | | window.pickedColor = window.pickedFeature.color |
| | | window.pickedFeature.color = Cesium.Color.RED.withAlpha(0.3); |
| | | |
| | |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK) |
| | | }, |
| | | async setModelInfoData(result) { |
| | | var modelKey = 'id' |
| | | if (result.tileset.pubid > 0) { |
| | | const data = await comprehensive_selectPubById({ id: result.tileset.pubid }) |
| | | if (data.code != 200) { |
| | | return |
| | | } else { |
| | | var modelKey = 'id'; |
| | | debugger |
| | | var modelid; |
| | | if (result.tileset) { |
| | | if (result.tileset.pubid > 0) { |
| | | |
| | | modelKey = JSON.parse(data.result.json).modelid |
| | | const data = await comprehensive_selectPubById({ id: result.tileset.pubid }) |
| | | if (data.code != 200) { |
| | | return |
| | | } else { |
| | | debugger |
| | | modelKey = JSON.parse(data.result.json).modelid |
| | | } |
| | | if (!modelKey) { |
| | | return this.$message('没有模型主键ID,无法查询数据'); |
| | | } |
| | | modelid = pickedFeature.getProperty(modelKey); |
| | | } |
| | | if (!modelKey) { |
| | | return this.$message('没有模型主键ID,无法查询数据'); |
| | | } |
| | | } else { |
| | | modelid = '3dml' + result.primitive.id; |
| | | } |
| | | var that = this |
| | | |
| | | var obj = { |
| | | layerid: pickedFeature.primitive.layerId, |
| | | modelid: pickedFeature.getProperty(modelKey) |
| | | modelid: modelid |
| | | } |
| | | |
| | | const data1 = await comprehensive_selectModelByGuid(obj); |
| | |
| | | } |
| | | |
| | | that.$store.state.catModelInfo = { |
| | | id: pickedFeature.getProperty(modelKey), |
| | | id: modelid, |
| | | name: name, |
| | | type: type, |
| | | bak: bak, |
| | |
| | | }, |
| | | //定位 |
| | | setCoordLocal() { |
| | | var lon = parseFloat(this.coordFrom.lon); |
| | | var lat = parseFloat(this.coordFrom.lat); |
| | | var height = parseFloat(this.coordFrom.height); |
| | | var lon = parseFloat(this.coordFrom.lon) |
| | | var lat = parseFloat(this.coordFrom.lat) |
| | | var height = parseFloat(this.coordFrom.height) == NaN ? parseFloat(this.coordFrom.height) : 100; |
| | | |
| | | var position = { |
| | | X: lon, |
| | | Y: lat, |