|
@@ -9,77 +9,87 @@ import { fullExtent, clearMap, calculation, changeMap, setCamera,
|
|
|
import {GetPjylLinePaths, GetWaterFlightPoints} from "@/apis/ssky";
|
|
|
|
|
|
|
|
|
-export function pjylLine(){
|
|
|
- GetPjylLinePaths().then(res=>{
|
|
|
- for (let i=0;i<res.data.length;i++){
|
|
|
- let lineData = res.data[i]
|
|
|
- let linePoints = lineData.linePoints
|
|
|
- let points = []
|
|
|
- let first = []
|
|
|
- for(let j=0;j<linePoints.length;j++){
|
|
|
- let point = [Number(linePoints[j].x),Number(linePoints[j].y)]
|
|
|
- if(j==0){
|
|
|
- first = [Number(linePoints[j].x),Number(linePoints[j].y)]
|
|
|
+export function pjylLine(isShow){
|
|
|
+ if(isShow){
|
|
|
+ GetPjylLinePaths().then(res=>{
|
|
|
+ for (let i=0;i<res.data.length;i++){
|
|
|
+ let lineData = res.data[i]
|
|
|
+ let linePoints = lineData.linePoints
|
|
|
+ let points = []
|
|
|
+ let first = []
|
|
|
+ for(let j=0;j<linePoints.length;j++){
|
|
|
+ let point = [Number(linePoints[j].x),Number(linePoints[j].y)]
|
|
|
+ if(j==0){
|
|
|
+ first = [Number(linePoints[j].x),Number(linePoints[j].y)]
|
|
|
+ }
|
|
|
+ points.push(point)
|
|
|
}
|
|
|
- points.push(point)
|
|
|
- }
|
|
|
- points.push(first)
|
|
|
+ points.push(first)
|
|
|
|
|
|
- let params = {
|
|
|
-
|
|
|
- type: 'polygon',
|
|
|
- data: points,
|
|
|
- edit: false,
|
|
|
- temp: true,
|
|
|
- clear: false,
|
|
|
- goto: true,
|
|
|
- attributes: null,
|
|
|
- symbol: {
|
|
|
- type: "simple-fill",
|
|
|
- color: [50, 205, 50, 0.5],
|
|
|
-
|
|
|
- outline: {
|
|
|
- color: [255, 0, 0],
|
|
|
- width: 2
|
|
|
+ let params = {
|
|
|
+
|
|
|
+ type: 'polygon',
|
|
|
+ data: points,
|
|
|
+ edit: false,
|
|
|
+ temp: true,
|
|
|
+ clear: false,
|
|
|
+ goto: true,
|
|
|
+ attributes: null,
|
|
|
+ symbol: {
|
|
|
+ type: "simple-fill",
|
|
|
+ color: [50, 205, 50, 0.5],
|
|
|
+
|
|
|
+ outline: {
|
|
|
+ color: [255, 0, 0],
|
|
|
+ width: 2
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ addGraphic(params)
|
|
|
}
|
|
|
-
|
|
|
- addGraphic(params)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ clearMap({is_draw: false, is_search:true, layers: []})
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
-export function onePjylPortLocation(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"
|
|
|
+export function onePjylPortLocation(data,isShow){
|
|
|
+ if(isShow){
|
|
|
+
|
|
|
+ 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"
|
|
|
+ }
|
|
|
}
|
|
|
+ addGraphic(param)
|
|
|
+
|
|
|
+ layerQuery({
|
|
|
+ title: "waterPassenger",
|
|
|
+ layerId: "4",
|
|
|
+ where: "码头名称='" + data.portName +"'",
|
|
|
+ symbol: null,
|
|
|
+ is_draw: true,
|
|
|
+ is_clear: false,
|
|
|
+ callback: "pjylPortHandle"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ clearMap({is_draw: false, is_search:true, layers: []})
|
|
|
}
|
|
|
- addGraphic(param)
|
|
|
-
|
|
|
- layerQuery({
|
|
|
- title: "waterPassenger",
|
|
|
- layerId: "4",
|
|
|
- where: "码头名称='" + data.portName +"'",
|
|
|
- symbol: null,
|
|
|
- is_draw: true,
|
|
|
- is_clear: false,
|
|
|
- callback: "pjylPortHandle"
|
|
|
- })
|
|
|
+
|
|
|
}
|
|
|
|
|
|
export function pjylPortHandle(res) {
|
|
@@ -88,7 +98,6 @@ export function pjylPortHandle(res) {
|
|
|
type: 'line-3d',
|
|
|
data: data,
|
|
|
edit: false,
|
|
|
- temp: true,
|
|
|
clear: false,
|
|
|
goto: true,
|
|
|
attributes: null,
|
|
@@ -98,35 +107,38 @@ export function pjylPortHandle(res) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-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"
|
|
|
+export function oneDjldPortLocation(data,isShow){
|
|
|
+ if(isShow) {
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ title: data.portName,
|
|
|
+ type: 'point',
|
|
|
+ data: [data.mapx, data.mapy, 20],
|
|
|
+ edit: false,
|
|
|
+ clear: false,
|
|
|
+ goto: true,
|
|
|
+ attributes: null,
|
|
|
+ symbol: {
|
|
|
+ "type": "picture-marker",
|
|
|
+ "url": "images/ssky/bgImgPort.png",
|
|
|
+ "width": "300px",
|
|
|
+ "height": "10px"
|
|
|
+ }
|
|
|
}
|
|
|
+ addGraphic(param)
|
|
|
+
|
|
|
+ layerQuery({
|
|
|
+ title: "waterPassenger",
|
|
|
+ layerId: "1",
|
|
|
+ where: "码头名称='" + data.portName + "'",
|
|
|
+ symbol: null,
|
|
|
+ is_draw: true,
|
|
|
+ is_clear: false,
|
|
|
+ callback: "djldPortHandle"
|
|
|
+ })*/
|
|
|
+ }else{
|
|
|
+ clearMap({is_draw: false, is_search:true, layers: []})
|
|
|
}
|
|
|
- addGraphic(param)
|
|
|
-
|
|
|
- layerQuery({
|
|
|
- title: "waterPassenger",
|
|
|
- layerId: "1",
|
|
|
- where: "码头名称='" + data.portName +"'",
|
|
|
- symbol: null,
|
|
|
- is_draw: true,
|
|
|
- is_clear: false,
|
|
|
- callback: "djldPortHandle"
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
|
|
@@ -136,7 +148,6 @@ export function djldPortHandle(res) {
|
|
|
type: 'line-3d',
|
|
|
data: data,
|
|
|
edit: false,
|
|
|
- temp: true,
|
|
|
clear: false,
|
|
|
goto: true,
|
|
|
attributes: null,
|
|
@@ -146,34 +157,38 @@ export function djldPortHandle(res) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-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
|
|
|
+export function djldLine(lineName,isShow){
|
|
|
+ if(isShow){
|
|
|
+ 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,
|
|
|
+ clear: false,
|
|
|
+ goto: true,
|
|
|
+ attributes: null,
|
|
|
+ symbol: {
|
|
|
+ type: "simple-line",
|
|
|
+ color: [255, 255, 0],
|
|
|
+ width: 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ addGraphic(params)
|
|
|
}
|
|
|
-
|
|
|
- addGraphic(params)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ clearMap({is_draw: false, is_search:true, layers: []})
|
|
|
+ }
|
|
|
+
|
|
|
}
|