|
@@ -2,11 +2,13 @@
|
|
|
* 船舶地图组件功能,通过调用封装好的基础地图组件实现特定业务功能
|
|
|
*/
|
|
|
import { fullExtent, clearMap, calculation, changeMap, setCamera,
|
|
|
- layerControl, layerQuery, addGraphic, draw, getDrawGeometry,
|
|
|
+ layerControl, layerQuery, addGraphic, draw, getDrawResult,
|
|
|
addBoats, setBoatHistory, playBoatHistory, clearBoatHistory,
|
|
|
+ openBoatDriving,closeBoatDriving,setAreaBoatHistory, playMultiBoatHistory,
|
|
|
getMapScale
|
|
|
} from '@/utils/map/ArcgisUtil'
|
|
|
-import {GetHpjShip,GetBoatAISHistoryByMMSI} from "@/apis/ship";
|
|
|
+import {GetHpjShip,GetBoatAISHistoryByMMSI,GetShipHistoryByArea} from "@/apis/ship";
|
|
|
+import {setCenter} from '@/utils/map/Common'
|
|
|
import {nextTick} from "vue";
|
|
|
import bus from "@/utils/bus";
|
|
|
|
|
@@ -44,7 +46,7 @@ export function locationBoat(mmsi,isShow){
|
|
|
})
|
|
|
}else{
|
|
|
if (!showBoat){
|
|
|
- clearMap({is_draw: false, is_search:false, layers: ['boatLayer']})
|
|
|
+ clearMap({is_draw: false, is_search:false, layers: ['boatLayer','boatPathLayer','boatGraphicLayer']})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -70,7 +72,7 @@ export function setBoat(isShow){
|
|
|
if (boatInterval != null) {
|
|
|
clearInterval(boatInterval)
|
|
|
}
|
|
|
- clearMap({is_draw: false, is_search:true, layers: ['boatLayer','boatPathLayer']})
|
|
|
+ clearMap({is_draw: false, is_search:true, layers: ['boatLayer','boatPathLayer','boatGraphicLayer']})
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -123,9 +125,12 @@ export function setBoatPath(data){
|
|
|
let historyPoints=[]
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
let boat = {
|
|
|
- "gpsTime": data[i].GPSTIME,
|
|
|
+ "mmsi": data[i].DEVICEID,
|
|
|
"mapx": data[i].MAPX,
|
|
|
- "mapy": data[i].MAPY
|
|
|
+ "mapy": data[i].MAPY,
|
|
|
+ "direction": data[i].DIRECTION,
|
|
|
+ "shipTypeName": data[i].SHIPTYPENAME,
|
|
|
+ "gpsTime": data[i].GPSTIME
|
|
|
}
|
|
|
historyPoints.push(boat)
|
|
|
}
|
|
@@ -155,4 +160,54 @@ bus.on('playBoatHistoryPath', (type) => {
|
|
|
export function clearBoatHistoryPath(){
|
|
|
console.log('清除船舶')
|
|
|
clearBoatHistory()
|
|
|
+ clearMap({is_draw: true, is_search:true, layers: ['boatLayer','boatPathLayer','boatGraphicLayer']})
|
|
|
+}
|
|
|
+
|
|
|
+export function drawArea(){
|
|
|
+ draw('polygon');
|
|
|
+}
|
|
|
+
|
|
|
+export function setMultiBoatHistory(startTime,endTime){
|
|
|
+ let drawResult = getDrawResult()
|
|
|
+ GetShipHistoryByArea({
|
|
|
+ "minMapx": drawResult.extent.xmin,
|
|
|
+ "minMapy": drawResult.extent.ymin,
|
|
|
+ "maxMapx": drawResult.extent.xmax,
|
|
|
+ "maxMapy": drawResult.extent.ymax,
|
|
|
+ "startTime": startTime,
|
|
|
+ "endTime": endTime
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code === "200"){
|
|
|
+ if(res.data){
|
|
|
+ if(res.data.Rows){
|
|
|
+ setAreaBoatHistory({
|
|
|
+ startTime: startTime,
|
|
|
+ endTime: endTime,
|
|
|
+ datas:res.data.Rows
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/***
|
|
|
+ * 多船轨迹回放
|
|
|
+ * @param type
|
|
|
+ */
|
|
|
+export function playAreaBoatHistory(type){
|
|
|
+ playMultiBoatHistory(type);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 模拟驾驶
|
|
|
+ * */
|
|
|
+export function boatDriving(isShow){
|
|
|
+ if(isShow){
|
|
|
+ openBoatDriving({mapx: 2100,mapy: 220})
|
|
|
+ }else{
|
|
|
+ closeBoatDriving()
|
|
|
+ clearMap({is_draw: false, is_search:true, layers: ['boatLayer','boatPathLayer','boatGraphicLayer']})
|
|
|
+ setCenter()
|
|
|
+ }
|
|
|
}
|