| | |
| | | { |
| | | "name": "smart-campus", |
| | | "version": "0.1.0", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "build": "vue-cli-service build", |
| | | "lint": "vue-cli-service lint" |
| | | }, |
| | | "dependencies": { |
| | | "@dvgis/dc-sdk": "^2.5.0", |
| | | "axios": "^0.22.0", |
| | | "core-js": "^3.6.5", |
| | | "echarts": "^5.2.1", |
| | | "element-ui": "^2.15.6", |
| | | "lodash": "^4.17.21", |
| | | "vue": "^2.6.11", |
| | | "vue-axios": "^3.3.7", |
| | | "vue-router": "^3.5.2", |
| | | "vuex": "^3.6.2" |
| | | }, |
| | | "devDependencies": { |
| | | "@vue/cli-plugin-babel": "~4.5.0", |
| | | "@vue/cli-plugin-eslint": "~4.5.0", |
| | | "@vue/cli-plugin-router": "~4.5.0", |
| | | "@vue/cli-plugin-vuex": "~4.5.0", |
| | | "@vue/cli-service": "~4.5.0", |
| | | "@vue/eslint-config-standard": "^5.1.2", |
| | | "babel-eslint": "^10.1.0", |
| | | "eslint": "^6.7.2", |
| | | "eslint-plugin-import": "^2.20.2", |
| | | "eslint-plugin-node": "^11.1.0", |
| | | "eslint-plugin-promise": "^4.2.1", |
| | | "eslint-plugin-standard": "^4.0.0", |
| | | "eslint-plugin-vue": "^6.2.2", |
| | | "node-sass": "^7.0.1", |
| | | "sass-loader": "^8.0.2", |
| | | "script-loader": "^0.7.2", |
| | | "vue-template-compiler": "^2.6.11", |
| | | "compression-webpack-plugin": "^5.0.1" |
| | | }, |
| | | "eslintConfig": { |
| | | "root": true, |
| | | "env": { |
| | | "node": true |
| | | "name": "smart-campus", |
| | | "version": "0.1.0", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "build": "vue-cli-service build", |
| | | "lint": "vue-cli-service lint" |
| | | }, |
| | | "extends": [ |
| | | "plugin:vue/essential", |
| | | "@vue/standard" |
| | | ], |
| | | "parserOptions": { |
| | | "parser": "babel-eslint" |
| | | "dependencies": { |
| | | "@dvgis/dc-sdk": "^2.5.0", |
| | | "axios": "^0.22.0", |
| | | "core-js": "^3.6.5", |
| | | "echarts": "^5.2.1", |
| | | "element-ui": "^2.15.6", |
| | | "lodash": "^4.17.21", |
| | | "vue": "^2.6.11", |
| | | "vue-axios": "^3.3.7", |
| | | "vue-router": "^3.5.2", |
| | | "vuex": "^3.6.2" |
| | | }, |
| | | "rules": { |
| | | "indent": "off", |
| | | "eqeqeq": [ |
| | | "off" |
| | | ] |
| | | } |
| | | }, |
| | | "browserslist": [ |
| | | "> 1%", |
| | | "last 2 versions", |
| | | "not dead" |
| | | ] |
| | | "devDependencies": { |
| | | "@vue/cli-plugin-babel": "~4.5.0", |
| | | "@vue/cli-plugin-eslint": "~4.5.0", |
| | | "@vue/cli-plugin-router": "~4.5.0", |
| | | "@vue/cli-plugin-vuex": "~4.5.0", |
| | | "@vue/cli-service": "~4.5.0", |
| | | "@vue/eslint-config-standard": "^5.1.2", |
| | | "babel-eslint": "^10.1.0", |
| | | "eslint": "^6.7.2", |
| | | "eslint-plugin-import": "^2.20.2", |
| | | "eslint-plugin-node": "^11.1.0", |
| | | "eslint-plugin-promise": "^4.2.1", |
| | | "eslint-plugin-standard": "^4.0.0", |
| | | "eslint-plugin-vue": "^6.2.2", |
| | | "node-sass": "^4.12.0", |
| | | "sass-loader": "^8.0.2", |
| | | "script-loader": "^0.7.2", |
| | | "vue-template-compiler": "^2.6.11", |
| | | "compression-webpack-plugin": "^5.0.1" |
| | | }, |
| | | "eslintConfig": { |
| | | "root": true, |
| | | "env": { |
| | | "node": true |
| | | }, |
| | | "extends": [ |
| | | "plugin:vue/essential", |
| | | "@vue/standard" |
| | | ], |
| | | "parserOptions": { |
| | | "parser": "babel-eslint" |
| | | }, |
| | | "rules": { |
| | | "indent": "off", |
| | | "eqeqeq": [ |
| | | "off" |
| | | ] |
| | | } |
| | | }, |
| | | "browserslist": [ |
| | | "> 1%", |
| | | "last 2 versions", |
| | | "not dead" |
| | | ] |
| | | } |
| | |
| | | name: "mobilemapBox", |
| | | data() { |
| | | return { |
| | | butbut: null, |
| | | DC: "", |
| | | bigPopup: { |
| | | width: 0, |
| | |
| | | // if (height > 2000) { |
| | | // conBack(2000); |
| | | // } |
| | | if (height < 0 && isSet) { |
| | | conBack(0); |
| | | if (height <= 220 && isSet) { |
| | | conBack(220); |
| | | } |
| | | if (height > 4000 && isSet) { |
| | | conBack(4000); |
| | | // if (height > 220 && height <= 280 && isSet) { |
| | | // conBack(280); |
| | | // } |
| | | // if (height > 280 && height <= 340 && isSet) { |
| | | // conBack(340); |
| | | // } |
| | | // if (height > 340 && height <= 400 && isSet) { |
| | | // conBack(400); |
| | | // } |
| | | if (height > 400 && isSet) { |
| | | conBack(400); |
| | | } |
| | | }); |
| | | |
| | | // 按钮事件 |
| | | that.butbut = function () { |
| | | //放大 |
| | | document.querySelector(".dc-zoom-controller").children[0].onclick = |
| | | function () { |
| | | if (that.dimension == "2.5D") { |
| | | const height = Math.ceil( |
| | | viewer.camera.positionCartographic.height |
| | | ); |
| | | |
| | | if (height > 370) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 340 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (height > 310) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 280 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (height > 250) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 220 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | //缩小 |
| | | document.querySelector(".dc-zoom-controller").children[2].onclick = |
| | | function () { |
| | | if (that.dimension == "2.5D") { |
| | | const height = Math.ceil( |
| | | viewer.camera.positionCartographic.height |
| | | ); |
| | | |
| | | if (height <= 250) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 280 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | if (height > 250 && height <= 310) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 340 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | if (height > 310 && height < 370) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 400 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | }; |
| | | |
| | | // 地图点击事件 |
| | | // viewer.on(DC.MouseEventType.CLICK, (e) => { |
| | |
| | | }; |
| | | that.dimension == "2.5D" |
| | | ? doit2( |
| | | [114.03928791, 27.62954732, 360.0], |
| | | [114.03928791, 27.62954732, 220.0], |
| | | // [114.04062292, 27.62666834, 220.0], |
| | | [ |
| | | that.dimensionData.heading, |
| | | that.dimensionData.pitch, |
| | |
| | | } |
| | | |
| | | DC.ready(initViewer); |
| | | setTimeout(() => { |
| | | that.butbut(); |
| | | }, 0); |
| | | }, |
| | | methods: { |
| | | openPopupS(position, lntLat, query) { |
| | |
| | | // 视角旋转 |
| | | state.mviewer.scene.screenSpaceCameraController.enableTilt = true; |
| | | } else if (data == "2.5D") { |
| | | console.log("2.5"); |
| | | state.dimensionData = { |
| | | // 维度镜头数据 |
| | | heading: 0, |
| | | pitch: -90, |
| | | roll: 0, |
| | | // heading: global.DC.Namespace.Cesium.Math.toRadians(-9), |
| | | // pitch: global.DC.Namespace.Cesium.Math.toRadians(-34.54), |
| | | // roll: 0, |
| | | }; |
| | | //取消3D底图 |
| | | state.mviewer.imageryLayers.remove(state.vecLayer); |
| | |
| | | state.startPointFn(); //移动默认视角 |
| | | state.areaLayer.show = true; //绿布 |
| | | //2.5D视角限制 |
| | | state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 0; |
| | | state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 220; |
| | | // 最大 |
| | | state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000; |
| | | state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 400; |
| | | // 设置相机缩小时的速率 |
| | | // state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 30000; |
| | | state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 2000; |
| | | // 设置相机放大时的速率 |
| | | state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000; |
| | | // 视角平移 |
| | |
| | | var lat = position.coords.latitude; |
| | | var lon = position.coords.longitude; |
| | | console.log("成功返回经纬度信息"); |
| | | Message({ |
| | | showClose: true, |
| | | message: |
| | | "成功返回经纬度信息(1)" + |
| | | lon + |
| | | "_" + |
| | | lat + |
| | | "--反应时间:" + |
| | | times(startTime), |
| | | type: "success", |
| | | duration: 0, |
| | | }); |
| | | // Message({ |
| | | // showClose: true, |
| | | // message: |
| | | // "成功返回经纬度信息(1)" + |
| | | // lon + |
| | | // "_" + |
| | | // lat + |
| | | // "--反应时间:" + |
| | | // times(startTime), |
| | | // type: "success", |
| | | // duration: 0, |
| | | // }); |
| | | console.log(lon, lat, "成功"); |
| | | outData([lon, lat]); |
| | | }; |