更新感知设备

dev
独树的风 10 months ago
parent b4334fb792
commit ff5d23bd08

Binary file not shown.

@ -11,9 +11,9 @@
</title> </title>
<script type="text/javascript" src="<%= BASE_URL %>js/liveplayer-lib.min.js"></script> <script type="text/javascript" src="<%= BASE_URL %>js/liveplayer-lib.min.js"></script>
<!-- 引入MineMap API插件 --> <!-- 引入MineMap API插件 -->
<!-- <link rel="stylesheet" href="http://50.144.11.244:21009/support/static/api/demo/js-api/zh/css/demo.css"> <link rel="stylesheet" href="http://50.144.11.244:21009/support/static/api/demo/js-api/zh/css/demo.css">
<link rel="stylesheet" href="http://50.144.11.244:21009/minemapapi/v2.1.0/minemap.css"> <link rel="stylesheet" href="http://50.144.11.244:21009/minemapapi/v2.1.0/minemap.css">
<script src="http://50.144.11.244:21009/minemapapi/v2.1.0/minemap.js"></script> --> <script src="http://50.144.11.244:21009/minemapapi/v2.1.0/minemap.js"></script>
</head> </head>
<body> <body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

@ -1,132 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>自定义点标记内容</title>
<link rel="stylesheet" href="http://50.144.11.244:21009/support/static/api/demo/js-api/zh/css/demo.css">
<!-- 引入MineMap API插件 -->
<link rel="stylesheet" href="http://50.144.11.244:21009/minemapapi/v2.1.0/minemap.css">
<script src="http://50.144.11.244:21009/minemapapi/v2.1.0/minemap.js"></script>
<!-- 引入 popup 样式 -->
<link rel="stylesheet" href="./popup.css">
<style>
#map {
margin: 0;
padding: 0;
box-sizing: border-box;
width: 100vw;
height: 100vh;
}
/* 原始标注图片 */
.old_back {
background-image: url(./background-img//icon_company_blue.png);
}
/* 点击标注图片 */
.new_back {
background-image: url(./background-img/icon_company_yellow.png);
}
/* 监控设备不正常标注图片 */
.error_back {
background-image: url('../../src/assets/icon_company_yellow.png');
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// * 地图全局参数设置
minemap.domainUrl = 'http://50.144.11.244:21009';
minemap.dataDomainUrl = 'http://50.144.11.244:21009';
minemap.serverDomainUrl = 'http://50.144.11.244:21009';
minemap.spriteUrl = 'http://50.144.11.244:21009/minemapapi/v2.1.0/sprite/sprite';
minemap.serviceUrl = 'http://50.144.11.244:21009/service/';
minemap.key = '16be596e00c44c86bb1569cb53424dc9';
minemap.solution = 12877;
// todo 获取vue中的设备数据
window.addEventListener('message', (event) => {
const deviceData = event.data
// 筛选经纬度为0的数组
const deviceDatas = deviceData.filter(item => item.Longitude !== 0)
// 设备编号的数组
// const deviceId = deviceDatas.map(item => item.DeviceID)
// console.log(deviceId);
console.log(deviceDatas);
// * map 实例化
const map = new minemap.Map({
container: 'map',
style: 'http://50.144.11.244:21009/service/solu/style/id/2365',
center: [120.336617, 33.766037],
zoom: 14,
pitch: 0,
maxZoom: 17,
minZoom: 3,
projection: 'LATLON'
});
// 循环设备数组进行打点
for (let i = 0; i < deviceDatas.length; i++) {
// 自定义点标记的内部DOM元素
const el = document.createElement('div');
el.id = 'marker';
// 自定义DOM样式 或者通过css类设置 (http://50.144.11.244:21009/support/static/api/demo/js-api/zh/images/park.png)
// el.style["background-image"] = "url(http://50.144.11.244:21009/support/static/api/demo/js-api/zh/images/park.png)";
el.className = 'old_back'
el.style["background-size"] = "cover";
el.style.width = "20px";
el.style.height = "30px";
el.style["border-radius"] = "50%";
// Marker构造函数接收两个参数一个为自定义的DOM元素一个是Object参数其中包括偏移量等
// offset参数为标注点相对于其左上角偏移像素大小
// 调用setLngLat方法指定Marker的坐标位置
const point = deviceDatas[i]
const Longitude = point.Longitude
const Latitude = point.Latitude
const popup = new minemap.Popup({ offset: [0, -30] }).setHTML(`
<div class="box">
<div class="state state_a">人脸抓拍</div>
<div class="state state_b">人脸抓拍</div>
<div class="state state_c">人脸抓拍</div>
<div class="state state_d">人脸抓拍</div>
<button class="button_plus">
<span class="plus">+</span>
</button>
</div>`)
const marker = new minemap.Marker(el, { offset: [-25, -25] }).setPopup(popup).setLngLat([Longitude, Latitude]).addTo(map);
// 视频
const video = document.querySelector('video')
// 点击监控标记时,发送 设备id 通知 vue 页面接受并通过设备 id 发起请求获取视频url并显示
marker.getElement().addEventListener('click', function () {
if (el.classList.contains('old_back')) {
el.classList.remove('old_back')
el.classList.add('new_back')
window.parent.postMessage({
cmd: 'myIframe',
params: {
channel: point.Channel,
}
}, '*')
console.log(point.Channel, '点击标记播放视频');
} else if (el.classList.contains('new_back')) {
el.classList.remove('new_back')
el.classList.add('old_back')
// 隐藏视频时关闭视频流
window.parent.postMessage({
cmd: 'closeIframe',
params: {
channel: point.Channel,
close: true
}
}, '*')
console.log(point.Channel, '点击标记关闭视频');
}
// console.log(el.className);
})
}
})
</script>
</body>

@ -1,58 +0,0 @@
.box {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 5px;
width: 220px;
height: 100px;
background-color: #fff;
border-radius: 5px;
}
.button_plus,
.state {
margin-top: 5px;
margin-left: 5px;
width: 60px;
height: 30px;
background-color: #2e92f7;
border-radius: 5px;
border: none;
outline: none;
cursor: pointer;
font-size: 0.5rem;
line-height: 30px;
text-align: center;
}
.button_plus:active {
transform: translateY(2px);
}
.state {
width: 60px;
height: 30px;
border-radius: 5px;
color: #fff;
font-size: 0.1rem;
}
.state_a {
background-color: #ff6600;
}
.state_b {
background-color: #188801;
}
.state_c {
background-color: #2278f8;
}
.state_d {
background-color: #f74242;
}
.plus {
font-size: 2rem;
color: #fff;
}

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -1,5 +1,5 @@
<template> <template>
<div class="carousel" ref="carousel"> <div class="carousel">
<el-carousel <el-carousel
direction="vertical" direction="vertical"
:autoplay="true" :autoplay="true"
@ -86,18 +86,19 @@ export default {
<style lang="scss"> <style lang="scss">
.carousel { .carousel {
width: 24vw; width: 20vw;
height: 38vh; height: 39vh;
.carousel_group { .carousel_group {
margin: 0; margin: 0;
height: 36vh; height: 39vh;
.carousel_item { .carousel_item {
.carousel_box { .carousel_box {
margin-top: 1vh; margin-top: 1vh;
display: flex; display: flex;
justify-content: space-around; justify-content: space-between;
width: 20vw;
height: 11vh; height: 11vh;
background-image: url('@/assets/picture/bg_people_nor.png'); background-image: url('@/assets/picture/bg_people_nor.png');
@ -113,14 +114,15 @@ export default {
.carousel_box_left_picture { .carousel_box_left_picture {
flex: 1; flex: 1;
width: 4vw;
height: 8vh; height: 8vh;
// background-color: #fcbebe;
background-image: url('@/assets/picture/icon_householder.png'); background-image: url('@/assets/picture/icon_householder.png');
background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat;
} }
.carousel_box_left_text { .carousel_box_left_text {
width: 4vw;
color: #ecf4f9; color: #ecf4f9;
text-align: center; text-align: center;
font-size: 0.8rem; font-size: 0.8rem;
@ -142,9 +144,12 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 18vw; width: 15vw;
font-size: 0.8rem; font-size: 0.8rem;
position: relative; position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.carousel_box_right_label { .carousel_box_right_label {
width: 4vw; width: 4vw;
@ -154,10 +159,13 @@ export default {
} }
.carousel_box_right_name { .carousel_box_right_name {
width: 14vw; width: 10vw;
color: #edf1f7; color: #edf1f7;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-size: 0.8rem; font-size: 0.8rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.people_status { .people_status {

@ -1,70 +0,0 @@
// TODO 坐标转换
const x_PI = (3.14159265358979324 * 3000.0) / 180.0
const PI = 3.1415926535897932384626
const a = 6378245.0
const ee = 0.00669342162296594323
/**
* 判断是否在国内不在国内则不偏移
* @param {*} lng 经度
* @param {*} lat 纬度
*/
const outOfChina = (lng, lat) => {
return (
lng < 72.004 || lng > 137.8347 || lat < 0.8293 || lat > 55.8271 || false
)
}
/**
* 经度转换
* @param {Number} lng
* @param {Number} lat
*/
function transformlat(lng, lat) {
let ret =
-100.0 +
2.0 * lng +
3.0 * lat +
0.2 * lat * lat +
0.1 * lng * lat +
0.2 * Math.sqrt(Math.abs(lng))
ret +=
((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) *
2.0) /
3.0
ret +=
((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) * 2.0) /
3.0
ret +=
((160.0 * Math.sin((lat / 12.0) * PI) + 320 * Math.sin((lat * PI) / 30.0)) *
2.0) /
3.0
return ret
}
/**
* 纬度转换
* @param {Number} lng 经度
* @param {Number} lat 纬度
*/
function transformlng(lng, lat) {
let ret =
300.0 +
lng +
2.0 * lat +
0.1 * lng * lng +
0.1 * lng * lat +
0.1 * Math.sqrt(Math.abs(lng))
ret +=
((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) *
2.0) /
3.0
ret +=
((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) * 2.0) /
3.0
ret +=
((160.0 * Math.sin((lat / 12.0) * PI) + 320 * Math.sin((lat * PI) / 30.0)) *
2.0) /
3.0
return ret
}

@ -0,0 +1,13 @@
<template>
<div class="login"></div>
</template>
<script>
export default {
data() {
return {}
}
}
</script>
<style lang="scss"></style>

@ -38,7 +38,7 @@ import {
getAlarmAddressAPI, getAlarmAddressAPI,
getAlarmInfoAPI getAlarmInfoAPI
} from '@/api/address' } from '@/api/address'
import { setDeviceLatlng } from '@/utils/latlng' // import { setDeviceLatlng } from '@/utils/latlng'
import { setToken } from '@/utils/token' import { setToken } from '@/utils/token'
import bus from '@/utils/bus' import bus from '@/utils/bus'
@ -113,36 +113,11 @@ export default {
return item.Longitude !== 0 return item.Longitude !== 0
}) })
) )
// TODO 0
const deviceTypeByZero = this.deviceData.filter(
(item) => item.PTZType === 0
)
console.log(deviceTypeByZero, '监控类型-未知')
// TODO 0
const deviceTypeByOne = this.deviceData.filter(
(item) => item.PTZType === 1
)
console.log(deviceTypeByOne, '监控类型-球机')
// TODO 0
const deviceTypeByTwo = this.deviceData.filter(
(item) => item.PTZType === 2
)
console.log(deviceTypeByTwo, '监控类型-半球')
// TODO 0
const deviceTypeByThree = this.deviceData.filter(
(item) => item.PTZType === 3
)
console.log(deviceTypeByThree, '监控类型-固定枪机')
// TODO 0
const deviceTypeByFour = this.deviceData.filter(
(item) => item.PTZType === 4
)
console.log(deviceTypeByFour, '监控类型-遥控枪机')
// console.log(this.deviceData, '') // console.log(this.deviceData, '')
// // todo // // todo
// await postGbsDataAPI(this.deviceData) // await postGbsDataAPI(this.deviceData)
// * // *
setDeviceLatlng(this.deviceData) // setDeviceLatlng(this.deviceData)
}, },
// * // *
async onGetRealAddress() { async onGetRealAddress() {

@ -0,0 +1,339 @@
<!-- 通用抓拍 -->
<template>
<div class="capture">
<div class="capture_title">
<div class="capture_title_text">车辆抓拍</div>
</div>
<div class="capture_main">
<div class="person_roll">
<!-- 滚动区域 -->
<div class="roll_body">
<ul class="marquee-list" :class="{ 'animate-up': animateUp }">
<li v-for="(item, index) in roll_list" :key="index">
<div class="roll_item_left">
<div class="roll_item_pic"></div>
<div class="roll_item_btn">车辆追踪</div>
</div>
<div class="roll_item_right">
<!-- <div v-if="item.per_type == '1'" class="person_type one_type">
{{ item.type_text }}
</div>
<div
v-else-if="item.per_type == '2'"
class="person_type two_type"
>
{{ item.type_text }}
</div>
<div
v-else-if="item.per_type == '3'"
class="person_type three_type"
>
{{ item.type_text }}
</div> -->
<!-- 信息展示 -->
<div class="right_text">
<div class="right_text_item">车主姓名</div>
<div class="right_text_item">证件号码</div>
<div class="right_text_item">车牌号码</div>
<div class="right_text_item">抓拍时间</div>
<div class="right_text_item">滞留时间</div>
<div class="right_text_item">抓拍地点</div>
</div>
<div class="right_value">
<div class="right_value_item">{{ item.person_name }}</div>
<div class="right_value_item">{{ item.id_card }}</div>
<div class="right_value_item" :title="item.car_code">
{{ item.car_code }}
</div>
<div class="right_value_item" :title="item.catch_time">
{{ item.catch_time }}
</div>
<div class="right_value_item" :title="item.state_time">
{{ item.state_time }}
</div>
<div class="right_value_item" :title="item.catch_place">
{{ item.catch_place }}
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'CarCatch',
props: {
item: {
type: Object
}
},
data() {
return {
roll_list: [
{
text: '123',
per_type: '1',
// type_text: '',
person_name: '周大山',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1243',
per_type: '3',
// type_text: '',
person_name: '王富强',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '12323',
per_type: '2',
// type_text: '',
person_name: '赵磊',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1243',
per_type: '2',
// type_text: '',
person_name: '徐永',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '2',
// type_text: '',
person_name: '李文一',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '1',
// type_text: '',
person_name: '谭静',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1243',
per_type: '3',
// type_text: '',
person_name: '孙洋洋',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '1',
// type_text: '',
person_name: '董磊',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '2',
// type_text: '',
person_name: '郑廖',
id_card: '321287197606038965',
car_code: '苏J40089',
catch_time: '2023-11-30 14:20:08',
state_time: '4个小时',
catch_place: '江苏省射阳县海河镇革新村二组113号'
}
],
animateUp: false,
timer: null
}
},
mounted() {
this.timer = setInterval(this.scrollAnimate, 1500)
},
methods: {
//
scrollAnimate() {
this.animateUp = true
setTimeout(() => {
this.roll_list.push(this.roll_list[0])
this.roll_list.shift()
this.animateUp = false
}, 500)
}
}
}
</script>
<style lang="scss">
.capture {
width: 20vw;
height: 43vh;
.capture_title {
width: 20vw;
height: 4vh;
background-image: url('@/assets/picture/bg_small_title.png');
background-size: 100% auto;
background-repeat: no-repeat;
.capture_title_text {
margin-left: 3vw;
font-size: 16px;
font-family: PingFangSC, PingFang SC;
line-height: 4vh;
color: #edf1f7;
}
}
.capture_main {
display: flex;
align-items: center;
justify-content: center;
width: 20vw;
height: 40vh;
background-image: url('@/assets/picture/bg_5.png');
background-size: 100% 100%;
background-repeat: no-repeat;
.roll_body {
width: 20vw;
height: 39vh;
// background: #00f5ff;
overflow: hidden;
.marquee-list {
width: 20vw;
height: 39vh;
padding: 0px;
li {
margin-left: 2%;
margin-right: 2%;
width: 96%;
height: 18vh;
background: url('~@/assets/coastalMap/keyPerson/key_li_back.png')
no-repeat;
background-size: 100% 100%;
margin-top: 1vh;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
list-style: none;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
.roll_item_left {
width: 5vw;
height: 17vh;
.roll_item_pic {
width: 5vw;
height: 14vh;
background: #0b4672;
}
.roll_item_btn {
width: 5vw;
height: 3vh;
color: #fff;
background: #00f5ff;
font-size: 16px;
font-weight: 400;
text-align: center;
line-height: 3vh;
cursor: pointer;
background: url('~@/assets/coastalMap/keyPerson/key_li_btn.png')
no-repeat;
background-size: 100% 100%;
}
}
.roll_item_right {
width: 13vw;
height: 17vh;
position: relative;
display: flex;
.person_type {
position: absolute;
width: 3vw;
height: 2vh;
top: 0px;
right: 0px;
color: #061122;
text-align: center;
line-height: 2vh;
}
.one_type {
background: #ffc426;
}
.two_type {
background: #00f5ff;
}
.three_type {
background: #a357ff;
}
.right_text {
width: 5vw;
height: 15vh;
.right_text_item {
width: 5vw;
height: 3vh;
color: #ecf4f9;
font-size: 14px;
text-align: center;
line-height: 3vh;
}
}
.right_value {
width: 8vw;
height: 15vh;
.right_value_item {
width: 8vw;
height: 3vh;
color: #edf1f7;
font-size: 14px;
text-align: left;
line-height: 3vh;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
}
}
}
.animate-up {
transition: all 0.8s ease-in-out;
transform: translateY(-20vh);
}
}
}
}
</style>

@ -1,54 +0,0 @@
<template>
<div id="carMain"></div>
</template>
<script>
import * as echarts from 'echarts'
import EleResize from '@/utils/esresize'
export default {
name: 'CarEcharts',
data() {
return {}
},
mounted() {
this.init_charts()
},
methods: {
init_charts() {
var chartDom = document.getElementById('carMain')
var myChart = echarts.init(chartDom)
let resize_div = document.getElementById('people_chart')
// *echarts
EleResize.on(resize_div, () => {
myChart.resize()
})
var option
option = {
xAxis: {
type: 'category',
data: ['11-28', '11-29', '11-30', '12-01', '12-02', '12-03', '12-04']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}
]
}
option && myChart.setOption(option)
}
}
}
</script>
<style lang="scss">
#carMain {
width: 17vw;
height: 30vh;
}
</style>

@ -5,30 +5,62 @@
<div class="car_large_title_text">车流量</div> <div class="car_large_title_text">车流量</div>
</div> </div>
<div class="car_large_main"> <div class="car_large_main">
<CarEcharts></CarEcharts> <div id="carMain" class="car_charts"></div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import CarEcharts from './carEcharts.vue' import * as echarts from 'echarts'
import EleResize from '@/utils/esresize'
export default { export default {
name: 'CarLarge', name: 'CarLarge',
components: { CarEcharts },
data() { data() {
return {} return {}
},
mounted() {
this.init_charts()
},
methods: {
init_charts() {
var chartDom = document.getElementById('carMain')
var myChart = echarts.init(chartDom)
let resize_div = document.getElementById('people_chart')
// *echarts
EleResize.on(resize_div, () => {
myChart.resize()
})
var option
option = {
xAxis: {
type: 'category',
data: ['11-28', '11-29', '11-30', '12-01', '12-02', '12-03', '12-04']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}
]
}
option && myChart.setOption(option)
}
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.car_large { .car_large {
margin-top: 3vh; width: 20vw;
width: 18vw; height: 34vh;
height: 31vh;
.car_large_title { .car_large_title {
width: 18vw; width: 20vw;
height: 4vh; height: 4vh;
background-image: url('@/assets/picture/bg_small_title.png'); background-image: url('@/assets/picture/bg_small_title.png');
background-size: 100% auto; background-size: 100% auto;
@ -36,18 +68,23 @@ export default {
.car_large_title_text { .car_large_title_text {
margin-left: 2vw; margin-left: 2vw;
font-size: 0.8rem; font-size: 16px;
font-family: 'PingFangSC'; font-family: 'PingFangSC';
line-height: 4vh; line-height: 4vh;
color: #edf1f7; color: #edf1f7;
} }
} }
.car_large_main { .car_large_main {
width: 18vw; width: 20vw;
height: 27vh; height: 30vh;
background-image: url('@/assets/picture/bg_5.png'); background-image: url('@/assets/picture/bg_5.png');
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
.car_charts {
width: 20vw;
height: 30vh;
}
} }
} }
</style> </style>

@ -19,11 +19,11 @@ export default {
<style lang="scss"> <style lang="scss">
.mancar { .mancar {
width: 18vw; width: 20vw;
height: 23vh; height: 23vh;
.mancar_title { .mancar_title {
width: 18vw; width: 20vw;
height: 4vh; height: 4vh;
background-image: url('@/assets/picture/bg_small_title.png'); background-image: url('@/assets/picture/bg_small_title.png');
background-size: 100% auto; background-size: 100% auto;
@ -31,14 +31,14 @@ export default {
.mancar_title_text { .mancar_title_text {
margin-left: 2vw; margin-left: 2vw;
font-size: 0.8rem; font-size: 1rem;
font-family: 'PingFangSC'; font-family: 'PingFangSC';
line-height: 4vh; line-height: 4vh;
color: #edf1f7; color: #edf1f7;
} }
} }
.mancar_main { .mancar_main {
width: 18vw; width: 20vw;
height: 19vh; height: 19vh;
background-image: url('@/assets/picture/bg_1.png'); background-image: url('@/assets/picture/bg_1.png');
background-size: 100% auto; background-size: 100% auto;

@ -46,8 +46,8 @@ export default {
width: 16vw; width: 16vw;
height: 27vh; height: 27vh;
position: absolute; position: absolute;
right: 26vw; right: 23vw;
// background-color: #0059ff; z-index: 2;
.search { .search {
display: flex; display: flex;

@ -1,214 +0,0 @@
<template>
<div id="people_chart"></div>
</template>
<script>
// * echarts
import * as echarts from 'echarts'
import EleResize from '@/utils/esresize'
export default {
name: 'PeopleEcharts',
data() {
return {}
},
mounted() {
// * echarts
const myChart = echarts.init(document.getElementById('people_chart'))
let resize_div = document.getElementById('people_chart')
// *echarts
EleResize.on(resize_div, () => {
myChart.resize()
})
// * echarts
myChart.setOption({
color: ['#80ffa5', '#00ddff', '#37a2ff', '#ffbf00'],
title: {
// text: ''
},
tooitip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
// data: ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['11-26', '11-27', '11-28', '11-29', '11-30', '12-01', '12-02']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
// name: 'Line 1',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(128, 255, 165)'
},
{
offset: 1,
color: 'rgb(1, 191, 236)'
}
])
},
emphasis: {
focus: 'series'
},
data: [140, 232, 101, 264, 90, 340, 250]
},
{
// name: 'Line 2',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(0, 221, 255)'
},
{
offset: 1,
color: 'rgb(77, 119, 255)'
}
])
},
emphasis: {
focus: 'series'
},
data: [120, 282, 111, 234, 220, 340, 310]
},
{
// name: 'Line 3',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(55, 162, 255)'
},
{
offset: 1,
color: 'rgb(116, 21, 219)'
}
])
},
emphasis: {
focus: 'series'
},
data: [320, 132, 201, 334, 190, 130, 220]
},
{
// name: 'Line 4',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(255, 0, 135)'
},
{
offset: 1,
color: 'rgb(135, 0, 157)'
}
])
},
emphasis: {
focus: 'series'
},
data: [220, 402, 231, 134, 190, 230, 120]
},
{
// name: 'Line 5',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
label: {
show: true,
position: 'top'
},
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(255, 191, 0)'
},
{
offset: 1,
color: 'rgb(224, 62, 76)'
}
])
},
emphasis: {
focus: 'series'
},
data: [220, 302, 181, 234, 210, 290, 150]
}
]
})
}
}
</script>
<style lang="scss">
#people_chart {
width: 17vw;
height: 23vh;
}
</style>

