gisviewer-vue3-arcgis 1.0.142 → 1.0.144

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.
Files changed (35) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +0 -17
  2. package/es/src/gis-map/gis-map.vue.mjs +113 -118
  3. package/es/src/gis-map/index.d.ts +0 -17
  4. package/es/src/gis-map/stores/appData.d.ts +1 -0
  5. package/es/src/gis-map/stores/appData.mjs +2 -1
  6. package/es/src/gis-map/utils/map-initializer.mjs +6 -6
  7. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +231 -215
  8. package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +3 -3
  9. package/es/src/gis-map/utils/sketchView.d.ts +14 -14
  10. package/es/src/gis-map/utils/sketchView.mjs +173 -164
  11. package/es/src/gis-map/utils/sketchViewTool.d.ts +16 -16
  12. package/es/src/gis-map/utils/sketchViewTool.mjs +39 -39
  13. package/es/style.css +1 -1
  14. package/lib/src/gis-map/gis-map.vue.d.ts +0 -17
  15. package/lib/src/gis-map/gis-map.vue.js +1 -1
  16. package/lib/src/gis-map/index.d.ts +0 -17
  17. package/lib/src/gis-map/stores/appData.d.ts +1 -0
  18. package/lib/src/gis-map/stores/appData.js +1 -1
  19. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  20. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  21. package/lib/src/gis-map/utils/sketchView.d.ts +14 -14
  22. package/lib/src/gis-map/utils/sketchView.js +1 -1
  23. package/lib/src/gis-map/utils/sketchViewTool.d.ts +16 -16
  24. package/lib/src/gis-map/utils/sketchViewTool.js +1 -1
  25. package/package.json +1 -1
  26. package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
  27. package/es/src/gis-map/utils/components/sketch-tool.vue.d.ts +0 -18
  28. package/es/src/gis-map/utils/components/sketch-tool.vue.mjs +0 -7
  29. package/es/src/gis-map/utils/components/sketch-tool.vue2.mjs +0 -48
  30. package/es/src/gis-map/utils/components/sketch-tool.vue3.mjs +0 -4
  31. package/lib/_virtual/_plugin-vue_export-helper.js +0 -1
  32. package/lib/src/gis-map/utils/components/sketch-tool.vue.d.ts +0 -18
  33. package/lib/src/gis-map/utils/components/sketch-tool.vue.js +0 -1
  34. package/lib/src/gis-map/utils/components/sketch-tool.vue2.js +0 -1
  35. package/lib/src/gis-map/utils/components/sketch-tool.vue3.js +0 -1
@@ -1,15 +1,16 @@
1
- import d from "@arcgis/core/layers/GraphicsLayer";
2
- import L from "@arcgis/core/widgets/Sketch/SketchViewModel";
3
- import b from "@arcgis/core/widgets/Sketch";
4
- import * as y from "@arcgis/core/geometry/support/webMercatorUtils.js";
5
- import * as G from "@arcgis/core/geometry/geometryEngine.js";
1
+ import * as L from "@arcgis/core/geometry/geometryEngine.js";
2
+ import * as g from "@arcgis/core/geometry/support/webMercatorUtils.js";
6
3
  import l from "@arcgis/core/Graphic";
