Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/srs-police-affairs
7 files modified
2 files added
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-03-30 15:46:06 |
| | | * @LastEditTime: 2023-03-30 16:23:23 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | // global.viewer.addTerrain(terrain) |
| | | |
| | | // 内网 |
| | | // that.switchImg() |
| | | that.switchImg() |
| | | |
| | | // that.highOrLightChange('light') |
| | | |
| | | // 外网 |
| | | |
| | | // 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=e45274b0235bb913eceb393aabbf9c9c', |
| | | // subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | | // format: 'image/jpeg', |
| | | // show: true, |
| | | // maximumLevel: 18 |
| | | // }) |
| | | // ) |
| | | 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=e45274b0235bb913eceb393aabbf9c9c', |
| | | subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | | format: 'image/jpeg', |
| | | show: true, |
| | | maximumLevel: 18 |
| | | }) |
| | | ) |
| | | |
| | | // 设置地图初始位置,角度等 |
| | | global.viewer.camera.setView({ |
| | |
| | | }) |
| | | |
| | | // 原生Cesium加载多边体 |
| | | |
| | | |
| | | // let floorPositions = positions.reduce((prev, curr, index, arr) => { |
| | | // curr.forEach(item => { |
| | | // prev.push(item) |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // 获取当前地图中心的经纬度 |
| | | getSceneCenterPosition (viewer) { |
| | | let centerResult = viewer.camera.pickEllipsoid( |
| | | new global.DC.Namespace.Cesium.Cartesian2( |
| | | viewer.canvas.clientWidth / 2, |
| | | viewer.canvas.clientHeight / 2, |
| | | ), |
| | | ) |
| | | let curPosition = global.DC.Namespace.Cesium.Ellipsoid.WGS84.cartesianToCartographic(centerResult) |
| | | let curLongitude = (curPosition.longitude * 180) / Math.PI |
| | | let curLatitude = (curPosition.latitude * 180) / Math.PI |
| | | return { |
| | | lon: curLongitude, |
| | | lat: curLatitude, |
| | | } |
| | | }, |
| | | |
| | | overLookClick () { |
| | | const position = this.getSceneCenterPosition(global.viewer) |
| | | |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | | 118.04, 28.46938164123123, 60000 |
| | | position.lon, position.lat, global.viewer.camera.positionCartographic.height * 1.5 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:16:10 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-03-24 17:16:46 |
| | | * @LastEditTime: 2023-03-30 16:30:30 |
| | | * @FilePath: \srs-police-affairs\src\permission.js |
| | | * @Description: 路由守卫 |
| | | * |
| | |
| | | delete window._axiosPromiseArr[index] |
| | | console.clear() |
| | | }) |
| | | |
| | | |
| | | const meta = to.meta || {} |
| | | // next() |
| | |
| | | } |
| | | |
| | | ::-webkit-scrollbar-thumb { |
| | | background-color: rgba(17, 38, 163, .5); |
| | | background-color: hsla(0, 0%, 84.7%, .5); |
| | | padding-left: 2px; |
| | | padding-right: 2px; |
| | | } |
| | | |
| | | ::-webkit-scrollbar-thumb:hover { |
| | | cursor: pointer !important; |
| | | } |
| | | |
| | | ::-webkit-scrollbar-track { |
| | | background-color: hsla(0, 0%, 84.7%, .2); |
| | | background-color: rgba(17, 38, 163, .5); |
| | | } |
| | | |
| | | .car-video-box { |
| | |
| | | image: image, |
| | | width: 12, |
| | | height: 12, |
| | | eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -100), |
| | | eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -4), |
| | | heightReference: |
| | | this._viewer.scene.mode === global.DC.Namespace.Cesium.SceneMode.SCENE3D && |
| | | !this._options.clampToModel |
| | |
| | | this.$nextTick(() => { |
| | | |
| | | drawThreeTool = new Plot(global.viewer, { |
| | | clampToModel: true |
| | | clampToModel: true, |
| | | icon_center: "/img/draw/red.png", // 自定义的中心点图标 |
| | | icon_anchor: "/img/draw/red.png", //自定义的锚点图标 |
| | | icon_midAnchor: "/img/draw/blue.png", //自定义的中心锚点图标 |
| | | }) |
| | | |
| | | // global.viewer.scene.globe.depthTestAgainstTerrain = true |
| | |
| | | break |
| | | } |
| | | |
| | | if (type == 'polygon') { |
| | | drawThreeTool && drawThreeTool.draw(type, overlay => { |
| | | if (drawFlag) return |
| | | if (overlay) { |
| | | addPlotOverlayData = overlay |
| | | overlay.customType = 'polygon' |
| | | that.$parent.addArrowsListLayer(overlay) |
| | | |
| | | let polygonPosition = overlay.positions.map(item => `${item.lng} ${item.lat}`).join() |
| | | const altitude = overlay.positions.map(item => item.alt).join() |
| | | setTimeout(() => { |
| | | that.$parent.addSaveNewDraw(polygonPosition, 5, altitude) |
| | | }, 100) |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | currentStatus = '' |
| | | that.startDrawFlag = false |
| | | } |
| | | }, { |
| | | let drawConfig = {} |
| | | |
| | | if (type == 'polygon') { |
| | | drawConfig = { |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes(64, 158, 255, 122), |
| | | perPositionHeight: true, |
| | | outline: true, |
| | | outlineColor: global.DC.Namespace.Cesium.Color.fromBytes(64, 158, 255, 255), |
| | | outlineWidth: 4.0, |
| | | }, true) |
| | | } |
| | | } else if (type == 'billboard') { |
| | | drawThreeTool && drawThreeTool.draw(type, overlay => { |
| | | if (drawFlag) return |
| | | if (overlay) { |
| | | drawConfig = { |
| | | size: [32, 32], |
| | | verticalOrigin: global.DC.Namespace.Cesium.VerticalOrigin.BOTTOM, |
| | | color: material, |
| | | // eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -10), |
| | | billboardImage: `/img/icon/${imgUrl}.png` |
| | | } |
| | | } else if (type == 'polyline') { |
| | | drawConfig = { |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes(28, 160, 133, 122), |
| | | } |
| | | } |
| | | |
| | | drawThreeTool.draw(type, overlay => { |
| | | if (drawFlag) return |
| | | if (overlay) { |
| | | if (type == 'polygon') { |
| | | addPlotOverlayData = overlay |
| | | overlay.customType = 'polygon' |
| | | that.$parent.addArrowsListLayer(overlay) |
| | | let polygonPosition = overlay.positions.map(item => `${item.lng} ${item.lat}`).join() |
| | | const altitude = overlay.positions.map(item => item.alt).join() |
| | | setTimeout(() => { |
| | | that.$parent.addSaveNewDraw(polygonPosition, 5, altitude) |
| | | }, 100) |
| | | } |
| | | |
| | | if (type == 'billboard') { |
| | | addPlotOverlayData = overlay |
| | | overlay.customType = 'billboard' |
| | | that.$parent.addPointCircleCarLayer(overlay) |
| | |
| | | } else { |
| | | that.$parent.addPointPopupShow(typeValue, overlay.position) |
| | | } |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | currentStatus = '' |
| | | that.startDrawFlag = false |
| | | } |
| | | }, { |
| | | size: [32, 32], |
| | | verticalOrigin: global.DC.Namespace.Cesium.VerticalOrigin.BOTTOM, |
| | | color: material, |
| | | // eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -10), |
| | | billboardImage: `/img/icon/${imgUrl}.png` |
| | | }, true) |
| | | } else if (type == 'polyline') { |
| | | drawThreeTool && drawThreeTool.draw(type, overlay => { |
| | | if (drawFlag) return |
| | | if (overlay) { |
| | | |
| | | if (type == 'polyline') { |
| | | addPlotOverlayData = overlay |
| | | overlay.customType = 'polyline' |
| | | that.$parent.addLineLayer(overlay) |
| | |
| | | setTimeout(() => { |
| | | that.$parent.addSaveNewDrawLine(polylinePosition, altitude) |
| | | }, 100) |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | currentStatus = '' |
| | | that.startDrawFlag = false |
| | | } |
| | | }, { |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes(28, 160, 133, 122), |
| | | }, true) |
| | | } |
| | | |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | currentStatus = '' |
| | | that.startDrawFlag = false |
| | | } |
| | | }, drawConfig, true) |
| | | }, |
| | | |
| | | removeDrawArrow () { |
| | |
| | | |
| | | stopDraw () { |
| | | if (drawThreeTool) { |
| | | drawFlag = true |
| | | currentStatus == 'draw' && drawThreeTool.stop() |
| | | currentStatus == 'emit' && drawThreeTool.stop(currentEmitEl) |
| | | } |
| | |
| | | |
| | | let currentEmitEl = null |
| | | let drawThreeTool = null |
| | | let stopDrawflag = false |
| | | |
| | | let drawFlag = false |
| | | let drawTwoFlag = false |
| | |
| | | }) |
| | | }, |
| | | |
| | | startDraw () { |
| | | stopDrawflag = true |
| | | }, |
| | | |
| | | stopDraw () { |
| | | stopDrawflag = false |
| | | drawFlag = true |
| | | drawTwoFlag = true |
| | | |
| | | |
| | | if (plotDrawEmit) { |
| | | plotDrawEmit.stop() |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-09-07 09:37:07 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-03-29 08:54:06 |
| | | * @LastEditTime: 2023-03-30 15:49:22 |
| | | * @FilePath: \srs-police-affairs\vue.config.js |
| | | * @Description: |
| | | * |
| | |
| | | proxy: { |
| | | "/api": { |
| | | // target用于配置你允许访问数据的计算机名称,即是你的api接口的服务器地址 |
| | | // target: "http://localhost:82", |
| | | target: "http://192.168.0.100:82", |
| | | target: "http://localhost:82", |
| | | // target: "http://192.168.0.100:82", |
| | | // target: "http://17.20.10.3:82", |
| | | // target: "http://10.141.11.11:8081/api", |
| | | // ws: true, //启用webSocket6566 |