@ -5,30 +5,31 @@
<div class="people_large_title_text">人流量</div> <div class="people_large_title_text">人流量</div>
</div> </div>
<div class="people_large_main"> <div class="people_large_main">
<PeopleEcharts></PeopleEcharts> <div id="people_chart" class="people_chart"></div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import PeopleEcharts from './peopleEcharts.vue' import { init_echarts } from '../utils/initEcharts'
export default { export default {
name: 'PeopleLarge', name: 'PeopleLarge',
components: { PeopleEcharts },
data() { data() {
return {} return {}
},
mounted() {
init_echarts()
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.people_large { .people_large {
margin-top: 3vh; width: 20vw;
width: 18vw; height: 30vh;
height: 28vh;
.people_large_title { .people_large_title {
width: 18vw; width: 20vw;
height: 4vh; height: 4vh;
background-image: url('@/assets/picture/bg_small_title.png'); background-image: url('@/assets/picture/bg_small_title.png');
background-size: 100% auto; background-size: 100% auto;
@ -36,18 +37,26 @@ export default {
.people_large_title_text { .people_large_title_text {
margin-left: 2vw; margin-left: 2vw;
font-size: 0.8rem; font-size: 16px;
font-family: 'PingFangSC'; font-family: 'PingFangSC';
line-height: 4vh; line-height: 4vh;
color: #edf1f7; color: #edf1f7;
} }
} }
.people_large_main { .people_large_main {
width: 18vw; display: flex;
height: 24vh; justify-content: center;
align-items: center;
width: 20vw;
height: 26vh;
background-image: url('@/assets/picture/bg_5.png'); background-image: url('@/assets/picture/bg_5.png');
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
.people_chart {
width: 20vw;
height: 25vh;
}
} }
} }
</style> </style>

@ -0,0 +1,326 @@
<!-- 通用抓拍 -->
<template>
<div class="capture">
<div class="capture_title">
<div class="capture_title_text">人脸抓拍</div>
</div>
<div class="capture_main">
<div class="person_roll">
<!-- 滚动区域 -->
<div class="roll_body">
<ul class="marquee-list" :class="{ 'animate-up': animateUp }">
<li v-for="(item, index) in roll_list" :key="index">
<div class="roll_item_left">
<div class="roll_item_pic"></div>
<div class="roll_item_btn">人员追踪</div>
</div>
<div class="roll_item_right">
<div v-if="item.per_type == '1'" class="person_type one_type">
{{ item.type_text }}
</div>
<div
v-else-if="item.per_type == '2'"
class="person_type two_type"
>
{{ item.type_text }}
</div>
<div
v-else-if="item.per_type == '3'"
class="person_type three_type"
>
{{ item.type_text }}
</div>
<!-- 信息展示 -->
<div class="right_text">
<div class="right_text_item">人员姓名</div>
<div class="right_text_item">证件号码</div>
<div class="right_text_item">抓拍时间</div>
<div class="right_text_item">滞留时间</div>
<div class="right_text_item">抓拍地址</div>
</div>
<div class="right_value">
<div class="right_value_item">{{ item.person_name }}</div>
<div class="right_value_item" :title="item.id_card">
{{ item.id_card }}
</div>
<div class="right_value_item">{{ item.catch_time }}</div>
<div class="right_value_item" :title="item.state_time">
{{ item.state_time }}
</div>
<div class="right_value_item" :title="item.catch_address">
{{ item.catch_address }}
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'PersonCatch',
props: {
item: {
type: Object
}
},
data() {
return {
roll_list: [
{
text: '123',
per_type: '1',
type_text: '在逃人员',
person_name: '周大山',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1243',
per_type: '3',
type_text: '涉恐人员',
person_name: '王富强',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '12323',
per_type: '2',
type_text: '精神病人',
person_name: '赵磊',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1243',
per_type: '2',
type_text: '精神病人',
person_name: '徐永',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '2',
type_text: '精神病人',
person_name: '李文一',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '1',
type_text: '在逃人员',
person_name: '谭静',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1243',
per_type: '3',
type_text: '涉恐人员',
person_name: '孙洋洋',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '1',
type_text: '在逃人员',
person_name: '董磊',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
},
{
text: '1223',
per_type: '2',
type_text: '精神病人',
person_name: '郑廖',
catch_time: '2023-12-01 13:20:09',
id_card: '321287197606038965',
state_time: '4个小时',
catch_address: '江苏省射阳县海河镇革新村二组113号'
}
],
animateUp: false,
timer: null
}
},
mounted() {
this.timer = setInterval(this.scrollAnimate, 1500)
},
methods: {
//
scrollAnimate() {
this.animateUp = true
setTimeout(() => {
this.roll_list.push(this.roll_list[0])
this.roll_list.shift()
this.animateUp = false
}, 500)
}
}
}
</script>
<style lang="scss">
.capture {
width: 20vw;
height: 43vh;
.capture_title {
width: 20vw;
height: 4vh;
background-image: url('@/assets/picture/bg_small_title.png');
background-size: 100% auto;
background-repeat: no-repeat;
.capture_title_text {
margin-left: 3vw;
font-size: 16px;
font-family: PingFangSC, PingFang SC;
line-height: 4vh;
color: #edf1f7;
}
}
.capture_main {
display: flex;
align-items: center;
justify-content: center;
width: 20vw;
height: 40vh;
background-image: url('@/assets/picture/bg_5.png');
background-size: 100% 100%;
background-repeat: no-repeat;
.roll_body {
width: 20vw;
height: 39vh;
// background: #00f5ff;
overflow: hidden;
.marquee-list {
width: 20vw;
height: 39vh;
padding: 0px;
li {
margin-left: 2%;
margin-right: 2%;
width: 96%;
height: 15vh;
background: url('~@/assets/coastalMap/keyPerson/key_li_back.png')
no-repeat;
background-size: 100% 100%;
margin-top: 1vh;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
list-style: none;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
.roll_item_left {
width: 5vw;
height: 13vh;
.roll_item_pic {
width: 5vw;
height: 10vh;
background: #0b4672;
}
.roll_item_btn {
width: 5vw;
height: 3vh;
color: #fff;
background: #00f5ff;
font-size: 16px;
font-weight: 400;
text-align: center;
line-height: 3vh;
cursor: pointer;
background: url('~@/assets/coastalMap/keyPerson/key_li_btn.png')
no-repeat;
background-size: 100% 100%;
}
}
.roll_item_right {
width: 13vw;
height: 13vh;
position: relative;
display: flex;
.person_type {
position: absolute;
width: 3vw;
height: 2vh;
top: 0px;
right: 0px;
color: #061122;
text-align: center;
line-height: 2vh;
}
.one_type {
background: #ffc426;
}
.two_type {
background: #00f5ff;
}
.three_type {
background: #a357ff;
}
.right_text {
width: 5vw;
height: 13vh;
.right_text_item {
width: 5vw;
height: 2.6vh;
color: #ecf4f9;
font-size: 14px;
text-align: center;
line-height: 2.6vh;
}
}
.right_value {
width: 8vw;
height: 13vh;
.right_value_item {
width: 8vw;
height: 2.6vh;
color: #edf1f7;
font-size: 14px;
text-align: left;
line-height: 2.6vh;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
}
}
}
.animate-up {
transition: all 0.8s ease-in-out;
transform: translateY(-20vh);
}
}
}
}
</style>

@ -1,62 +0,0 @@
<!-- 通用抓拍 -->
<template>
<div class="capture">
<div class="capture_title">
<div class="capture_title_text">{{ item.title }}</div>
</div>
<div class="capture_main">
<MapScroll :item="item"></MapScroll>
</div>
</div>
</template>
<script>
import MapScroll from '@/components/MapScroll.vue'
export default {
name: 'PublicCatch',
components: { MapScroll },
props: {
item: {
type: Object
}
},
data() {
return {
// TODO props
}
}
}
</script>
<style lang="scss">
.capture {
width: 24vw;
height: 42vh;
.capture_title {
width: 24vw;
height: 4.5vh;
background-image: url('@/assets/picture/bg_small_title.png');
background-size: 100% auto;
background-repeat: no-repeat;
.capture_title_text {
margin-left: 3vw;
font-size: 0.8rem;
font-family: PingFangSC, PingFang SC;
line-height: 4.5vh;
color: #edf1f7;
}
}
.capture_main {
display: flex;
align-items: center;
justify-content: center;
width: 24vw;
height: 38vh;
background-image: url('@/assets/picture/bg_5.png');
background-size: 100% auto;
background-repeat: no-repeat;
}
}
</style>

@ -36,12 +36,12 @@
<div class="right"> <div class="right">
<!-- 右侧搜索区域 --> <!-- 右侧搜索区域 -->
<MapSearch></MapSearch> <MapSearch></MapSearch>
<!-- 通用抓拍 --> <!-- <div class="right_scroll"> -->
<PublicCatch <!-- 人脸抓拍 -->
v-for="item in carouselData" <PersonCatch></PersonCatch>
:key="item.id" <!-- 车辆抓拍 -->
:item="item" <CarCatch></CarCatch>
></PublicCatch> <!-- </div> -->
</div> </div>
</div> </div>
</template> </template>
@ -52,7 +52,8 @@ import MapSearch from './components/mapSearch.vue' // * 搜索组件
import ManCar from './components/mancarStatistics.vue' // * import ManCar from './components/mancarStatistics.vue' // *
import PeopleLarge from './components/peopleLarge.vue' // * import PeopleLarge from './components/peopleLarge.vue' // *
import CarLarge from './components/carLarge.vue' // * import CarLarge from './components/carLarge.vue' // *
import PublicCatch from './components/publicCatch.vue' // * import PersonCatch from './components/personCatch.vue' // *
import CarCatch from './components/carCatch.vue' // *
import DeviceLive from './components/deviceLive.vue' // * import DeviceLive from './components/deviceLive.vue' // *
export default { export default {
components: { components: {
@ -61,8 +62,9 @@ export default {
ManCar, ManCar,
PeopleLarge, PeopleLarge,
CarLarge, CarLarge,
PublicCatch, PersonCatch,
DeviceLive DeviceLive,
CarCatch
}, },
data() { data() {
return { return {
@ -72,7 +74,7 @@ export default {
{ id: 2, title: '车辆抓拍' } { id: 2, title: '车辆抓拍' }
], ],
title_text: '射阳沿海治安防控综合平台', title_text: '射阳沿海治安防控综合平台',
play: true play: false
} }
}, },
created() {}, created() {},
@ -159,31 +161,41 @@ export default {
height: 3.5vh; height: 3.5vh;
text-align: center; text-align: center;
color: #37fdc7; color: #37fdc7;
font-size: 1.5rem; font-size: 2.25rem;
font-weight: 600; font-weight: 700;
} }
} }
} }
} }
.left { .left {
display: flex;
flex-direction: column;
justify-content: space-between;
position: absolute; position: absolute;
top: 10vh; top: 10vh;
left: 1vw; left: 1vw;
width: 18vw; width: 20vw;
height: 89vh; height: 89vh;
z-index: 2; z-index: 2;
} }
.right { .right {
display: flex; // background-color: #f07474;
flex-direction: column;
justify-content: space-between;
position: absolute; position: absolute;
top: 10vh; top: 10vh;
right: 1vw; right: 1vw;
width: 24vw; width: 20vw;
height: 89vh; height: 89vh;
z-index: 2; z-index: 2;
display: flex;
flex-direction: column;
justify-content: space-between;
// .right_scroll {
// display: flex;
// flex-direction: column;
// justify-content: space-between;
// }
} }
} }
</style> </style>

