Merge branch 'master' of http://192.168.0.105:10010/r/school-web
| | |
| | | { |
| | | "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" |
| | | ] |
| | | } |
| | |
| | | <mobileActivity></mobileActivity> |
| | | <!-- 盖住左下角 --> |
| | | <div class="cover_mobileMap">智慧社区</div> |
| | | <!-- 指示器 --> |
| | | <!-- <div class="heights">{{ heights }}---{{ heights1 }}</div> --> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | name: "mobilemapBox", |
| | | data() { |
| | | return { |
| | | butbut: null, |
| | | heights: 0, |
| | | heights1: 0, |
| | | DC: "", |
| | | bigPopup: { |
| | | width: 0, |
| | |
| | | // if (height > 2000) { |
| | | // conBack(2000); |
| | | // } |
| | | if (height < 0 && isSet) { |
| | | conBack(0); |
| | | if (height <= 190 && isSet) { |
| | | conBack(190); |
| | | } |
| | | 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 > 360) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 330 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (height > 300) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 270 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (height > 240) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 200 |
| | | ), |
| | | 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 <= 240) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 270 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | if (height > 240 && height <= 300) { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | 330 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | if (height > 300 && height < 360) { |
| | | 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, |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | //滚轮事件 |
| | | // 指示器 |
| | | var ii = 1, |
| | | startHeight = 0, |
| | | cutHeight = 0; |
| | | let overii = function () { |
| | | ii = 1; |
| | | startHeight = 0; |
| | | cutHeight = 0; |
| | | }; |
| | | let setViews = (num) => { |
| | | viewer.camera.setView({ |
| | | destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians( |
| | | viewer.camera.positionCartographic.longitude, |
| | | viewer.camera.positionCartographic.latitude, |
| | | num |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: that.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0, |
| | | }, |
| | | }); |
| | | overii(); |
| | | }; |
| | | viewer.on(that.DC.SceneEventType.CAMERA_CHANGED, (e) => { |
| | | if (that.dimension == "2.5D") { |
| | | // console.log(e); |
| | | const height = Math.ceil(viewer.camera.positionCartographic.height); |
| | | if (ii == 1 && startHeight == 0) { |
| | | startHeight = height; |
| | | } |
| | | ii++; |
| | | cutHeight = height - startHeight; |
| | | // console.log(cutHeight); |
| | | console.log(height); |
| | | that.heights = height; |
| | | that.heights1 = cutHeight; |
| | | // return; |
| | | if (ii != 1) { |
| | | if (cutHeight >= 0) { |
| | | if (cutHeight > 3) { |
| | | if (height >= 200 && height < 270) { |
| | | setViews(270); |
| | | } |
| | | if (height >= 273 && height < 330) { |
| | | setViews(330); |
| | | } |
| | | if (height >= 333 && height < 400) { |
| | | setViews(400); |
| | | } |
| | | } |
| | | //放大 |
| | | } else { |
| | | //缩小 |
| | | if (cutHeight < -3) { |
| | | if (height <= 400 && height > 327) { |
| | | setViews(330); |
| | | } |
| | | if (height <= 327 && height > 267) { |
| | | setViews(270); |
| | | } |
| | | if (height <= 267 && height > 200) { |
| | | setViews(200); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 地图点击事件 |
| | | // viewer.on(DC.MouseEventType.CLICK, (e) => { |
| | |
| | | }; |
| | | that.dimension == "2.5D" |
| | | ? doit2( |
| | | [114.03928791, 27.62954732, 360.0], |
| | | [114.03928791, 27.62954732, 200.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) { |
| | |
| | | height: 100%; |
| | | position: relative; |
| | | } |
| | | .heights { |
| | | background-color: #fff; |
| | | font-size: 24px; |
| | | position: fixed; |
| | | top: 0; |
| | | right: 0; |
| | | z-index: 9999999; |
| | | } |
| | | </style> |
| | |
| | | // 视角旋转 |
| | | 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 = 190; |
| | | // 最大 |
| | | 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]); |
| | | }; |