| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2023-03-31 10:52:25 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-07-11 15:30:20 |
| | | * @LastEditTime: 2023-08-15 09:30:00 |
| | | * @FilePath: \srs-police-affairs\src\utils\turfPolygon.js |
| | | * @Description: |
| | | * |
| | |
| | | } |
| | | } |
| | | |
| | | export const computerCapacity = (data, type = "") => { |
| | | export const computerCapacity = (data, type = "", multiple = 4) => { |
| | | if (type != "") { |
| | | const center = getAllRegionCenter(data); |
| | | |
| | |
| | | ); |
| | | } |
| | | } else { |
| | | console.log(data, 564); |
| | | let pointArr = []; |
| | | data.forEach((item) => { |
| | | if (item.longitude && item.latitude) { |
| | |
| | | |
| | | // const poly = turf.polygon([[[0, 29], [3.5, 29], [2.5, 32], [0, 29]]]) |
| | | |
| | | console.log([ |
| | | [scope[0], scope[1]], |
| | | [scope[2], scope[1]], |
| | | [scope[2], scope[3]], |
| | | [scope[0], scope[3]], |
| | | ]); |
| | | |
| | | var poly = turf.polygon([ |
| | | [ |
| | | [scope[0], scope[1]], |
| | |
| | | [scope[0], scope[1]], |
| | | ], |
| | | ]); |
| | | var scaledPoly = turf.transformScale(poly, 4); |
| | | var scaledPoly = turf.transformScale(poly, multiple); |
| | | |
| | | let boxPoint = []; |
| | | scaledPoly.geometry.coordinates[0].forEach((item) => { |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2023-03-24 16:36:55 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-07-28 10:37:53 |
| | | * @LastEditTime: 2023-08-15 09:32:31 |
| | | * @FilePath: \srs-police-affairs\src\views\activity\index.vue |
| | | * @Description: |
| | | * |
| | |
| | | } |
| | | }) |
| | | |
| | | computerCapacity(positionArr) |
| | | computerCapacity(positionArr, '') |
| | | |
| | | return |
| | | } else if (type == 'arrow') { |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:18:17 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-08-14 15:30:04 |
| | | * @LastEditTime: 2023-08-15 09:23:24 |
| | | * @FilePath: \srs-police-affairs\src\views\police\index.vue |
| | | * @Description: 辖区管理 |
| | | * |
| | |
| | | type="text" size="small" title="定位"> |
| | | <i class="el-icon-location" :style="{ color: positionColor(scope.row) }"></i> |
| | | </el-button> |
| | | <el-button v-show="navType != 1" |
| | | @click="equipmentTrack(scope.row)" type="text" size="small" title="轨迹"> |
| | | <el-button v-show="navType != 1" @click="equipmentTrack(scope.row)" type="text" |
| | | size="small" title="轨迹"> |
| | | <i class="el-icon-police-track"></i> |
| | | </el-button> |
| | | <el-button v-show="navType != 0 && navType != 2 && navType != 3" @click="play(scope.row)" type="text" |
| | | size="small" title="播放视频"> |
| | | <el-button v-show="navType != 0 && navType != 2 && navType != 3" |
| | | @click="play(scope.row)" type="text" size="small" title="播放视频"> |
| | | <i class="el-icon-video-play"></i> |
| | | </el-button> |
| | | </template> |
| | |
| | | import { getDevices } from '@/api/video/index.js' |
| | | import flvjs from 'flv.js' |
| | | import { getEquipmentPaging } from '@/api/home/index.js' |
| | | |
| | | import { computerCapacity } from "@/utils/turfPolygon.js" |
| | | let tc = null |
| | | let track = null |
| | | |
| | | import { initMapPosition } from '@/utils/mapPositionInit' |
| | | export default { |
| | | inject: ['userInfo'], |
| | |
| | | } |
| | | }) |
| | | |
| | | track = new global.DC.Track(positionStr, 5000) |
| | | track = new global.DC.Track(positionStr, 5000, () => { |
| | | |
| | | }, { |
| | | headingOffset: -90 |
| | | }) |
| | | |
| | | track.setModel('/model/qiche.gltf', { |
| | | scale: 1 |
| | |
| | | |
| | | tc.addTrack(track) |
| | | |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: 114.928669, |
| | | siteWd: 25.850383, |
| | | siteGd: 500, |
| | | siteHeading: 0, |
| | | sitePitch: -90 |
| | | }) |
| | | computerCapacity(positionsArr.map(item => { |
| | | return { |
| | | lng: Number(item.longitude), |
| | | lat: Number(item.latitude) |
| | | } |
| | | }), '', 2.5) |
| | | |
| | | tc.play() |
| | | }, |