@ -0,0 +1,195 @@
// * echarts 初始化方法
import * as echarts from 'echarts'
import EleResize from '@/utils/esresize'
export const init_echarts = () => {
// * echarts 实例
const myChart = echarts.init(document.getElementById('people_chart'))
let resize_div = document.getElementById('people_chart')
// *echarts表自适应
EleResize.on(resize_div, () => {
myChart.resize()
})
// * echarts 选项
myChart.setOption({
color: ['#80ffa5', '#00ddff', '#37a2ff', '#ffbf00'],
title: {
// text: '标题'
},
tooitip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
// data: ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['11-26', '11-27', '11-28', '11-29', '11-30', '12-01', '12-02']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
// name: 'Line 1',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(128, 255, 165)'
},
{
offset: 1,
color: 'rgb(1, 191, 236)'
}
])
},
emphasis: {
focus: 'series'
},
data: [140, 232, 101, 264, 90, 340, 250]
},
{
// name: 'Line 2',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(0, 221, 255)'
},
{
offset: 1,
color: 'rgb(77, 119, 255)'
}
])
},
emphasis: {
focus: 'series'
},
data: [120, 282, 111, 234, 220, 340, 310]
},
{
// name: 'Line 3',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(55, 162, 255)'
},
{
offset: 1,
color: 'rgb(116, 21, 219)'
}
])
},
emphasis: {
focus: 'series'
},
data: [320, 132, 201, 334, 190, 130, 220]
},
{
// name: 'Line 4',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(255, 0, 135)'
},
{
offset: 1,
color: 'rgb(135, 0, 157)'
}
])
},
emphasis: {
focus: 'series'
},
data: [220, 402, 231, 134, 190, 230, 120]
},
{
// name: 'Line 5',
type: 'line',
stack: 'Total',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
label: {
show: true,
position: 'top'
},
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(255, 191, 0)'
},
{
offset: 1,
color: 'rgb(224, 62, 76)'
}
])
},
emphasis: {
focus: 'series'
},
data: [220, 302, 181, 234, 210, 290, 150]
}
]
})
}

