| | |
| | | props: ['areaLayer'], |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'viewer', |
| | | 'viewerExist', |
| | | // 校区内导航的显示关闭 |
| | | 'campusNavFlag', |
| | | 'orgNavBarFlag', |
| | |
| | | created () { |
| | | }, |
| | | watch: { |
| | | viewer: { |
| | | viewerExist: { |
| | | immediate: true, |
| | | handler (newCode, oldCode) { |
| | | if (this.titlesetLayerFlag == false && newCode != null) { |
| | | if (this.titlesetLayerFlag == false && newCode == true) { |
| | | var that = this |
| | | |
| | | that.tilesetLayer = new global.DC.TilesetLayer('tilesetLayer') |
| | | that.viewer.addLayer(that.tilesetLayer) |
| | | global.viewer.addLayer(that.tilesetLayer) |
| | | that.tileset = new global.DC.Tileset('/mx/tileset.json', { |
| | | luminanceAtZenith: 0.3, |
| | | shadows: global.DC.Namespace.Cesium.ShadowMode.DISABLED |
| | |
| | | that.silhouetteBlue.uniforms.length = 0.01 |
| | | that.silhouetteBlue.selected = [] |
| | | |
| | | that.viewer.scene.postProcessStages.add( |
| | | global.viewer.scene.postProcessStages.add( |
| | | global.DC.Namespace.Cesium.PostProcessStageLibrary.createSilhouetteStage( |
| | | [that.silhouetteBlue] |
| | | ) |
| | | ) |
| | | |
| | | that.viewer.imageryLayers.addImageryProvider( |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36', |
| | | subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | |
| | | }) |
| | | ) |
| | | |
| | | that.viewer.imageryLayers.addImageryProvider( |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36', |
| | | subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | |
| | | }) |
| | | ) |
| | | |
| | | // that.viewer.imageryLayers.addImageryProvider( |
| | | // global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | | // url: ' http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36', |
| | | // type: 'wmts', |
| | |
| | | // }) |
| | | // ) |
| | | |
| | | // that.viewer.imageryLayers.addImageryProvider( |
| | | // global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | | // url: ' http://t1.tianditu.gov.cn/cva_w/wmts?tk=9ae78c51a0a28f06444d541148496e36', |
| | | // type: 'wmts', |
| | |
| | | } |
| | | |
| | | const videoLayer = new global.DC.CameraVideoLayer('video-layer').addTo( |
| | | that.viewer |
| | | global.viewer |
| | | ) |
| | | |
| | | const cameraVideo = new global.DC.CameraVideo( |
| | |
| | | if (that.closeMapClick) { |
| | | return |
| | | } |
| | | that.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | |
| | | if (e.overlay && e.overlay.attr.arcName != null) { |
| | | this.$store.commit('CLEAR_ALL', null) |
| | |
| | | |
| | | // 定制化窗体 |
| | | // eslint-disable-next-line no-unused-vars |
| | | var popup = new global.DC.DivForms(that.viewer, { |
| | | var popup = new global.DC.DivForms(global.viewer, { |
| | | domId: 'divFormsDomBox', |
| | | position: [ |
| | | global.DC.Transform.transformWGS84ToCartesian( |
| | |
| | | } |
| | | }) |
| | | |
| | | this.viewer.flyToPosition( |
| | | global.viewer.flyToPosition( |
| | | new global.DC.Position( |
| | | Number(e.wgs84Position.lng + 0.00070806), |
| | | Number(e.wgs84Position.lat - 0.00261205), |
| | |
| | | fileExtension: 'png' |
| | | }) |
| | | |
| | | // that.baseLayer = that.viewer.imageryLayers.addImageryProvider(baseProvider) |
| | | // that.baseLayer = global.viewer.imageryLayers.addImageryProvider(baseProvider) |
| | | that.newLayer = |
| | | that.viewer.imageryLayers.addImageryProvider(provider) |
| | | global.viewer.imageryLayers.addImageryProvider(provider) |
| | | |
| | | that.wallLayer = new global.DC.VectorLayer('wallLayer') |
| | | // that.viewer.addLayer(that.wallLayer) |
| | | // global.viewer.addLayer(that.wallLayer) |
| | | |
| | | that.wallArr.forEach((item) => { |
| | | item = item.join(',') |
| | |
| | | }) |
| | | // that.wallLayer.addOverlay(wall) |
| | | |
| | | // that.viewer.camera.setView({ |
| | | // global.viewer.camera.setView({ |
| | | // // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | // destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(114.03928791, 27.62954732, 400.0), |
| | |
| | | // }) |
| | | |
| | | // setTimeout(() => { |
| | | // that.viewer.camera.flyTo({ |
| | | // global.viewer.camera.flyTo({ |
| | | // // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | // destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(114.0351, 27.6314, 200.0), |
| | | // duration: 5, |
| | | // complete: () => { |
| | | // that.viewer.camera.flyTo({ |
| | | // global.viewer.camera.flyTo({ |
| | | // // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | // destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(114.0351, 27.6314, 200.0), |
| | |
| | | // }, 400) |
| | | that.titlesetLayerFlag = true |
| | | |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | |
| | | }) |
| | | |
| | | // 最小 |
| | | that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220 |
| | | global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220 |
| | | // 最大 |
| | | that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400 |
| | | global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400 |
| | | |
| | | // 设置相机缩小时的速率 |
| | | that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000 |
| | | global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000 |
| | | // 设置相机放大时的速率 |
| | | that.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000 |
| | | global.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000 |
| | | // 视角平移 |
| | | that.viewer.scene.screenSpaceCameraController.enableRotate = true |
| | | global.viewer.scene.screenSpaceCameraController.enableRotate = true |
| | | // 视角缩放 |
| | | that.viewer.scene.screenSpaceCameraController.enableZoom = true |
| | | global.viewer.scene.screenSpaceCameraController.enableZoom = true |
| | | // 视角旋转 |
| | | that.viewer.scene.screenSpaceCameraController.enableTilt = false |
| | | global.viewer.scene.screenSpaceCameraController.enableTilt = false |
| | | |
| | | axios |
| | | .get( |
| | |
| | | color: undefined |
| | | } |
| | | |
| | | that.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) => { |
| | | global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) => { |
| | | if (that.closeMapClick) { |
| | | return |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | that.viewer.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | global.viewer.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | if (that.closeMapClick) { |
| | | return |
| | | } |
| | |
| | | : e.overlay.attr['楼栋号'] |
| | | this.$store.commit('CLEAR_ALL', null) |
| | | getDetail({ mechanismname: '香琴湾' + rid }).then((res) => { |
| | | that.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | var result = res.data.data |
| | | |
| | | var imgArr = result.tpurl.split(',') |
| | |
| | | |
| | | // 定制化窗体 |
| | | // eslint-disable-next-line no-unused-vars |
| | | var popup = new global.DC.DivForms(that.viewer, { |
| | | var popup = new global.DC.DivForms(global.viewer, { |
| | | domId: 'divFormsDomBox', |
| | | position: [ |
| | | global.DC.Transform.transformWGS84ToCartesian( |
| | |
| | | this.$store.commit('SET_DETAILSPOPUP', true) |
| | | }) |
| | | |
| | | this.viewer.flyToPosition( |
| | | global.viewer.flyToPosition( |
| | | new global.DC.Position( |
| | | Number(e.wgs84Position.lng), |
| | | Number(e.wgs84Position.lat), |
| | |
| | | document.querySelector('.dc-zoom-controller').children[1].onclick = |
| | | function () { |
| | | if (that.dimensionValue == '真三维') { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | |
| | | that.dimensionValue != '真三维' |
| | | ) { |
| | | const height = Math.ceil( |
| | | that.viewer.camera.positionCartographic.height |
| | | global.viewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | if (height <= 250) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 280 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 250 && height <= 310) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 340 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 310 && height < 370) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 400 |
| | | ), |
| | | orientation: { |
| | |
| | | that.dimensionValue != '真三维' |
| | | ) { |
| | | const height = Math.ceil( |
| | | that.viewer.camera.positionCartographic.height |
| | | global.viewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | if (height > 370) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 340 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 310) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 280 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 250) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: |
| | | global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 220 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | } |
| | | |
| | | that.viewer.on(global.DC.SceneEventType.CAMERA_CHANGED, () => { |
| | | global.viewer.on(global.DC.SceneEventType.CAMERA_CHANGED, () => { |
| | | if ( |
| | | that.dimensionValue != undefined && |
| | | that.dimensionValue != '真三维' |
| | | ) { |
| | | const height = Math.ceil( |
| | | that.viewer.camera.positionCartographic.height |
| | | global.viewer.camera.positionCartographic.height |
| | | ) |
| | | |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | |
| | | }) |
| | | |
| | | if (height <= 250) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 220 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 250 && height <= 310) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 280 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 310 && height <= 370) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 340 |
| | | ), |
| | | orientation: { |
| | |
| | | } |
| | | |
| | | if (height > 370) { |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | that.viewer.camera.positionCartographic.longitude, |
| | | that.viewer.camera.positionCartographic.latitude, |
| | | global.viewer.camera.positionCartographic.longitude, |
| | | global.viewer.camera.positionCartographic.latitude, |
| | | 400 |
| | | ), |
| | | orientation: { |
| | |
| | | }, |
| | | methods: { |
| | | // openPopups(lng, lat, alt) { |
| | | // var popup = new global.DC.DivForms(that.viewer, { |
| | | // var popup = new global.DC.DivForms(global.viewer, { |
| | | // domId: "divFormsDomBox", |
| | | // position: [ |
| | | // global.DC.Transform.transformWGS84ToCartesian( |
| | |
| | | if (that.dimensionValue == '真三维') { |
| | | // that.wallLayer.show = false |
| | | that.areaLayer.show = false |
| | | that.viewer.imageryLayers.remove(that.newLayer) |
| | | global.viewer.imageryLayers.remove(that.newLayer) |
| | | that.newLayer = null |
| | | // that.viewer.imageryLayers.remove(that.baseLayer) |
| | | // global.viewer.imageryLayers.remove(that.baseLayer) |
| | | that.baseLayer = null |
| | | |
| | | that.silhouetteBlue.selected = [] |
| | | that.tilesetLayer.show = true |
| | | // 最小 |
| | | that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 1.0 |
| | | global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 1.0 |
| | | // 最大 |
| | | that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = |
| | | global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = |
| | | Number.POSITIVE_INFINITY |
| | | // 视角旋转 |
| | | that.viewer.scene.screenSpaceCameraController.enableTilt = true |
| | | global.viewer.scene.screenSpaceCameraController.enableTilt = true |
| | | // 115.877863,28.741661 |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | |
| | | fileExtension: 'png' |
| | | }) |
| | | |
| | | // that.baseLayer = that.viewer.imageryLayers.addImageryProvider(baseProvider) |
| | | that.newLayer = that.viewer.imageryLayers.addImageryProvider(provider) |
| | | // that.baseLayer = global.viewer.imageryLayers.addImageryProvider(baseProvider) |
| | | that.newLayer = global.viewer.imageryLayers.addImageryProvider(provider) |
| | | |
| | | // that.wallLayer.show = true |
| | | |
| | | that.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | |
| | | } |
| | | }) |
| | | // 最小 |
| | | that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220 |
| | | global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220 |
| | | // 最大 |
| | | that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400 |
| | | global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400 |
| | | // 视角旋转 |
| | | that.viewer.scene.screenSpaceCameraController.enableTilt = false |
| | | global.viewer.scene.screenSpaceCameraController.enableTilt = false |
| | | } |
| | | } |
| | | } |