gisviewer-vue3-arcgis 1.0.272 → 1.0.273
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,21 +2,21 @@ import { Point as u } from "@arcgis/core/geometry";
|
|
|
2
2
|
import y from "@arcgis/core/Graphic";
|
|
3
3
|
import p from "@arcgis/core/layers/GraphicsLayer";
|
|
4
4
|
class C {
|
|
5
|
-
constructor(
|
|
6
|
-
this.iconSymbolScale = 1e4, this.largeMarkerScale = 4e4, this.oldScale = 0, this.showName = "detail", this.showStyle = "scatter", this.clusterRadius = 120, this.minClusterPoints = 2, this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.clusteredLocations = [], this.locations = [], this.view =
|
|
5
|
+
constructor(t) {
|
|
6
|
+
this.iconSymbolScale = 1e4, this.largeMarkerScale = 4e4, this.oldScale = 0, this.showName = "detail", this.showStyle = "scatter", this.clusterRadius = 120, this.minClusterPoints = 2, this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.clusteredLocations = [], this.locations = [], this.view = t, this.crossLayer = new p({
|
|
7
7
|
id: "signal-control-cross-layer",
|
|
8
8
|
title: "信控路口图层"
|
|
9
9
|
}), this.view.map.add(this.crossLayer);
|
|
10
10
|
}
|
|
11
|
-
didCrossScaleThreshold(
|
|
12
|
-
return
|
|
11
|
+
didCrossScaleThreshold(t, s, i) {
|
|
12
|
+
return t < i && s >= i || t >= i && s < i;
|
|
13
13
|
}
|
|
14
14
|
locationToScreen() {
|
|
15
|
-
this.clusteredLocations = [], this.locations.forEach((
|
|
15
|
+
this.clusteredLocations = [], this.locations.forEach((t) => {
|
|
16
16
|
const s = this.view.toScreen(
|
|
17
|
-
new u({ x:
|
|
17
|
+
new u({ x: t.x, y: t.y })
|
|
18
18
|
);
|
|
19
|
-
s.x > 0 && s.y > 0 && (
|
|
19
|
+
s.x > 0 && s.y > 0 && (t.properties.screenX = s.x, t.properties.screenY = s.y, t.visited = !1, t.clusterId = void 0, this.clusteredLocations.push(t));
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -24,55 +24,55 @@ class C {
|
|
|
24
24
|
* @param params
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
showSignalCross(
|
|
28
|
-
if (this.crossLayer.removeAll(), this.showName =
|
|
27
|
+
showSignalCross(t) {
|
|
28
|
+
if (this.crossLayer.removeAll(), this.showName = t.showName || "detail", this.showStyle = t.style || "scatter", this.oldScale = this.view.scale, this.scaleWatchHandle || (this.scaleWatchHandle = this.view.watch("stationary", () => {
|
|
29
29
|
if (this.showStyle === "scatter") {
|
|
30
|
-
const s = this.view.scale,
|
|
30
|
+
const s = this.view.scale, i = this.didCrossScaleThreshold(
|
|
31
31
|
this.oldScale,
|
|
32
32
|
s,
|
|
33
33
|
this.iconSymbolScale
|
|
34
|
-
),
|
|
34
|
+
), e = this.didCrossScaleThreshold(
|
|
35
35
|
this.oldScale,
|
|
36
36
|
s,
|
|
37
37
|
this.largeMarkerScale
|
|
38
38
|
);
|
|
39
|
-
(
|
|
39
|
+
(i || e) && this.updateScatterSymbol(), this.oldScale = s;
|
|
40
40
|
} else {
|
|
41
41
|
this.locationToScreen();
|
|
42
42
|
const s = this.doPixelCluster(this.clusterRadius);
|
|
43
43
|
this.showClusterResult(s);
|
|
44
44
|
}
|
|
45
45
|
})), this.showStyle === "scatter") {
|
|
46
|
-
const s =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const s = [], i = [];
|
|
47
|
+
t.points.forEach((e) => {
|
|
48
|
+
const r = this.getCrossSymbol(e), o = this.getBrandLabel(e.brand), a = this.getOnlineLabel(e.isOnline), l = this.getMalfunctionLabel(
|
|
49
|
+
e.isMalfunction
|
|
50
|
+
), n = new y({
|
|
51
51
|
geometry: {
|
|
52
52
|
type: "point",
|
|
53
|
-
longitude:
|
|
54
|
-
latitude:
|
|
53
|
+
longitude: e.x,
|
|
54
|
+
latitude: e.y
|
|
55
55
|
},
|
|
56
|
-
symbol:
|
|
56
|
+
symbol: r,
|
|
57
57
|
attributes: {
|
|
58
58
|
type: "signal-cross",
|
|
59
|
-
id:
|
|
60
|
-
brandLabel:
|
|
61
|
-
isOnlineLabel:
|
|
62
|
-
isMalfunctionLabel:
|
|
63
|
-
...
|
|
59
|
+
id: e.crossId,
|
|
60
|
+
brandLabel: o,
|
|
61
|
+
isOnlineLabel: a,
|
|
62
|
+
isMalfunctionLabel: l,
|
|
63
|
+
...e
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
|
|
67
|
-
this.crossLayer.addMany(s);
|
|
66
|
+
e.isMalfunction === !0 || e.isOnline === !1 ? i.push(n) : s.push(n);
|
|
67
|
+
}), this.crossLayer.addMany(s), this.crossLayer.addMany(i);
|
|
68
68
|
} else {
|
|
69
|
-
this.locations =
|
|
70
|
-
id:
|
|
71
|
-
x:
|
|
72
|
-
y:
|
|
69
|
+
this.locations = t.points.map((i) => ({
|
|
70
|
+
id: i.crossId,
|
|
71
|
+
x: i.x,
|
|
72
|
+
y: i.y,
|
|
73
73
|
visited: !1,
|
|
74
74
|
clusterId: void 0,
|
|
75
|
-
properties:
|
|
75
|
+
properties: i
|
|
76
76
|
})), this.locationToScreen();
|
|
77
77
|
const s = this.doPixelCluster(this.clusterRadius);
|
|
78
78
|
this.showClusterResult(s);
|
|
@@ -80,22 +80,22 @@ class C {
|
|
|
80
80
|
return { status: 0, message: "ok" };
|
|
81
81
|
}
|
|
82
82
|
clearSignalCross() {
|
|
83
|
-
var
|
|
84
|
-
this.crossLayer.removeAll(), (
|
|
83
|
+
var t;
|
|
84
|
+
this.crossLayer.removeAll(), (t = this.scaleWatchHandle) == null || t.remove(), this.scaleWatchHandle = null;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* 更改路口显示名称内容
|
|
88
88
|
* @param showName
|
|
89
89
|
*/
|
|
90
|
-
changeShowName(
|
|
91
|
-
this.showName =
|
|
90
|
+
changeShowName(t) {
|
|
91
|
+
this.showName = t, this.showStyle === "scatter" && this.updateScatterSymbol();
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* 更新散点符号
|
|
95
95
|
*/
|
|
96
96
|
updateScatterSymbol() {
|
|
97
|
-
this.crossLayer.graphics.forEach((
|
|
98
|
-
|
|
97
|
+
this.crossLayer.graphics.forEach((t) => {
|
|
98
|
+
t.symbol = this.getCrossSymbol(t.attributes);
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
@@ -105,17 +105,17 @@ class C {
|
|
|
105
105
|
* @param minPoints
|
|
106
106
|
* @returns
|
|
107
107
|
*/
|
|
108
|
-
doPixelCluster(
|
|
108
|
+
doPixelCluster(t) {
|
|
109
109
|
let s = 0;
|
|
110
|
-
for (let
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
110
|
+
for (let i = 0; i < this.clusteredLocations.length; i++) {
|
|
111
|
+
const e = this.clusteredLocations[i];
|
|
112
|
+
if (e.visited)
|
|
113
113
|
continue;
|
|
114
|
-
|
|
115
|
-
const r = this.getNeighbors(
|
|
116
|
-
r.length < this.minClusterPoints ?
|
|
114
|
+
e.visited = !0;
|
|
115
|
+
const r = this.getNeighbors(e, t);
|
|
116
|
+
r.length < this.minClusterPoints ? e.clusterId = -1 : (r.forEach((o) => {
|
|
117
117
|
o.visited = !0, o.clusterId = s;
|
|
118
|
-
}),
|
|
118
|
+
}), e.clusterId = s, s++);
|
|
119
119
|
}
|
|
120
120
|
return this.createClusters();
|
|
121
121
|
}
|
|
@@ -126,8 +126,8 @@ class C {
|
|
|
126
126
|
* @param eps
|
|
127
127
|
* @returns
|
|
128
128
|
*/
|
|
129
|
-
getNeighbors(
|
|
130
|
-
return this.clusteredLocations.filter((
|
|
129
|
+
getNeighbors(t, s) {
|
|
130
|
+
return this.clusteredLocations.filter((i) => i.id === t.id || i.visited ? !1 : this.getDistance(t, i) <= s);
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* 两点间的像素距离
|
|
@@ -135,9 +135,9 @@ class C {
|
|
|
135
135
|
* @param point2
|
|
136
136
|
* @returns
|
|
137
137
|
*/
|
|
138
|
-
getDistance(
|
|
138
|
+
getDistance(t, s) {
|
|
139
139
|
return Math.sqrt(
|
|
140
|
-
Math.pow(
|
|
140
|
+
Math.pow(t.properties.screenX - s.properties.screenX, 2) + Math.pow(t.properties.screenY - s.properties.screenY, 2)
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
@@ -146,13 +146,13 @@ class C {
|
|
|
146
146
|
* @returns
|
|
147
147
|
*/
|
|
148
148
|
createClusters() {
|
|
149
|
-
const
|
|
150
|
-
for (const
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
const o =
|
|
149
|
+
const t = {}, s = [];
|
|
150
|
+
for (const e of this.clusteredLocations)
|
|
151
|
+
e.clusterId === void 0 || e.clusterId === -1 ? s.push(e) : (t[e.clusterId] || (t[e.clusterId] = []), t[e.clusterId].push(e));
|
|
152
|
+
const i = Object.keys(t).map((e, r) => {
|
|
153
|
+
const o = t[Number(e)], a = o.length, l = o.reduce((c, h) => c + h.x, 0), n = o.reduce((c, h) => c + h.y, 0), m = l / a, d = n / a;
|
|
154
154
|
return {
|
|
155
|
-
id: Number(
|
|
155
|
+
id: Number(e),
|
|
156
156
|
items: o,
|
|
157
157
|
count: a,
|
|
158
158
|
center: {
|
|
@@ -161,26 +161,26 @@ class C {
|
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
});
|
|
164
|
-
return s.length > 0 &&
|
|
164
|
+
return s.length > 0 && i.push({
|
|
165
165
|
id: -1,
|
|
166
166
|
items: s,
|
|
167
167
|
count: s.length,
|
|
168
168
|
center: null
|
|
169
|
-
}),
|
|
169
|
+
}), i;
|
|
170
170
|
}
|
|
171
|
-
showClusterResult(
|
|
171
|
+
showClusterResult(t) {
|
|
172
172
|
this.crossLayer.removeAll();
|
|
173
|
-
let s = Number.MIN_VALUE,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}),
|
|
177
|
-
if (
|
|
178
|
-
let r =
|
|
173
|
+
let s = Number.MIN_VALUE, i = Number.MAX_VALUE;
|
|
174
|
+
t.forEach((e) => {
|
|
175
|
+
e.count > 1 && (i = Math.min(i, e.count), s = Math.max(s, e.count));
|
|
176
|
+
}), t.forEach((e) => {
|
|
177
|
+
if (e.id !== -1) {
|
|
178
|
+
let r = i === s ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (e.count - i) / (s - i) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
|
|
179
179
|
r *= 0.75;
|
|
180
|
-
const l = (
|
|
181
|
-
geometry: new u({ x:
|
|
180
|
+
const l = (e.count.toString().length * 8 + 6) / 2, n = new y({
|
|
181
|
+
geometry: new u({ x: e.center.x, y: e.center.y }),
|
|
182
182
|
attributes: {
|
|
183
|
-
count:
|
|
183
|
+
count: e.count
|
|
184
184
|
},
|
|
185
185
|
symbol: {
|
|
186
186
|
type: "cim",
|
|
@@ -292,7 +292,7 @@ class C {
|
|
|
292
292
|
});
|
|
293
293
|
this.crossLayer.add(n);
|
|
294
294
|
} else
|
|
295
|
-
|
|
295
|
+
e.items.forEach((r) => {
|
|
296
296
|
const o = new y({
|
|
297
297
|
geometry: new u({ x: r.x, y: r.y }),
|
|
298
298
|
attributes: {
|
|
@@ -307,21 +307,21 @@ class C {
|
|
|
307
307
|
});
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
getBrandLabel(
|
|
311
|
-
const s = (
|
|
312
|
-
return s === "scats" ? "SCATS" : s === "gc" ? "国产" :
|
|
310
|
+
getBrandLabel(t) {
|
|
311
|
+
const s = (t ?? "").toLowerCase();
|
|
312
|
+
return s === "scats" ? "SCATS" : s === "gc" ? "国产" : t ?? "";
|
|
313
313
|
}
|
|
314
|
-
getOnlineLabel(
|
|
315
|
-
return
|
|
314
|
+
getOnlineLabel(t) {
|
|
315
|
+
return t ? "在线" : "离线";
|
|
316
316
|
}
|
|
317
|
-
getMalfunctionLabel(
|
|
318
|
-
return
|
|
317
|
+
getMalfunctionLabel(t) {
|
|
318
|
+
return t ? "故障" : "正常";
|
|
319
319
|
}
|
|
320
|
-
getCrossSymbol(
|
|
321
|
-
var s;
|
|
320
|
+
getCrossSymbol(t) {
|
|
321
|
+
var s, i;
|
|
322
322
|
if (this.view.scale <= this.iconSymbolScale) {
|
|
323
|
-
let
|
|
324
|
-
return
|
|
323
|
+
let e = "/GisViewerAssets/Images/cross/ic_";
|
|
324
|
+
return e += ((s = t.brand) == null ? void 0 : s.toLowerCase()) === "scats" ? "scats_" : "gc_", e += t.isOnline ? "online_" : "offline_", e += t.isMalfunction ? "malfunction.png" : "normal.png", {
|
|
325
325
|
type: "cim",
|
|
326
326
|
data: {
|
|
327
327
|
type: "CIMSymbolReference",
|
|
@@ -401,20 +401,20 @@ class C {
|
|
|
401
401
|
size: 20,
|
|
402
402
|
rotateClockwise: !0,
|
|
403
403
|
textureFilter: "Picture",
|
|
404
|
-
url:
|
|
404
|
+
url: e
|
|
405
405
|
}
|
|
406
406
|
]
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
};
|
|
410
410
|
} else {
|
|
411
|
-
const
|
|
411
|
+
const e = {
|
|
412
412
|
type: "simple-marker",
|
|
413
413
|
style: "circle",
|
|
414
414
|
size: this.view.scale > this.largeMarkerScale ? 3 : 6,
|
|
415
415
|
outline: { width: 1 }
|
|
416
416
|
};
|
|
417
|
-
return ((
|
|
417
|
+
return ((i = t.brand) == null ? void 0 : i.toLowerCase()) === "scats" ? t.isOnline ? (e.color = [68, 203, 188], e.outline.color = [59, 176, 163]) : (e.color = [100, 100, 100], e.outline.color = [150, 150, 150]) : t.isOnline ? (e.color = [129, 226, 73], e.outline.color = [108, 189, 61]) : (e.color = [100, 100, 100], e.outline.color = [150, 150, 150]), e;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/geometry"),y=require("@arcgis/core/Graphic"),p=require("@arcgis/core/layers/GraphicsLayer");class S{constructor(
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/geometry"),y=require("@arcgis/core/Graphic"),p=require("@arcgis/core/layers/GraphicsLayer");class S{constructor(t){this.iconSymbolScale=1e4,this.largeMarkerScale=4e4,this.oldScale=0,this.showName="detail",this.showStyle="scatter",this.clusterRadius=120,this.minClusterPoints=2,this.maxClusterSymbolSize=50,this.minClusterSymbolSize=25,this.clusteredLocations=[],this.locations=[],this.view=t,this.crossLayer=new p({id:"signal-control-cross-layer",title:"信控路口图层"}),this.view.map.add(this.crossLayer)}didCrossScaleThreshold(t,s,i){return t<i&&s>=i||t>=i&&s<i}locationToScreen(){this.clusteredLocations=[],this.locations.forEach(t=>{const s=this.view.toScreen(new u.Point({x:t.x,y:t.y}));s.x>0&&s.y>0&&(t.properties.screenX=s.x,t.properties.screenY=s.y,t.visited=!1,t.clusterId=void 0,this.clusteredLocations.push(t))})}showSignalCross(t){if(this.crossLayer.removeAll(),this.showName=t.showName||"detail",this.showStyle=t.style||"scatter",this.oldScale=this.view.scale,this.scaleWatchHandle||(this.scaleWatchHandle=this.view.watch("stationary",()=>{if(this.showStyle==="scatter"){const s=this.view.scale,i=this.didCrossScaleThreshold(this.oldScale,s,this.iconSymbolScale),e=this.didCrossScaleThreshold(this.oldScale,s,this.largeMarkerScale);(i||e)&&this.updateScatterSymbol(),this.oldScale=s}else{this.locationToScreen();const s=this.doPixelCluster(this.clusterRadius);this.showClusterResult(s)}})),this.showStyle==="scatter"){const s=[],i=[];t.points.forEach(e=>{const r=this.getCrossSymbol(e),o=this.getBrandLabel(e.brand),n=this.getOnlineLabel(e.isOnline),l=this.getMalfunctionLabel(e.isMalfunction),a=new y({geometry:{type:"point",longitude:e.x,latitude:e.y},symbol:r,attributes:{type:"signal-cross",id:e.crossId,brandLabel:o,isOnlineLabel:n,isMalfunctionLabel:l,...e}});e.isMalfunction===!0||e.isOnline===!1?i.push(a):s.push(a)}),this.crossLayer.addMany(s),this.crossLayer.addMany(i)}else{this.locations=t.points.map(i=>({id:i.crossId,x:i.x,y:i.y,visited:!1,clusterId:void 0,properties:i})),this.locationToScreen();const s=this.doPixelCluster(this.clusterRadius);this.showClusterResult(s)}return{status:0,message:"ok"}}clearSignalCross(){var t;this.crossLayer.removeAll(),(t=this.scaleWatchHandle)==null||t.remove(),this.scaleWatchHandle=null}changeShowName(t){this.showName=t,this.showStyle==="scatter"&&this.updateScatterSymbol()}updateScatterSymbol(){this.crossLayer.graphics.forEach(t=>{t.symbol=this.getCrossSymbol(t.attributes)})}doPixelCluster(t){let s=0;for(let i=0;i<this.clusteredLocations.length;i++){const e=this.clusteredLocations[i];if(e.visited)continue;e.visited=!0;const r=this.getNeighbors(e,t);r.length<this.minClusterPoints?e.clusterId=-1:(r.forEach(o=>{o.visited=!0,o.clusterId=s}),e.clusterId=s,s++)}return this.createClusters()}getNeighbors(t,s){return this.clusteredLocations.filter(i=>i.id===t.id||i.visited?!1:this.getDistance(t,i)<=s)}getDistance(t,s){return Math.sqrt(Math.pow(t.properties.screenX-s.properties.screenX,2)+Math.pow(t.properties.screenY-s.properties.screenY,2))}createClusters(){const t={},s=[];for(const e of this.clusteredLocations)e.clusterId===void 0||e.clusterId===-1?s.push(e):(t[e.clusterId]||(t[e.clusterId]=[]),t[e.clusterId].push(e));const i=Object.keys(t).map((e,r)=>{const o=t[Number(e)],n=o.length,l=o.reduce((c,h)=>c+h.x,0),a=o.reduce((c,h)=>c+h.y,0),m=l/n,d=a/n;return{id:Number(e),items:o,count:n,center:{x:m,y:d}}});return s.length>0&&i.push({id:-1,items:s,count:s.length,center:null}),i}showClusterResult(t){this.crossLayer.removeAll();let s=Number.MIN_VALUE,i=Number.MAX_VALUE;t.forEach(e=>{e.count>1&&(i=Math.min(i,e.count),s=Math.max(s,e.count))}),t.forEach(e=>{if(e.id!==-1){let r=i===s?(this.maxClusterSymbolSize+this.minClusterSymbolSize)/2:this.minClusterSymbolSize+(e.count-i)/(s-i)*(this.maxClusterSymbolSize-this.minClusterSymbolSize);r*=.75;const l=(e.count.toString().length*8+6)/2,a=new y({geometry:new u.Point({x:e.center.x,y:e.center.y}),attributes:{count:e.count},symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.count",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:r,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-l,40],[l,40],[l,20],[-l,20],[-l,40]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[2,72,200,255]},{type:"CIMSolidStroke",enable:!0,width:5,color:[2,72,200,128]}]}},{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:r,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}});this.crossLayer.add(a)}else e.items.forEach(r=>{const o=new y({geometry:new u.Point({x:r.x,y:r.y}),attributes:{...r,...r.properties,type:"signal-cross",id:r.id},symbol:this.getCrossSymbol(r.properties)});this.crossLayer.add(o)})})}getBrandLabel(t){const s=(t??"").toLowerCase();return s==="scats"?"SCATS":s==="gc"?"国产":t??""}getOnlineLabel(t){return t?"在线":"离线"}getMalfunctionLabel(t){return t?"故障":"正常"}getCrossSymbol(t){var s,i;if(this.view.scale<=this.iconSymbolScale){let e="/GisViewerAssets/Images/cross/ic_";return e+=((s=t.brand)==null?void 0:s.toLowerCase())==="scats"?"scats_":"gc_",e+=t.isOnline?"online_":"offline_",e+=t.isMalfunction?"malfunction.png":"normal.png",{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:this.showName==="crossName"?'Replace($feature.name, "与", "/")':this.showName==="signalId"?"$feature.signalId":'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:25,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:e}]}}}}else{const e={type:"simple-marker",style:"circle",size:this.view.scale>this.largeMarkerScale?3:6,outline:{width:1}};return((i=t.brand)==null?void 0:i.toLowerCase())==="scats"?t.isOnline?(e.color=[68,203,188],e.outline.color=[59,176,163]):(e.color=[100,100,100],e.outline.color=[150,150,150]):t.isOnline?(e.color=[129,226,73],e.outline.color=[108,189,61]):(e.color=[100,100,100],e.outline.color=[150,150,150]),e}}}exports.default=S;
|