@ -2,10 +2,14 @@
<div id="map"></div> <div id="map"></div>
</template> </template>
<script> <script>
import { addSources, addImages, addLayers } from '../utils/deviceLayer'
export default { export default {
name: 'MapBody', name: 'MapBody',
data() { data() {
return {} return {
// *
mapContainer: null
}
}, },
mounted() { mounted() {
this.init_map() this.init_map()
@ -33,7 +37,13 @@ export default {
minZoom: 3, minZoom: 3,
projection: 'LATLON' projection: 'LATLON'
}) })
// // *
this.mapContainer.on('load', () => {
addSources(this.mapContainer)
addImages(this.mapContainer)
addLayers(this.mapContainer)
})
// *
this.mapContainer.on('moveend', () => { this.mapContainer.on('moveend', () => {
let bounds = this.mapContainer.getBounds() let bounds = this.mapContainer.getBounds()
let sw = bounds.getSouthWest() let sw = bounds.getSouthWest()

@ -62,6 +62,8 @@
<script> <script>
import MapPlayer from './components/livePlayer.vue' import MapPlayer from './components/livePlayer.vue'
import MapVideo from './components/mapVideo.vue' import MapVideo from './components/mapVideo.vue'
import { getDeviceListAPI } from '@/api/facility'
import { setDeviceLatlng } from '@/utils/latlng'
export default { export default {
components: { components: {
MapVideo, MapVideo,
@ -72,10 +74,30 @@ export default {
play: true, play: true,
// * // *
deviceName: '', deviceName: '',
title_text: '射阳沿海治安防控综合平台' // *
title_text: '射阳沿海治安防控综合平台',
// *
params: {
start: 0,
limit: 10000,
online: true
},
// *
channelList: []
} }
}, },
created() {
this.onGetDeviceListAPI()
},
methods: { methods: {
// *
async onGetDeviceListAPI() {
const res = await getDeviceListAPI(this.params)
this.channelList = res.ChannelList.filter((item) => item.Longitude !== 0)
console.log(this.channelList, '监控设备数据')
// *
setDeviceLatlng(this.channelList)
},
onUpdateClose() { onUpdateClose() {
console.log('关闭弹窗') console.log('关闭弹窗')
this.play = !this.play this.play = !this.play

@ -0,0 +1,69 @@
import { getDeviceLatlng } from '@/utils/latlng'
// * 获取本地存储中的监控经纬度信息
const deviceData = getDeviceLatlng()
// TODO 筛选监控经纬度
const device = deviceData.map((item) => ({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [item.Longitude, item.Latitude]
},
properties: {
channel: item.Channel,
// title: item.Name.toString()
// title: item.Name,
deviceName: item.Name
}
}))
// TODO 监控点聚合图层数据源
const devicePointData = {
type: 'FeatureCollection',
features: device
}
export const addImages = (minemap) => {
// TODO 自定义监控设备图片
minemap.loadImage(
require('@/assets/picture/point_sea_video.png'),
(error, image) => {
if (error) throw error
console.log(image, '图片')
minemap.addImage('device_image', image)
}
)
}
export const addSources = (minemap) => {
// * 监控数据源
minemap.addSource('device-point', {
type: 'geojson',
data: devicePointData,
cluster: true,
clusterMaxZoom: 15 /* 最大聚合层级 */,
clusterRadius: 50 /* 聚合半径 */
})
}
export const addLayers = (minemap) => {
// TODO 监控设备非聚合图层
minemap.addLayer({
id: 'device-points',
type: 'symbol',
// * 图层数据源 - 可以更改数据
source: 'device-point',
// * 图层过滤器
filter: ['!has', 'point_count'],
// * 图层布局样式
layout: {
'icon-image': 'device_image',
'icon-size': 0.5,
'text-field': ['get', 'title'],
'text-offset': [0, 0.6],
'text-anchor': 'top',
'text-size': 10,
// 'icon-allow-overlap': true, //图标允许压盖
'text-allow-overlap': true //图标覆盖文字允许压盖
}
})
}
Loading…
Cancel
Save