|
@@ -6,11 +6,7 @@ import { fullExtent, clearMap, calculation, changeMap, setCamera,
|
|
|
addBoats, addBoatHistory
|
|
|
} from '@/utils/map/ArcgisUtil'
|
|
|
|
|
|
-import {GetPjylLinePaths} from "@/apis/ssky";
|
|
|
-import {GetHpjShip} from "@/apis/ship";
|
|
|
-
|
|
|
-let showBoat = false;
|
|
|
-let djldInterval;
|
|
|
+import {GetPjylLinePaths, GetWaterFlightPoints} from "@/apis/ssky";
|
|
|
|
|
|
|
|
|
export function pjylLine(){
|
|
@@ -54,9 +50,8 @@ export function pjylLine(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
-export function pjylPortLocation(data){
|
|
|
+export function onePjylPortLocation(data){
|
|
|
|
|
|
let param = {
|
|
|
title: data.portName,
|
|
@@ -89,7 +84,6 @@ export function pjylPortLocation(data){
|
|
|
|
|
|
export function pjylPortHandle(res) {
|
|
|
let data = res.data[0].geometry.rings[0]
|
|
|
- console.log("浦江游览码头回调结果:"+data)
|
|
|
let params = {
|
|
|
type: 'line-3d',
|
|
|
data: data,
|
|
@@ -103,41 +97,83 @@ export function pjylPortHandle(res) {
|
|
|
addGraphic(params)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-export function djldShip(){
|
|
|
- if(!showBoat)
|
|
|
- showBoat = true
|
|
|
- onLocationDjldBoat()
|
|
|
- if(djldInterval!=null){
|
|
|
- clearInterval(djldInterval)
|
|
|
+
|
|
|
+export function oneDjldPortLocation(data){
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ title: data.portName,
|
|
|
+ type: 'point',
|
|
|
+ data:[data.mapx,data.mapy,20],
|
|
|
+ edit: false,
|
|
|
+ temp: true,
|
|
|
+ clear: false,
|
|
|
+ goto: true,
|
|
|
+ attributes: null,
|
|
|
+ symbol:{
|
|
|
+ "type": "picture-marker",
|
|
|
+ "url": "images/ssky/bgImgPort.png",
|
|
|
+ "width":"300px",
|
|
|
+ "height":"10px"
|
|
|
+ }
|
|
|
}
|
|
|
- djldInterval = setInterval(onLocationDjldBoat,10000)
|
|
|
+ addGraphic(param)
|
|
|
+
|
|
|
+ layerQuery({
|
|
|
+ title: "waterPassenger",
|
|
|
+ layerId: "1",
|
|
|
+ where: "码头名称='" + data.portName +"'",
|
|
|
+ symbol: null,
|
|
|
+ is_draw: true,
|
|
|
+ is_clear: false,
|
|
|
+ callback: "djldPortHandle"
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-export function onLocationDjldBoat(){
|
|
|
- GetHpjShip().then(res=>{
|
|
|
- let data = res.Result.data
|
|
|
- let boats = {
|
|
|
- "scale": 5000,
|
|
|
- "goto": false,
|
|
|
- "data": []
|
|
|
- }
|
|
|
- for(let i=0;i<data.length;i++){
|
|
|
- if(data[i].LINETYPE == 'djld'){
|
|
|
- let boat = {
|
|
|
- "mmsi": data[i].DEVICEID,
|
|
|
- "shipNameCn": data[i].BOATNAME,
|
|
|
- "shipTypeName": data[i].SHIPTYPENAME,
|
|
|
- "direction": data[i].DIRECTION,
|
|
|
- "velocity": data[i].VELOCITY,
|
|
|
- "shipBreadth": data[i].SHIPBREADTH,
|
|
|
- "shipLength": data[i].SHIPLENGTH,
|
|
|
- "mapx": data[i].MAPX,
|
|
|
- "mapy": data[i].MAPY
|
|
|
+
|
|
|
+export function djldPortHandle(res) {
|
|
|
+ let data = res.data[0].geometry.rings[0]
|
|
|
+ let params = {
|
|
|
+ type: 'line-3d',
|
|
|
+ data: data,
|
|
|
+ edit: false,
|
|
|
+ temp: true,
|
|
|
+ clear: false,
|
|
|
+ goto: true,
|
|
|
+ attributes: null,
|
|
|
+ title: null
|
|
|
+ }
|
|
|
+ addGraphic(params)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export function djldLine(lineName){
|
|
|
+ GetWaterFlightPoints({lineName:lineName}).then(res=>{
|
|
|
+ let rows = res.data.Rows;
|
|
|
+ for (let i=0;i<rows.length;i++){
|
|
|
+ let lineData = rows[i]
|
|
|
+ let linePoints = lineData.linePoint[0]
|
|
|
+ let points = []
|
|
|
+ for(let j=0;j<linePoints.length;j++){
|
|
|
+ let point = [Number(linePoints[j].x),Number(linePoints[j].y)]
|
|
|
+ points.push(point)
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ title: lineName,
|
|
|
+ type: 'polyline',
|
|
|
+ data: points,
|
|
|
+ edit: false,
|
|
|
+ temp: true,
|
|
|
+ clear: false,
|
|
|
+ goto: true,
|
|
|
+ attributes: null,
|
|
|
+ symbol: {
|
|
|
+ type: "simple-line",
|
|
|
+ color: [255, 0, 0],
|
|
|
+ width: 2
|
|
|
}
|
|
|
- boats.data.push(boat)
|
|
|
}
|
|
|
+
|
|
|
+ addGraphic(params)
|
|
|
}
|
|
|
- addBoats(boats)
|
|
|
})
|
|
|
}
|