更新了画地图轨迹的功能

master
oldsheeppp 2024-10-24 23:15:35 +08:00
parent b3f7ebf06a
commit 646442dc69
3 changed files with 91 additions and 106 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -79,7 +79,7 @@
<!-- 点击弹窗轨迹地图 --> <!-- 点击弹窗轨迹地图 -->
<el-dialog <el-dialog
v-model="dialogVisibleLocusMap" v-model="dialogVisibleLocusMap"
title="asdf" title="轨迹地图"
width="70%" width="70%"
> >
<div style="position: relative; display: flex; flex-direction: row; box-shadow: 0px 0px 10px rgba(0,0,0,0.2); padding:10px; border-radius: 8px; align-items: center; background-color: rgba(128,128,128,0.2);"> <div style="position: relative; display: flex; flex-direction: row; box-shadow: 0px 0px 10px rgba(0,0,0,0.2); padding:10px; border-radius: 8px; align-items: center; background-color: rgba(128,128,128,0.2);">
@ -96,24 +96,14 @@
<div style=" height: 50vh; width: 30vh; margin-left: 2%;" > <div style=" height: 50vh; width: 30vh; margin-left: 2%;" >
<div><img src="@/assets/TargetPerson.jpg" style="width: 40%; margin: 0.2%;"/></div> <div><img src="@/assets/TargetPerson.jpg" style="width: 40%; margin: 0.2%;"/></div>
<!-- <div style="color:rgb(255,255,255);"> <span>序号</span> <span>{{currentPerson.id}}</span></div>
<div style="color:rgb(255,255,255);"><span>行人检索ID</span> <span>{{currentPerson.Person_ID}}</span></div>
<div style="color:rgb(255,255,255);"><span>初次出现地点</span> <span>{{currentPerson.location}}</span></div>
<div style="color:rgb(255,255,255);"><span>报警类型</span> <span>{{currentPerson.Alarm_type}}</span></div>
<div style="color:rgb(255,255,255);"><span>行人类别</span> <span>{{currentPerson.Person_pool}}</span></div>
<div style="color:rgb(255,255,255);"><span>初次出现时间</span> <span>{{currentPerson.time}}</span></div>
<div style="color:rgb(255,255,255);"><span>摄像头IP</span> <span>{{currentPerson.IP}}</span></div>
<div style="color:rgb(255,255,255);"><span>处理进度</span> <span>{{currentPerson.type}}</span></div> -->
<div> <span>序号</span> <span>{{currentPerson.id}}</span></div> <div> <span>序号</span> <span>{{currentPerson.id}}</span></div>
<div><span>行人检索ID: </span> <span>{{currentPerson.Person_ID}}</span></div> <div><span>行人检索ID: </span> <span>{{currentPerson.person_id}}</span></div>
<div><span>初次出现地点: </span> <span>{{currentPerson.location}}</span></div> <div><span>出现地点: </span> <span>{{currentPerson.address}}</span></div>
<div><span>报警类型: </span> <span>{{currentPerson.Alarm_type}}</span></div> <div><span>报警类型: </span> <span>{{currentPerson.alarm_type}}</span></div>
<div><span>行人类别: </span> <span>{{currentPerson.Person_pool}}</span></div> <div><span>行人类别: </span> <span>{{currentPerson.person_type}}</span></div>
<div><span>初次出现时间: </span> <span>{{currentPerson.time}}</span></div> <div><span>出现时间: </span> <span>{{currentPerson.detect_time}}</span></div>
<div><span>摄像头IP: </span> <span>{{currentPerson.IP}}</span></div> <div><span>摄像头IP: </span> <span>{{currentPerson.ip_address}}</span></div>
<div><span>处理进度: </span> <span>{{currentPerson.type}}</span></div> <div><span>处理进度: </span> <span>{{currentPerson.process_status}}</span></div>
<p>{{currentPerson.locus[0].lng}}</p>
</div> </div>
</div> </div>
@ -121,13 +111,14 @@
<!-- 使用for循环嵌套轨迹 --> <!-- 使用for循环嵌套轨迹 -->
<div style="height: 6vh; margin-top: 2%; "> <div style="height: 6vh; margin-top: 2%; ">
<el-steps :active="active" finish-status="success" align-center > <el-steps :active="active" finish-status="success" align-center >
<el-step :title="currentPerson.locus[0].lng" description="IP192.168.205.251"/> <!-- <el-step :title="currentPerson.locus[0].lng" description="IP192.168.205.251"/>
<el-step title="深研院-2号楼-3楼" description="IP192.168.205.252"/> <el-step title="深研院-2号楼-3楼" description="IP192.168.205.252"/>
<el-step title="深研院-2号楼-室外" description="IP: 192.168.11.46"/> <el-step title="深研院-2号楼-室外" description="IP: 192.168.11.46"/>
<el-step title="深研院-2号楼-室外" description="IP: 192.168.11.46"/> <el-step title="深研院-2号楼-室外" description="IP: 192.168.11.46"/> -->
<!-- <template :v-for="(item, index) in currentPerson.locus" :v-for="item in currentPerson.locus"> <el-step v-for="(item) in TrajectoryData"
<el-step :title="item.IP" description="IP: 192.168.11.46"/> :title="item.address"
</template> --> :description="item.ip">
</el-step>
<!-- <el-step :title="item.IP" :description="item.lng"></el-step> --> <!-- <el-step :title="item.IP" :description="item.lng"></el-step> -->
</el-steps> </el-steps>
<el-button type="primary" style="margin-top: 12px" @click="next"></el-button> <el-button type="primary" style="margin-top: 12px" @click="next"></el-button>
@ -166,7 +157,7 @@
import TargetPerson from '../../public/TargetPerson.json'; import TargetPerson from '../../public/TargetPerson.json';
import localMarkerIcon from '@/assets/TargetPerson.jpg' // import localMarkerIcon from '@/assets/hit0.png' //
import axios from 'axios'; import axios from 'axios';
@ -213,6 +204,7 @@
let isLoaded = false let isLoaded = false
let RecordsData = ref(null) let RecordsData = ref(null)
let TrajectoryData = ref([])
///////////////////////////////////////// ///////////////////////////////////////// ///////////////////////////////////////// /////////////////////////////////////////
// //
@ -325,6 +317,43 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////// /////////////////////////////////////////
//
const handleClick = (row) => {
axios.get('http://localhost:8080/trajectory', {
params: {
id: row.trajectory_detection_id
}
})
.then(response => {
if (response.data.code === 200) {
TrajectoryData.value = response.data.data.cameraArray;
} else {
console.error("Failed to fetch trajectory");
}
console.log("getData", TrajectoryData);
})
.catch(error => {
console.error('wrong:', error);
});
// proxyrowproxy
currentPerson.value = JSON.parse(JSON.stringify(row));
console.log(row);
console.log(currentPerson.value);
// :
dialogVisibleLocusMap.value = true;
setTimeout(() => {
initMapMark();
},1000);
}
///////////////////////////////////////// /////////////////////////////////////////
// //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
let locusMap; let locusMap;
@ -334,7 +363,8 @@
const initMapMark = () => { const initMapMark = () => {
// //
locusMap = new BMapGL.Map("locusMap"); // ID locusMap = new BMapGL.Map("locusMap"); // ID
let point = new BMapGL.Point(104.10,30.68); // // TODO:
let point = new BMapGL.Point(104.10,30.68); //
locusMap.centerAndZoom(point, 17); // locusMap.centerAndZoom(point, 17); //
locusMap.enableScrollWheelZoom(point, 35); // 3-19 locusMap.enableScrollWheelZoom(point, 35); // 3-19
// let opts = {offset: new BMap.Size(10, 10)}; // (offset: new BMap.Size(0, 0)) // let opts = {offset: new BMap.Size(10, 10)}; // (offset: new BMap.Size(0, 0))
@ -347,33 +377,12 @@
// map.addTileLayer(traffic); // // map.addTileLayer(traffic); //
// map.setTrafficOn(); // https://inhami.com/blogdetail/82 // map.setTrafficOn(); // https://inhami.com/blogdetail/82
axios.get('http://localhost:8080/detection/List', {
params: {
limit: PageSize.value,
offset: 1
}
})
.then(response => {
if (response.data.code === 200) {
RecordsData.value = response.data.data.detectionRecord;
totalCount = response.data.data.count;
isLoaded = true;
} else {
console.error("Failed to fetch records");
}
console.log("getData", RecordsData);
})
.catch(error => {
console.error('wrong:', error);
});
// //
let pointLocus = []; let pointLocus = [];
for (var i = 0; i < currentPerson.value.locus.length; i++) {
// console.log(currentPerson.value); for (var i = 0; i < TrajectoryData.value.length; i++) {
// console.log(currentPerson.value.locus[0].lng); pointLocus.push(new BMapGL.Point(TrajectoryData.value[i].lat, TrajectoryData.value[i].lng));
pointLocus.push(new BMapGL.Point(currentPerson.value.locus[i].lng, currentPerson.value.locus[i].lat));
} }
// var icons = new BMap.IconSequence(symbol, '100%', '10%',true);//true // var icons = new BMap.IconSequence(symbol, '100%', '10%',true);//true
@ -387,41 +396,9 @@
// icons:[icons] // icons:[icons]
}); });
// 线
//
//
// var symbol = new BMap.Symbol(BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, {
// scale: 0.6, //
// rotation: 120, //
// strokeColor: '#f00', //
// strokeWeight: 2, //
// fillColor: '#00f', //
// fillOpacity: 0.8 //
// // scale: 0.6,//
// // strokeColor:'#fff',//线
// // strokeWeight: 2,//线
// })
// // 线
// pl.setStrokeStyle({symbol: symbol});
//
bmaps.value = locusMap;
pls.value = pl;
locusMap.setHeading(64.5);
locusMap.setTilt(73);
//
trackAni = new BMapGLLib.TrackAnimation(bmaps.value, pls.value, {
overallView: true,
tilt: 30,
duration: 20000,
delay: 300
});
setTimeout(start(), 30000);
//for //for
for (var i = 0; i < currentPerson.value.locus.length; i++) { for (var i = 0; i < TrajectoryData.value.length; i++) {
let currentPoint = new BMapGL.Point(currentPerson.value.locus[i].lng,currentPerson.value.locus[i].lat); let currentPoint = new BMapGL.Point(TrajectoryData.value[i].lat,TrajectoryData.value[i].lng);
let localIcon = new BMapGL.Icon(localMarkerIcon, new BMapGL.Size(31, 64)) let localIcon = new BMapGL.Icon(localMarkerIcon, new BMapGL.Size(31, 64))
let localMarker = new BMapGL.Marker(currentPoint ,{ icon: localIcon }) let localMarker = new BMapGL.Marker(currentPoint ,{ icon: localIcon })
@ -437,7 +414,7 @@
// //
// var label = new BMap.Label('使JSAPI GL', opts) // var label = new BMap.Label('使JSAPI GL', opts)
let innerLabel = "<p>" + currentPerson.value.locus[i].address +"</p> <p>"+ currentPerson.value.locus[i].IP +"</p>" let innerLabel = "<p>" + TrajectoryData.value[i].address +"</p> <p>"+ TrajectoryData.value[i].ip +"</p>"
let label = new BMapGL.Label(innerLabel, opts) let label = new BMapGL.Label(innerLabel, opts)
// //
label.setStyle({ label.setStyle({
@ -454,7 +431,19 @@
locusMap.addOverlay(label) locusMap.addOverlay(label)
} }
//
bmaps.value = locusMap;
pls.value = pl;
locusMap.setHeading(64.5);
locusMap.setTilt(73);
//
trackAni = new BMapGLLib.TrackAnimation(bmaps.value, pls.value, {
overallView: true,
tilt: 30,
duration: 5000,
delay: 300
});
setTimeout(start(), 3000);
} }
// //
const start = () => { const start = () => {
@ -540,24 +529,24 @@
} }
} }
///////////////////////////////////////// /////////////////////////////////////////
//
const handleClick = (row) => {
// proxyrowproxy
currentPerson.value = JSON.parse(JSON.stringify(row));
console.log(row);
console.log(currentPerson.value);
// :
dialogVisibleLocusMap.value = true;
setTimeout(() => {
initMapMark();
},0);
}
///////////////////////////////////////// /////////////////////////////////////////
// 线
//
//
// var symbol = new BMap.Symbol(BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, {
// scale: 0.6, //
// rotation: 120, //
// strokeColor: '#f00', //
// strokeWeight: 2, //
// fillColor: '#00f', //
// fillOpacity: 0.8 //
// // scale: 0.6,//
// // strokeColor:'#fff',//线
// // strokeWeight: 2,//线
// })
// // 线
// pl.setStrokeStyle({symbol: symbol});
///////////////////////////////////////// ///////////////////////////////////////// ///////////////////////////////////////// /////////////////////////////////////////

View File

@ -271,16 +271,12 @@
if (cameraClick.type == "folder") { if (cameraClick.type == "folder") {
for (let i = 0; i < ShowCameraData.child.length; i++) { for (let i = 0; i < ShowCameraData.child.length; i++) {
if (cameraClick.child[i].type == "camera") { if (cameraClick.child[i].type == "camera") {
console.log("zhaodaole", cameraClick)
ShowCameraData.value.push(cameraClick) ShowCameraData.value.push(cameraClick)
} }
} }
} else { } else {
console.log("bushiwozhixinglea")
ShowCameraData.value.push(cameraClick) ShowCameraData.value.push(cameraClick)
} }
console.log("what we getcam", ShowCameraData.value) console.log("what we getcam", ShowCameraData.value)
// Vue.set(demoData) // Vue.set(demoData)