| | |
| | | <el-radio-group v-model="dimensionValue" |
| | | size="medium" |
| | | @change="dimensionChange"> |
| | | <el-radio-button label="2.5维"></el-radio-button> |
| | | <el-radio-button label="3 维"></el-radio-button> |
| | | <el-radio-button label="三 维"></el-radio-button> |
| | | <el-radio-button label="真三维"></el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | </template> |
| | |
| | | data () { |
| | | return { |
| | | DC: null, |
| | | dimensionValue: '2.5维', |
| | | dimensionValue: '三 维', |
| | | // 建筑2.5D地图 |
| | | newLayer: null, |
| | | baseLayer: null, |
| | |
| | | |
| | | var provider = new that.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: '/wp/{z}/{x}/{y}.png', |
| | | fileExtension: 'png', |
| | | tileHeight: 52, |
| | | tileWidth: 52 |
| | | fileExtension: 'png' |
| | | // minimumLevel: 19 |
| | | }) |
| | | |
| | |
| | | that.newLayer = that.viewer.imageryLayers.addImageryProvider(provider) |
| | | |
| | | that.wallLayer = new that.DC.VectorLayer('wallLayer') |
| | | that.viewer.addLayer(that.wallLayer) |
| | | // that.viewer.addLayer(that.wallLayer) |
| | | |
| | | that.wallArr.forEach(item => { |
| | | item = item.join(',') |
| | |
| | | speed: 10 |
| | | }) |
| | | }) |
| | | that.wallLayer.addOverlay(wall) |
| | | // that.wallLayer.addOverlay(wall) |
| | | |
| | | // that.viewer.camera.setView({ |
| | | // // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | |
| | | that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1000 |
| | | |
| | | // 设置相机缩小时的速率 |
| | | // that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 10000 |
| | | that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 10000 |
| | | // 设置相机放大时的速率 |
| | | that.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000 |
| | | // 视角平移 |
| | |
| | | that.viewer.on(that.DC.MouseEventType.CLICK, e => { |
| | | if (e.overlay != undefined && e.layer.id == 'areaLayer') { |
| | | var rid = e.overlay.attr['楼栋号'] == '8栋' ? '9栋' : e.overlay.attr['楼栋号'] == '9栋' ? '8栋' : e.overlay.attr['楼栋号'] |
| | | this.$store.commit('CLEAR_ALL', null) |
| | | getDetail({ mechanismname: '香琴湾' + rid }).then((res) => { |
| | | that.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | var result = res.data.data |
| | | this.$store.commit('CLEAR_ALL', null) |
| | | |
| | | var imgArr = result.tpurl.split(',') |
| | | |
| | | this.$store.commit('SET_POPUPBGURL', imgArr[0]) |
| | | this.$store.commit('SET_POPUPQRURL', result.codeurl) |
| | | that.$store.commit('SET_POINTPOSITION', [Number(e.wgs84Position.lng), Number(e.wgs84Position.lat), Number(e.wgs84Position.alt), Number(0), Number(0), Number(0)]) |
| | |
| | | this.$store.commit('SET_MONITORPOPUP', false) |
| | | this.$store.commit('SET_DETAILSPOPUP', true) |
| | | }) |
| | | |
| | | this.viewer.flyToPosition( |
| | | new this.DC.Position(Number(e.wgs84Position.lng), Number(e.wgs84Position.lat), 300, Number(0), Number(-90), Number(0)) |
| | | ) |
| | | } |
| | | }) |
| | | |
| | | document.querySelector('.dc-zoom-controller').children[1].onclick = function () { |
| | | if (that.dimensionValue == '3 维') { |
| | | if (that.dimensionValue == '真三维') { |
| | | that.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | |
| | | dimensionChange () { |
| | | var that = this |
| | | that.$store.commit('SET_TWOORTHREE', that.dimensionValue) |
| | | if (that.dimensionValue == '3 维') { |
| | | if (that.dimensionValue == '真三维') { |
| | | // that.wallLayer.show = false |
| | | that.areaLayer.show = false |
| | | that.viewer.imageryLayers.remove(that.newLayer) |