| | |
| | | .el-main { |
| | | padding: 0; |
| | | } |
| | | |
| | | .status-box { |
| | | margin: auto; |
| | | margin-right: 6px; |
| | | width: 10px; |
| | | height: 10px; |
| | | text-align: center; |
| | | border-radius: 50%; |
| | | background-color: #adadad; |
| | | } |
| | | |
| | | .online { |
| | | background-color: #4ccc7d; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2023-03-31 10:52:25 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-03-31 11:36:28 |
| | | * @LastEditTime: 2023-04-04 15:55:33 |
| | | * @FilePath: \srs-police-affairs\src\utils\turfPolygon.js |
| | | * @Description: |
| | | * |
| | |
| | | */ |
| | | import * as turf from '@turf/turf' |
| | | |
| | | export const computerCapacity = (data) => { |
| | | if (data.length) { |
| | | export const computerCapacity = (data, type) => { |
| | | if (type == 'region') { |
| | | const pointArr = data.reduce((pre, cur) => { |
| | | cur.position && JSON.parse(cur.position).coordinates[0][0].forEach(item => { |
| | | console.log(item, 959) |
| | | item[0] && item[1] && pre.push(turf.point(item)) |
| | | }) |
| | | |
| | | return pre |
| | | }, []) |
| | | |
| | | |
| | | const features = turf.featureCollection(pointArr) |
| | | |
| | | const scope = turf.envelope(features).bbox |
| | | |
| | | const poly = turf.polygon([[[scope[0], scope[1]], [scope[0], scope[3]], [scope[2], scope[1]], [scope[2], scope[3]]]]) |
| | | |
| | | const scaledPoly = turf.transformScale(poly, 3) |
| | | |
| | | console.log(scope, scaledPoly, 5555) |
| | | } else { |
| | | let pointArr = [] |
| | | |
| | | data.forEach(item => { |
| | |
| | | |
| | | const scope = turf.envelope(features).bbox |
| | | |
| | | console.log(scope, 5555) |
| | | |
| | | const poly = turf.polygon([[[0, 29], [3.5, 29], [2.5, 32], [0, 29]]]) |
| | | |
| | | global.viewer.flyToBounds(scope, |
| | | { heading: 0, pitch: -90, roll: 0 }, |
| | | { heading: 0, pitch: -45, roll: 0 }, |
| | | (e) => { }, |
| | | 3 |
| | | ) |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:18:17 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-04-03 16:38:51 |
| | | * @LastEditTime: 2023-04-04 16:06:54 |
| | | * @FilePath: \srs-police-affairs\src\views\home\index.vue |
| | | * @Description: 小区-栋-层-房屋 |
| | | * |
| | |
| | | |
| | | } else if (type == 2) { |
| | | this.areaOptions = res.data.data |
| | | this.initAreaOptionLayer() |
| | | this.areaOptions.unshift({ |
| | | name: '全部', |
| | | id: 1 |
| | | }) |
| | | this.initAreaOptionLayer() |
| | | } else { |
| | | if (res.data.data.length == 0 || JSON.stringify(res.data.data) === "{}") { |
| | | this.selectHouseClass = true |
| | |
| | | |
| | | const center = this.getAllRegionCenter(this.policeStationOptions) |
| | | |
| | | console.log(center[0] + 0.046, center[1] - 0.36) |
| | | |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: center[0] + 0.046, |
| | | siteWd: center[1] - 0.36, |
| | |
| | | |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: center[0] + 0.0046, |
| | | siteWd: center[1] - 0.08, |
| | | siteGd: 8000, |
| | | siteWd: center[1] - 0.04, |
| | | siteGd: 4000, |
| | | siteHeading: -3, |
| | | sitePitch: -45 |
| | | }) |
| | |
| | | let centerPosition = [center.geometry.coordinates[0], center.geometry.coordinates[1]] |
| | | this.clearPolygonLayer() |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: centerPosition[0] + 0.004, |
| | | siteWd: centerPosition[1] - 0.06, |
| | | siteGd: 6000, |
| | | siteJd: centerPosition[0] + 0.001, |
| | | siteWd: centerPosition[1] - 0.018, |
| | | siteGd: 2000, |
| | | siteHeading: -3, |
| | | sitePitch: -45 |
| | | }) |
| | |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: positionArr[0], |
| | | siteWd: positionArr[1], |
| | | siteGd: 3000, |
| | | siteGd: 1000, |
| | | siteHeading: -3, |
| | | sitePitch: -90 |
| | | }) |