7
- import { v4 as P } from "uuid";
8
- import k from "@arcgis/core/geometry/Polygon.js";
9
- import x from "@arcgis/core/geometry/Polyline.js";
10
- import A from "@turf/intersect";
11
- import * as m from "@turf/helpers";
12
- function w(c, e = []) {
4
+ import f from "@arcgis/core/layers/GraphicsLayer";
5
+ import G from "@arcgis/core/widgets/Sketch";
6
+ import P from "@arcgis/core/widgets/Sketch/SketchViewModel";
7
+ import S from "@arcgis/core/geometry/Polygon.js";
8
+ import b from "@arcgis/core/geometry/Polyline.js";
9
+ import * as d from "@turf/helpers";
10
+ import k from "@turf/intersect";
11
+ import { v4 as A } from "uuid";
12
+ import M from "../stores/index.mjs";
13
+ function u(c, t = []) {
13
14
  if (c === null || typeof c != "object")
14
15
  return c;
15
16
  if (Object.prototype.toString.call(c) === "[object Date]")
@@ -18,29 +19,29 @@ function w(c, e = []) {
18
19
  return new RegExp(c);
19
20
  if (Object.prototype.toString.call(c) === "[object Error]")
20
21
  return new Error(c);
21
- const t = e.filter((s) => s.original === c)[0];
22
- if (t)
23
- return t.copy;
22
+ const e = t.filter((s) => s.original === c)[0];
23
+ if (e)
24
+ return e.copy;
24
25
  const i = Array.isArray(c) ? [] : {};
25
- return e.push({
26
+ return t.push({
26
27
  original: c,
27
28
  copy: i
28
29
  }), Object.keys(c).forEach((s) => {
29
- i[s] = w(c[s], e);
30
+ i[s] = u(c[s], t);
30
31
  }), i;
31
32
  }
32
- const S = {
33
+ const x = {
33
34
  maxAllowedGraphics: 0,
34
35
  GraphicsLayer: {},
35
- sketchvisibleElements: {},
36
- sketchPosition: "top-left",
37
- defaultsketchVisible: !0,
36
+ sketchVisibleElements: {},
37
+ sketchPosition: "top-right",
38
+ defaultSketchVisible: !0,
38
39
  sketchViewModelItemSymbol: {}
39
- }, u = {
40
+ }, m = {
40
41
  type: "simple-line",
41
42
  color: "#556DEA",
42
43
  width: 2
43
- }, f = {
44
+ }, y = {
44
45
  type: "simple-fill",
45
46
  // autocasts as new SimpleFillSymbol()
46
47
  color: [227, 139, 79, 0.4],
@@ -50,38 +51,42 @@ const S = {
50
51
  width: 1
51
52
  }
52
53
  };
53
- class C {
54
- constructor(e, t) {
55
- this.viewer = e, this.options = {
56
- ...S,
57
- ...t
58
- }, this.graphicsLayer = new d({ ...this.options.GraphicsLayer }), this.TextgraphicsLayer = new d(), this.viewer.map.layers.add(this.graphicsLayer), this.viewer.map.layers.add(this.TextgraphicsLayer), this.init();
54
+ class B {
55
+ constructor(t, e) {
56
+ this.viewer = t, this.options = {
57
+ ...x,
58
+ ...e
59
+ }, this.graphicsLayer = new f({ ...this.options.GraphicsLayer }), this.TextGraphicsLayer = new f(), this.viewer.map.layers.add(this.graphicsLayer), this.viewer.map.layers.add(this.TextGraphicsLayer), this.init();
59
60
  }
60
61
  init() {
61
- this.sketchViewModel = new L({
62
+ this.sketchViewModel = new P({
62
63
  layer: this.graphicsLayer,
63
64
  view: this.viewer,
64
65
  updateOnGraphicClick: !0,
65
- polylineSymbol: u,
66
- polygonSymbol: f,
66
+ polylineSymbol: m,
67
+ polygonSymbol: y,
67
68
  ...this.options.sketchViewModelItemSymbol
68
69
  });
69
- const e = this.findLayerById("TrafficMarkings"), t = [];
70
- e && t.push({ layer: e, enabled: !0 }), this.sketch = new b({
70
+ const t = this.findLayerById("TrafficMarkings"), e = [];
71
+ t && e.push({ layer: t, enabled: !0 }), this.sketch = new G({
71
72
  view: this.viewer,
72
73
  viewModel: this.sketchViewModel,
73
74
  layer: this.graphicsLayer,
74
- visible: this.options.defaultsketchVisible,
75
+ visible: this.options.defaultSketchVisible,
75
76
  snappingOptions: {
76
77
  // autocasts to SnappingOptions()
77
78
  enabled: !0,
78
79
  // global snapping is turned on
79
80
  // assigns a collection of FeatureSnappingLayerSource() and enables feature snapping on this layer
80
- featureSources: t
81
+ featureSources: e
81
82
  }
82
83
  }), this.sketch.visibleElements = {
83
- ...this.options.sketchvisibleElements
84
+ ...this.options.sketchVisibleElements
84
85
  }, this.viewer.ui.add(this.sketch, this.options.sketchPosition);
86
+ const i = M.useAppDataStore;
87
+ this.sketch.on("create", (s) => {
88
+ s.state === "complete" ? i.isSketching = !1 : s.state === "start" && (i.isSketching = !0);
89
+ });
85
90
  }
86
91
  /**
87
92
  * 初始化绘图
@@ -92,16 +97,16 @@ class C {
92
97
  * @returns
93
98
  * @memberof SketchView
94
99
  */
95
- initPoint(e, t = "all", i = !1) {
96
- if (!e)
100
+ initPoint(t, e = "all", i = !1) {
101
+ if (!t)
97
102
  return;
98
- const { crossArea: s, sectionArea: r } = e;
99
- if (s && (t == "crossArea" || t == "all")) {
103
+ const { crossArea: s, sectionArea: r } = t;
104
+ if (s && (e == "crossArea" || e == "all")) {
100
105
  const o = this.initCrossArea(s);
101
106
  this.graphicsLayer.add(o);
102
107
  }
103
- if (r && (t == "sectionArea" || t == "all")) {
104
- const o = this.inintSectionArea(r, i);
108
+ if (r && (e == "sectionArea" || e == "all")) {
109
+ const o = this.initSectionArea(r, i);
105
110
  this.graphicsLayer.addMany(o);
106
111
  }
107
112
  }
@@ -111,15 +116,14 @@ class C {
111
116
  * @param {any[]} data
112
117
  * @memberof SketchView
113
118
  */
114
- initEntranceFusionZone(e) {
115
- const t = [], i = f;
116
- e.map((s) => {
117
- t.push(this.createPolygonGraphic(s, i, {}));
118
- }), this.graphicsLayer.addMany(t);
119
+ initEntranceFusionZone(t) {
120
+ const e = [];
121
+ t.map((i) => {
122
+ e.push(this.createPolygonGraphic(i, y, {}));
123
+ }), this.graphicsLayer.addMany(e);
119
124
  }
120
- initCrossArea(e) {
121
- const t = f;
122
- return this.createPolygonGraphic(e, t, {});
125
+ initCrossArea(t) {
126
+ return this.createPolygonGraphic(t, y, {});
123
127
  }
124
128
  /**
125
129
  * 初始进出口道计算区域
@@ -129,79 +133,83 @@ class C {
129
133
  * @returns
130
134
  * @memberof SketchView
131
135
  */
132
- inintSectionArea(e, t = !1) {
133
- const i = [], s = u, r = {
136
+ initSectionArea(t, e = !1) {
137
+ const i = [], s = {
134
138
  type: "simple-line",
135
139
  color: [0, 0, 255],
136
140
  width: 2
137
141
  };
138
- return Object.keys(e).map((o) => {
139
- const a = e[o][0], n = e[o][1];
140
- t && (a.reverse(), n.reverse());
141
- const h = P(), p = this.createPolylineGraphic(a, s, {
142
- type: "draw",
143
- id: h
144
- }), g = this.createPolylineGraphic(n, r, {
142
+ return Object.keys(t).map((r) => {
143
+ const o = t[r][0], a = t[r][1];
144
+ e && (o.reverse(), a.reverse());
145
+ const n = A(), h = this.createPolylineGraphic(
146
+ o,
147
+ m,
148
+ {
149
+ type: "draw",
150
+ id: n
151
+ }
152
+ ), p = this.createPolylineGraphic(a, s, {
145
153
  type: "shiftLine",
146
- id: h
154
+ id: n
147
155
  });
148
- i.push(p, g);
156
+ i.push(h, p);
149
157
  }), i;
150
158
  }
151
- createPolylineGraphic(e, t, i) {
152
- const s = new x({
153
- paths: e
154
- }), r = y.geographicToWebMercator(s);
159
+ createPolylineGraphic(t, e, i) {
160
+ const s = new b({
161
+ paths: t
162
+ }), r = g.geographicToWebMercator(s);
155
163
  return new l({
156
164
  geometry: r,
157
165
  // Add the geometry created in step 3
158
- symbol: t,
166
+ symbol: e,
159
167
  // Add the symbol created in step 4
160
168
  attributes: i
161
169
  });
162
170
  }
163
- createPolygonGraphic(e, t, i) {
164
- const s = new k({
165
- rings: e
166
- }), r = y.geographicToWebMercator(s);
171
+ createPolygonGraphic(t, e, i) {
172
+ const s = new S({
173
+ rings: t
174
+ }), r = g.geographicToWebMercator(s);
167
175
  return new l({
168
176
  geometry: r,
169
177
  // Add the geometry created in step 3
170
- symbol: t,
178
+ symbol: e,
171
179
  // Add the symbol created in step 4
172
180
  attributes: i
173
181
  });
174
182
  }
175
- on(e) {
176
- const t = this;
183
+ on(t) {
184
+ const e = this;
177
185
  this.sketchViewModel.on("create", function(i) {
178
186
  var r, o, a;
179
- const s = t.graphicsLayer.graphics;
180
- if ((r = t.options) != null && r.maxAllowedGraphics && s.length > ((o = t.options) == null ? void 0 : o.maxAllowedGraphics)) {
181
- t.graphicsLayer.remove(i.graphic), console.log("已达到最大图形数量,无法继续绘制!");
187
+ const s = e.graphicsLayer.graphics;
188
+ if ((r = e.options) != null && r.maxAllowedGraphics && s.length > ((o = e.options) == null ? void 0 : o.maxAllowedGraphics)) {
189
+ e.graphicsLayer.remove(i.graphic), console.log("已达到最大图形数量,无法继续绘制!");
182
190
  return;
183
191
  }
184
192
  if (i.state === "complete" && ((a = i.graphic) != null && a.geometry)) {
185
193
  console.log(i.graphic);
186
194
  const n = i.graphic.geometry;
187
195
  i.graphic.setAttribute("type", "draw"), i.graphic.setAttribute("id", new Date().getTime());
188
- const h = t.getGraphicPoint(n);
189
- e && e("create", h, i);
196
+ const h = e.getGraphicPoint(n);
197
+ t && t("create", h, i);
190
198
  }
191
199
  }), this.sketchViewModel.on("update", function(i) {
192
200
  if (console.log("update", i), i.aborted) {
193
201
  const s = i.graphics[0];
194
- t.graphicsLayer.remove(s);
202
+ e.graphicsLayer.remove(s);
195
203
  return;
196
204
  }
197
205
  if (i.state === "complete" && i.graphics.length > 0) {
198
- const r = i.graphics[0].geometry, o = t.getGraphicPoint(r);
199
- e && e("update", o, i);
206
+ const r = i.graphics[0].geometry, o = e.getGraphicPoint(r);
207
+ t && t("update", o, i);
200
208
  }
201
209
  }), this.sketchViewModel.on("delete", function(i) {
202
- if (console.log("delete", i, t.graphicsLayer.graphics), i.graphics.length > 0) {
203
- const r = i.graphics[0].geometry, o = t.getGraphicPoint(r);
204
- e && e("delete", o, i);
210
+ if (console.log("delete", i, e.graphicsLayer.graphics), i.graphics.length > 0) {
211
+ const r = i.graphics[0].geometry, o = e.getGraphicPoint(r);
212
+ t && t("delete", o, i);
205
213
  }
206
214
  });
207
215
  }
@@ -210,16 +218,16 @@ class C {
210
218
  * @returns
211
219
  */
212
220
  graphicPoint() {
213
- const e = [];
214
- return this.graphicsLayer.graphics.map((t) => {
221
+ const t = [];
222
+ return this.graphicsLayer.graphics.map((e) => {
215
223
  var r;
216
- const i = t.geometry, s = this.getGraphicPoint(i);
217
- e.push({
224
+ const i = e.geometry, s = this.getGraphicPoint(i);
225
+ t.push({
218
226
  point: s,
219
- type: (r = t.attributes) == null ? void 0 : r.type,
220
- attributes: t.attributes
227
+ type: (r = e.attributes) == null ? void 0 : r.type,
228
+ attributes: e.attributes
221
229
  });
222
- }), e;
230
+ }), t;
223
231
  }
224
232
  /**
225
233
  * 获取进口道区域
@@ -227,15 +235,15 @@ class C {
227
235
  * @memberof SketchView
228
236
  */
229
237
  getEntranceRoad() {
230
- const e = {}, t = this.graphicPoint().filter(
238
+ const t = {}, e = this.graphicPoint().filter(
231
239
  (n) => n.point.type === "polyline"
232
240
  );
233
241
  if (console.log(
234
242
  "🚀 ~ file: sketchView.ts:378 ~ SketchView ~ getEntranceRoad ~ graphics:",
235
- t
236
- ), !t.length)
243
+ e
244
+ ), !e.length)
237
245
  return !1;
238
- const i = t.filter((n) => n.type == "draw"), s = t.filter((n) => n.type == "shiftLine");
246
+ const i = e.filter((n) => n.type == "draw"), s = e.filter((n) => n.type == "shiftLine");
239
247
  if (s.length == 0)
240
248
  throw "未绘制平移!";
241
249
  if (i.length != s.length)
@@ -246,7 +254,7 @@ class C {
246
254
  ...r.slice(0, o).reverse()
247
255
  ].map((n, h) => {
248
256
  const p = s.find(
249
- (g) => g.attributes.id == n.attributes.id
257
+ (w) => w.attributes.id == n.attributes.id
250
258
  );
251
259
  if (!p)
252
260
  throw "绘制的线和平移的线不匹配!";
@@ -254,14 +262,14 @@ class C {
254
262
  "🚀 ~ file: sketchView.ts:393 ~ SketchView ~ getEntranceRoad ~ m:",
255
263
  n,
256
264
  p
257
- ), e[h + 1] = {
265
+ ), t[h + 1] = {
258
266
  0: [n.point.paths[0], n.point.paths[n.point.paths.length - 1]],
259
267
  1: [
260
268
  p.point.paths[0],
261
269
  p.point.paths[p.point.paths.length - 1]
262
270
  ]
263
271
  };
264
- }), e;
272
+ }), t;
265
273
  }
266
274
  /**
267
275
  * 获进口道融合区
@@ -271,38 +279,38 @@ class C {
271
279
  * @returns
272
280
  * @memberof SketchView
273
281
  */
274
- getEntranceFusionZone(e) {
275
- const t = [], i = {};
282
+ getEntranceFusionZone(t) {
283
+ const e = [], i = {};
276
284
  this.graphicsLayer.graphics.map((r) => {
277
285
  var n;
278
286
  const o = r.geometry, a = this.getGraphicPoint(o, !1);
279
- t.push({
287
+ e.push({
280
288
  point: a,
281
289
  type: (n = r.attributes) == null ? void 0 : n.type,
282
290
  attributes: r.attributes
283
291
  });
284
292
  });
285
- const s = t;
286
- return e.map((r, o) => {
287
- i[r] = t[o];
288
- }), { graphics: i, rawdata: s };
293
+ const s = e;
294
+ return t.map((r, o) => {
295
+ i[r] = e[o];
296
+ }), { graphics: i, rawData: s };
289
297
  }
290
298
  /**
291
299
  * 获取进口道所在的进口道编号
292
300
  *
293
301
  * @param {armData} armData 进口道编号区域
294
- * @param {*} graphicPpolygon 绘制的区域
302
+ * @param {*} graphicPolygon 绘制的区域
295
303
  * @returns
296
304
  * @memberof SketchView
297
305
  */
298
- getIntersectionArea(e, t) {
299
- const i = Object.keys(e);
306
+ getIntersectionArea(t, e) {
307
+ const i = Object.keys(t);
300
308
  let s = !1;
301
309
  for (let r = 0; r < i.length; r++) {
302
- const o = i[r], a = e[o];
303
- if (A(
304
- m.polygon(t),
305
- m.polygon(a)
310
+ const o = i[r], a = t[o];
311
+ if (k(
312
+ d.polygon(e),
313
+ d.polygon(a)
306
314
  )) {
307
315
  s = o;
308
316
  break;
@@ -310,35 +318,36 @@ class C {
310
318
  }
311
319
  return s;
312
320
  }
313
- filterData(e) {
314
- const t = w(e);
315
- return t.length > 0 && t[0][0] === t[t.length - 1][0] && t[0][1] === t[t.length - 1][1] && t.pop(), t;
321
+ filterData(t) {
322
+ const e = u(t);
323
+ return e.length > 0 && e[0][0] === e[e.length - 1][0] && e[0][1] === e[e.length - 1][1] && e.pop(), e;
316
324
  }
317
325
  /**
318
326
  *
319
327
  *
320
328
  * @private
321
329
  * @param {*} geometry
322
- * @param {boolean} [isfilterData=true] 是否过滤首尾相同点数据
330
+ * @param {boolean} [isFilterData=true] 是否过滤首尾相同点数据
323
331
  * @returns
324
332
  * @memberof SketchView
325
333
  */
326
- getGraphicPoint(e, t = !0) {
327
- const i = y.webMercatorToGeographic(e);
334
+ getGraphicPoint(t, e = !0) {
335
+ let i = t;
336
+ this.viewer.spatialReference.isWebMercator && (i = g.webMercatorToGeographic(t));
328
337
  let s;
329
- if (e.type === "point")
338
+ if (t.type === "point")
330
339
  s = {
331
- type: e.type,
340
+ type: t.type,
332
341
  x: i.x,
333
342
  y: i.y
334
343
  };
335
- else if (e.type === "polyline") {
344
+ else if (t.type === "polyline") {
336
345
  s = {
337
- type: e.type,
346
+ type: t.type,
338
347
  paths: []
339
348
  }, i.paths.forEach((n) => {
340
349
  let h = n;
341
- t && (h = this.filterData(n)), h.forEach((p) => {
350
+ e && (h = this.filterData(n)), h.forEach((p) => {
342
351
  s.paths.push(p);
343
352
  });
344
353
  });
@@ -351,12 +360,12 @@ class C {
351
360
  }, a = this.getAngle(r, o);
352
361
  s.angle = a;
353
362
  } else
354
- e.type === "polygon" && (s = {
355
- type: e.type,
363
+ t.type === "polygon" && (s = {
364
+ type: t.type,
356
365
  rings: []
357
366
  }, i.rings.forEach((r) => {
358
367
  let o = r;
359
- t && (o = this.filterData(r)), o.forEach((a) => {
368
+ e && (o = this.filterData(r)), o.forEach((a) => {
360
369
  s.rings.push(a);
361
370
  });
362
371
  }));
@@ -379,8 +388,8 @@ class C {
379
388
  * @returns
380
389
  * @memberof SketchView
381
390
  */
382
- getAngle(e, t) {
383
- const i = t.x - e.x, s = t.y - e.y;
391
+ getAngle(t, e) {
392
+ const i = e.x - t.x, s = e.y - t.y;
384
393
  return Math.atan2(s, i) * 180 / Math.PI;
385
394
  }
386
395
  /**
@@ -392,9 +401,9 @@ class C {
392
401
  * @returns
393
402
  * @memberof SketchView
394
403
  */
395
- getshiftLine(e, t, i = "meters") {
396
- const s = e, r = -t;
397
- return G.offset(
404
+ getShiftLine(t, e, i = "meters") {
405
+ const s = t, r = -e;
406
+ return L.offset(
398
407
  s,
399
408
  r,
400
409
  i
@@ -408,7 +417,7 @@ class C {
408
417
  * @param {*} symbol 线的样式
409
418
  * @memberof SketchView
410
419
  */
411
- setshiftLine(e, t = "meters", i) {
420
+ setShiftLine(t, e = "meters", i) {
412
421
  i || (i = {
413
422
  type: "simple-line",
414
423
  color: [0, 0, 255],
@@ -416,10 +425,10 @@ class C {
416
425
  }), this.removeShiftLine(), this.graphicsLayer.graphics.map((s) => {
417
426
  const r = s.geometry, o = s.attributes;
418
427
  if ((r == null ? void 0 : r.type) === "polyline" && (o == null ? void 0 : o.type) === "draw") {
419
- const a = o.id, n = this.getshiftLine(
428
+ const a = o.id, n = this.getShiftLine(
420
429
  r,
421
- e,
422
- t
430
+ t,
431
+ e
423
432
  ), h = new l({
424
433
  geometry: n,
425
434
  symbol: i,
@@ -435,32 +444,32 @@ class C {
435
444
  * @memberof SketchView
436
445
  */
437
446
  removeShiftLine() {
438
- const e = [];
439
- this.graphicsLayer.graphics.map((t) => {
440
- const i = t.attributes;
441
- (i == null ? void 0 : i.type) === "shiftLine" && e.push(t);
442
- }), this.graphicsLayer.removeMany(e);
447
+ const t = [];
448
+ this.graphicsLayer.graphics.map((e) => {
449
+ const i = e.attributes;
450
+ (i == null ? void 0 : i.type) === "shiftLine" && t.push(e);
451
+ }), this.graphicsLayer.removeMany(t);
443
452
  }
444
453
  /**
445
454
  * 移除绘制的线
446
455
  *
447
456
  * @memberof SketchView
448
457
  */
449
- removedraw() {
450
- const e = [];
451
- this.graphicsLayer.graphics.map((t) => {
452
- const i = t.attributes;
453
- (i == null ? void 0 : i.type) === "draw" && e.push(t);
454
- }), this.graphicsLayer.removeMany(e);
455
- }
456
- addGraphic(e, t = {
458
+ removeDraw() {
459
+ const t = [];
460
+ this.graphicsLayer.graphics.map((e) => {
461
+ const i = e.attributes;
462
+ (i == null ? void 0 : i.type) === "draw" && t.push(e);
463
+ }), this.graphicsLayer.removeMany(t);
464
+ }
465
+ addGraphic(t, e = {
457
466
  type: "simple-line",
458
467
  color: [0, 0, 255],
459
468
  width: 2
460
469
  }, i) {
461
470
  const s = new l({
462
- geometry: e,
463
- symbol: t,
471
+ geometry: t,
472
+ symbol: e,
464
473
  attributes: i
465
474
  });
466
475
  this.graphicsLayer.add(s);
@@ -473,12 +482,12 @@ class C {
473
482
  * @returns
474
483
  * @memberof SketchView
475
484
  */
476
- getDirection(e, t) {
477
- const i = t.x - e.x, s = t.y - e.y, o = Math.atan2(s, i) * 180 / Math.PI;
485
+ getDirection(t, e) {
486
+ const i = e.x - t.x, s = e.y - t.y, o = Math.atan2(s, i) * 180 / Math.PI;
478
487
  return o >= -45 && o <= 45 ? 0 : o > 45 && o <= 135 ? 1 : o > 135 || o <= -135 ? 2 : 3;
479
488
  }
480
- findLayerById(e) {
481
- return this.viewer.map.findLayerById(e);
489
+ findLayerById(t) {
490
+ return this.viewer.map.findLayerById(t);
482
491
  }
483
492
  /**
484
493
  * 根据id查找平移线graphic
@@ -487,30 +496,30 @@ class C {
487
496
  * @returns
488
497
  * @memberof SketchView
489
498
  */
490
- findShiftLineGraphicsById(e) {
491
- return this.graphicsLayer.graphics.find((i) => i.attributes.id === e && i.attributes.type === "shiftLine");
499
+ findShiftLineGraphicsById(t) {
500
+ return this.graphicsLayer.graphics.find((i) => i.attributes.id === t && i.attributes.type === "shiftLine");
492
501
  }
493
502
  /**
494
503
  * 删除指定的图形
495
504
  * @param graphic 删除指定的图形
496
505
  */
497
- remove(e) {
498
- this.graphicsLayer.remove(e);
506
+ remove(t) {
507
+ this.graphicsLayer.remove(t);
499
508
  }
500
509
  /**
501
510
  * 设置最大允许绘制的图形数量
502
511
  * @param num 数量
503
512
  */
504
- setmaxAllowedGraphics(e) {
505
- this.options.maxAllowedGraphics = e === 0 ? void 0 : e;
513
+ setMaxAllowedGraphics(t) {
514
+ this.options.maxAllowedGraphics = t === 0 ? void 0 : t;
506
515
  }
507
- deepClone(e) {
516
+ deepClone(t) {
508
517
  }
509
518
  destroy() {
510
- var e, t;
511
- this.viewer.map.remove(this.graphicsLayer), this.viewer.map.remove(this.TextgraphicsLayer), (e = this.sketch) == null || e.destroy(), (t = this.sketchViewModel) == null || t.destroy();
519
+ var t, e;
520
+ this.viewer.map.remove(this.graphicsLayer), this.viewer.map.remove(this.TextGraphicsLayer), (t = this.sketch) == null || t.destroy(), (e = this.sketchViewModel) == null || e.destroy();
512
521
  }
513
522
  }
514
523
  export {
515
- C as default
524
+ B as default
516
525
  };