gisviewer-vue3-arcgis 1.0.141 → 1.0.143

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.
@@ -1,13 +1,13 @@
1
- import { defineComponent as ke, ref as y, onMounted as Te, getCurrentInstance as Ae, onUnmounted as De, computed as Ie, openBlock as C, createElementBlock as Le, createElementVNode as p, withDirectives as be, vShow as _e, createBlock as He, unref as xe, createCommentVNode as Me } from "vue";
2
- import O, { registerStore as Ve } from "./stores/index.mjs";
1
+ import { defineComponent as ke, ref as h, onMounted as Te, getCurrentInstance as Ae, onUnmounted as De, computed as Ie, openBlock as O, createElementBlock as Le, createElementVNode as p, withDirectives as be, vShow as _e, createBlock as He, unref as xe, createCommentVNode as Me } from "vue";
2
+ import k, { registerStore as Ve } from "./stores/index.mjs";
3
3
  import "./style/index.css";
4
4
  import Be from "./utils/components/sketch-tool.vue.mjs";
5
5
  import Ne from "./utils/holo-flow/index.mjs";
6
6
  import ze from "./utils/map-initializer.mjs";
7
- import k from "./utils/open-drive-renderer/index.mjs";
7
+ import T from "./utils/open-drive-renderer/index.mjs";
8
8
  import Qe from "./utils/overlay.mjs";
9
9
  import je from "./utils/queue-length.mjs";
10
- import T from "./utils/road-config-tool/index.mjs";
10
+ import A from "./utils/road-config-tool/index.mjs";
11
11
  import Pe from "./utils/signal-control-area-controller/index.mjs";
12
12
  import Ee from "./utils/traffic-flow.mjs";
13
13
  const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom: "10px", left: "10px" } }, at = /* @__PURE__ */ ke({
@@ -17,33 +17,33 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
17
17
  assetsRoot: {}
18
18
  },
19
19
  emits: ["mapLoaded", "markerClick", "mapClick"],
20
- setup(A, { expose: D, emit: I }) {
21
- const g = y(null);
22
- let s, c, i, n, a, o, u, t, r;
23
- const f = y(!1), L = y(!1);
20
+ setup(D, { expose: I, emit: L }) {
21
+ const g = h(null);
22
+ let s, c, i, n, a, r, u, t, o;
23
+ const f = h(!1), w = h(!1);
24
24
  Te(async () => {
25
25
  if (Ve(), !g.value)
26
26
  return;
27
27
  document.addEventListener("keydown", (m) => {
28
28
  m.ctrlKey && m.key === "i" && (f.value = !f.value);
29
29
  });
30
- const e = Ae(), { $gisviewerAssetsRoot: l } = e.appContext.config.globalProperties, S = await (await fetch(h.config)).json();
31
- S.assetsRoot = h.assetsRoot || l;
32
- const Ce = O.useAppDataStore;
33
- Ce.mapConfig = S, c = new ze(), s = await c.initialize({
30
+ const e = Ae(), { $gisviewerAssetsRoot: l } = e.appContext.config.globalProperties, C = await (await fetch(S.config)).json();
31
+ C.assetsRoot = S.assetsRoot || l;
32
+ const Ce = k.useAppDataStore;
33
+ Ce.mapConfig = C, c = new ze(), s = await c.initialize({
34
34
  container: g.value,
35
- markerClickCallback: (m, v, d, Oe) => {
36
- w("markerClick", m, v, d, Oe);
35
+ markerClickCallback: (m, d, y, Oe) => {
36
+ v("markerClick", m, d, y, Oe);
37
37
  },
38
- mapClickCallback: (m, v, d) => {
39
- w("mapClick", m, v, d);
38
+ mapClickCallback: (m, d, y) => {
39
+ v("mapClick", m, d, y);
40
40
  }
41
- }), a = new Ne(s), await a.init(), w("mapLoaded");
41
+ }), a = new Ne(s), await a.init(), v("mapLoaded");
42
42
  }), De(() => {
43
- r == null || r.clearSignalControlArea(), t == null || t.clearOpenDrive(), a == null || a.clearHoloTrace(), a == null || a.clearHoloSignal(), n == null || n.disconnectTrafficFlow();
43
+ o == null || o.clearSignalControlArea(), t == null || t.clearOpenDrive(), a == null || a.clearHoloTrace(), a == null || a.clearHoloSignal(), n == null || n.disconnectTrafficFlow();
44
44
  });
45
45
  const b = Ie(() => s), _ = () => {
46
- const e = O.useAppDataStore;
46
+ const e = k.useAppDataStore;
47
47
  e.saveTrackLog = !0;
48
48
  }, H = () => {
49
49
  a.downloadTrackLog();
@@ -51,9 +51,9 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
51
51
  c.cancelCoordinateTransform(e);
52
52
  }, Q = (e) => {
53
53
  c.setMapZoomRange(e);
54
- }, j = (e) => (i || (i = new T(s)), i.showLaneNumber(e)), P = () => {
54
+ }, j = (e) => (i || (i = new A(s)), i.showLaneNumber(e)), P = () => {
55
55
  i == null || i.clearLaneNumber();
56
- }, E = async (e) => (i || (i = new T(s)), await i.initializeSearch(e)), F = async () => i == null ? void 0 : i.calCrossIndicatorArea(), R = async () => {
56
+ }, E = async (e) => (i || (i = new A(s)), await i.initializeSearch(e)), F = async () => i == null ? void 0 : i.calCrossIndicatorArea(), R = async () => {
57
57
  }, Z = async (e, l) => {
58
58
  n || (n = new Ee(s)), n.connectTrafficFlow(e, l);
59
59
  }, q = () => {
@@ -76,13 +76,13 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
76
76
  n == null || n.toggleTrafficObject(e), a.toggleTrafficObject(e);
77
77
  }, ee = (e) => {
78
78
  a.updatePanelContent(e);
79
- }, te = async (e) => (o || (o = new Qe(s)), o.addOverlays(e)), ae = (e) => o == null ? void 0 : o.removeOverlaysByType(e), ne = (e) => o == null ? void 0 : o.removeOverlaysById(e), oe = () => o == null ? void 0 : o.removeAllOverlays(), re = () => {
80
- o == null || o.showAllOverlays();
79
+ }, te = async (e) => (r || (r = new Qe(s)), r.addOverlays(e)), ae = (e) => r == null ? void 0 : r.removeOverlaysByType(e), ne = (e) => r == null ? void 0 : r.removeOverlaysById(e), re = () => r == null ? void 0 : r.removeAllOverlays(), oe = () => {
80
+ r == null || r.showAllOverlays();
81
81
  }, se = (e) => {
82
82
  u || (u = new je(s)), u.updateQueueLength(e);
83
83
  }, ie = () => {
84
84
  u == null || u.removeQueueLength();
85
- }, ce = async (e, l) => (t || (t = new k(s)), await t.showOpenDriveFromServer(e, l)), le = async (e) => (t || (t = new k(s)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ue = async () => await (t == null ? void 0 : t.clearOpenDrive()), me = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
85
+ }, ce = async (e, l) => (t || (t = new T(s)), await t.showOpenDriveFromServer(e, l)), le = async (e) => (t || (t = new T(s)), await t.clearOpenDrive(), w.value = !0, await t.showOpenDriveFromFile(e)), ue = async () => (w.value = !1, await (t == null ? void 0 : t.clearOpenDrive())), me = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
86
86
  status: -1,
87
87
  message: "未加载OpenDrive地图"
88
88
  }, pe = async (e) => t ? t.selectSumo(e) : {
@@ -97,10 +97,10 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
97
97
  }, we = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
98
98
  status: -1,
99
99
  message: "未加载OpenDrive地图"
100
- }, ve = (e) => (r || (r = new Pe(s)), r.showSignalControlArea(e)), de = () => {
101
- r == null || r.clearSignalControlArea();
102
- }, ye = async (e) => r ? await r.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, he = async (e) => r ? await r.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Se = () => r ? r.resetHighlight() : { status: -1, message: "未加载信号控制区" }, h = A, w = I;
103
- return D({
100
+ }, ve = (e) => (o || (o = new Pe(s)), o.showSignalControlArea(e)), de = () => {
101
+ o == null || o.clearSignalControlArea();
102
+ }, ye = async (e) => o ? await o.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, he = async (e) => o ? await o.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Se = () => o ? o.resetHighlight() : { status: -1, message: "未加载信号控制区" }, S = D, v = L;
103
+ return I({
104
104
  mapViewer: b,
105
105
  setLayerVisibility: B,
106
106
  setMapCenter: x,
@@ -110,10 +110,10 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
110
110
  requestCoordinateTransform: N,
111
111
  cancelCoordinateTransform: z,
112
112
  addOverlays: te,
113
- showAllOverlays: re,
113
+ showAllOverlays: oe,
114
114
  removeOverlaysByType: ae,
115
115
  removeOverlaysById: ne,
116
- removeAllOverlays: oe,
116
+ removeAllOverlays: re,
117
117
  showLaneNumber: j,
118
118
  clearLaneNumber: P,
119
119
  initializeAreaTool: E,
@@ -145,7 +145,7 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
145
145
  locateSignalControlArea: ye,
146
146
  highlightSignalControlArea: he,
147
147
  resetHighlightSignalControlArea: Se
148
- }), (e, l) => (C(), Le("div", Fe, [
148
+ }), (e, l) => (O(), Le("div", Fe, [
149
149
  p("div", {
150
150
  class: "gis-viewer-main",
151
151
  ref_key: "mapContainer",
@@ -160,7 +160,7 @@ const Fe = { class: "gis-viewer" }, Re = { style: { position: "absolute", bottom
160
160
  ], 512), [
161
161
  [_e, f.value]
162
162
  ]),
163
- L.value ? (C(), He(Be, {
163
+ w.value ? (O(), He(Be, {
164
164
  key: 0,
165
165
  view: xe(s)
166
166
  }, null, 8, ["view"])) : Me("", !0)
@@ -1,7 +1,7 @@
1
1
  import o from "./sketch-tool.vue2.mjs";
2
2
  import "./sketch-tool.vue3.mjs";
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ac0f5d06"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f302a42f"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as a, onMounted as m, onUnmounted as p, openBlock as u, createElementBlock as d, createElementVNode as n } from "vue";
2
2
  import g from "@arcgis/core/layers/GraphicsLayer";
3
- import k from "@arcgis/core/widgets/Sketch/SketchViewModel";
4
- const y = { class: "gisviewer-sketch-tool gisviewer-sketch-tool-position" }, _ = /* @__PURE__ */ a({
3
+ import y from "@arcgis/core/widgets/Sketch/SketchViewModel";
4
+ const k = { class: "gisviewer-sketch-tool gisviewer-sketch-tool-position" }, _ = /* @__PURE__ */ a({
5
5
  __name: "sketch-tool",
6
6
  props: {
7
7
  view: {}
@@ -11,7 +11,7 @@ const y = { class: "gisviewer-sketch-tool gisviewer-sketch-tool-position" }, _ =
11
11
  let o;
12
12
  m(() => {
13
13
  const e = new g();
14
- c.view.map.add(e), o = new k({
14
+ c.view.map.add(e), o = new y({
15
15
  layer: e,
16
16
  view: c.view
17
17
  });
@@ -19,26 +19,26 @@ const y = { class: "gisviewer-sketch-tool gisviewer-sketch-tool-position" }, _ =
19
19
  o.destroy();
20
20
  });
21
21
  const i = () => {
22
- }, s = (e) => {
23
- var r;
22
+ }, r = (e) => {
23
+ var s;
24
24
  console.log(e);
25
- const t = (r = e.target) == null ? void 0 : r.value;
25
+ const t = (s = e.target) == null ? void 0 : s.value;
26
26
  console.log(t), o.create(t);
27
27
  };
28
- return (e, t) => (u(), d("div", y, [
28
+ return (e, t) => (u(), d("div", k, [
29
29
  n("button", {
30
30
  class: "esri-icon-pan geometry-button",
31
31
  onClick: i
32
32
  }),
33
33
  n("button", {
34
- class: "esri-icon-checkbox-unchecked geometry-button",
34
+ class: "esri-icon-cursor geometry-button",
35
35
  value: "rectangle",
36
- onClick: s
36
+ onClick: r
37
37
  }),
38
38
  n("button", {
39
39
  class: "esri-icon-polygon geometry-button",
40
40
  value: "polygon",
41
- onClick: s
41
+ onClick: r
42
42
  })
43
43
  ]));
44
44
  }
@@ -1,7 +1,7 @@
1
1
  import b from "@arcgis/core/Basemap";
2
2
  import g from "@arcgis/core/config";
3
3
  import * as M from "@arcgis/core/core/reactiveUtils";
4
- import { Polygon as P, Polyline as W, Point as T } from "@arcgis/core/geometry";
4
+ import { Polygon as k, Polyline as W, Point as T } from "@arcgis/core/geometry";
5
5
  import * as f from "@arcgis/core/geometry/support/webMercatorUtils";
6
6
  import z from "@arcgis/core/layers/GeoJSONLayer";
7
7
  import x from "@arcgis/core/layers/TileLayer";
@@ -13,7 +13,7 @@ import H from "@turf/destination";
13
13
  import * as I from "@turf/helpers";
14
14
  import O from "../stores/index.mjs";
15
15
  import G from "./custom-layer/custom-wmts-layer.mjs";
16
- function k(l, e) {
16
+ function P(l, e) {
17
17
  return l && (l.startsWith("http://") || l.startsWith("https://") ? l : e + l);
18
18
  }
19
19
  class F {
@@ -95,7 +95,7 @@ class F {
95
95
  );
96
96
  });
97
97
  }), t != null && t.baseLayers ? t.baseLayers.forEach((s) => {
98
- const h = k(s.url, t.assetsRoot);
98
+ const h = P(s.url, t.assetsRoot);
99
99
  switch (s.type.toLowerCase()) {
100
100
  case "webTile".toLowerCase(): {
101
101
  const c = new L({
@@ -129,7 +129,7 @@ class F {
129
129
  }
130
130
  }) : n.basemap = new b({
131
131
  style: {
132
- id: "arcgis/dark-gray",
132
+ id: "arcgis/light-gray",
133
133
  language: "zh-CN"
134
134
  }
135
135
  }), t != null && t.hdLayers) {
@@ -137,7 +137,7 @@ class F {
137
137
  (h) => (
138
138
  // 图层文件为GeoJson格式, renderer和symbol使用autocast配置
139
139
  new z({
140
- url: k(h.url, t.assetsRoot),
140
+ url: P(h.url, t.assetsRoot),
141
141
  ...h.options,
142
142
  title: h.options.id
143
143
  })
@@ -187,7 +187,7 @@ class F {
187
187
  e.target = new W(e.target);
188
188
  break;
189
189
  case "polygon":
190
- e.target = new P(e.target);
190
+ e.target = new k(e.target);
191
191
  break;
192
192
  }
193
193
  await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
@@ -1,10 +1,10 @@
1
- import * as p from "@arcgis/core/core/reactiveUtils.js";
1
+ import * as g from "@arcgis/core/core/reactiveUtils.js";
2
2
  import y from "@arcgis/core/Graphic";
3
3
  import o from "@arcgis/core/layers/GraphicsLayer";
4
- import g from "@turf/buffer";
5
- import d from "@turf/concave";
6
- import f from "@turf/convex";
7
- import * as n from "@turf/helpers";
4
+ import d from "@turf/buffer";
5
+ import f from "@turf/concave";
6
+ import m from "@turf/convex";
7
+ import * as h from "@turf/helpers";
8
8
  import b from "./district-controller.mjs";
9
9
  class x {
10
10
  constructor(e) {
@@ -36,13 +36,13 @@ class x {
36
36
  showSignalControlArea(e) {
37
37
  this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0;
38
38
  for (const t of e) {
39
- const i = new b(t);
40
- this.drawArea(i, !0);
39
+ const r = new b(t);
40
+ this.drawArea(r, !0);
41
41
  }
42
- return this.watchHandle = p.watch(
42
+ return this.watchHandle = g.watch(
43
43
  () => this.view.scale,
44
- (t, i) => {
45
- t > this.crossScale && i <= this.crossScale ? (this.crossLayer.graphics.forEach((s) => {
44
+ (t, r) => {
45
+ t > this.crossScale && r <= this.crossScale ? (this.crossLayer.graphics.forEach((s) => {
46
46
  s.symbol = this.getCrossGraphicSymbol(
47
47
  s.attributes,
48
48
  "marker"
@@ -52,7 +52,7 @@ class x {
52
52
  s.attributes,
53
53
  "marker"
54
54
  ));
55
- })) : t <= this.crossScale && i > this.crossScale && (this.crossLayer.graphics.forEach((s) => {
55
+ })) : t <= this.crossScale && r > this.crossScale && (this.crossLayer.graphics.forEach((s) => {
56
56
  s.symbol = this.getCrossGraphicSymbol(
57
57
  s.attributes,
58
58
  "picture"
@@ -86,12 +86,12 @@ class x {
86
86
  }
87
87
  async highlightSignalControlArea(e) {
88
88
  this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1, this.subDistrictControllerLayer.visible = !1, this.crossLayer.visible = !1;
89
- const t = this.districtControllerLayer.graphics.filter((r) => r.getAttribute("id") === e.id).toArray().map((r) => r.clone()), i = this.subDistrictControllerLayer.graphics.filter(
90
- (r) => r.getAttribute("id") === e.id || r.getAttribute("parentId") === e.id
91
- ).toArray().map((r) => r.clone()), s = this.crossLayer.graphics.filter(
92
- (r) => r.getAttribute("id") === e.id || r.getAttribute("districtId") === e.id || r.getAttribute("subDistrictId") === e.id
93
- ).toArray().map((r) => r.clone());
94
- return t.length > 0 && this.highlightLayer.addMany(t), i.length > 0 && (this.highlightLayer.addMany(i), this.showPopup(i[0])), s.length > 0 && this.highlightLayer.addMany(s), this.highlightLayer.graphics.length === 0 ? { status: 1, message: "未找到" } : (t.length > 0 ? (await this.view.goTo(t), this.showPopup(t[0])) : i.length > 0 ? (await this.view.goTo(i), this.showPopup(i[0])) : (s.length > 1 ? await this.view.goTo(s) : await this.view.goTo({
89
+ const t = this.districtControllerLayer.graphics.filter((i) => i.getAttribute("id") === e.id).toArray().map((i) => i.clone()), r = this.subDistrictControllerLayer.graphics.filter(
90
+ (i) => i.getAttribute("id") === e.id || i.getAttribute("parentId") === e.id
91
+ ).toArray().map((i) => i.clone()), s = this.crossLayer.graphics.filter(
92
+ (i) => i.getAttribute("id") === e.id || i.getAttribute("districtId") === e.id || i.getAttribute("subDistrictId") === e.id
93
+ ).toArray().map((i) => i.clone());
94
+ return t.length > 0 && this.highlightLayer.addMany(t), r.length > 0 && (this.highlightLayer.addMany(r), this.showPopup(r[0])), s.length > 0 && this.highlightLayer.addMany(s), this.highlightLayer.graphics.length === 0 ? { status: 1, message: "未找到" } : (t.length > 0 ? (await this.view.goTo(t), this.showPopup(t[0])) : r.length > 0 ? (await this.view.goTo(r), this.showPopup(r[0])) : (s.length > 1 ? await this.view.goTo(s) : await this.view.goTo({
95
95
  target: s[0].geometry,
96
96
  scale: 1500
97
97
  }), this.showPopup(s[0])), { status: 0, message: "ok" });
@@ -106,11 +106,11 @@ class x {
106
106
  */
107
107
  findAreaGraphic(e) {
108
108
  let t = this.districtControllerLayer.graphics.find(
109
- (i) => i.attributes.id === e
109
+ (r) => r.attributes.id === e
110
110
  );
111
111
  return t || (t = this.subDistrictControllerLayer.graphics.find(
112
- (i) => i.attributes.id === e
113
- )), t || (t = this.crossLayer.graphics.find((i) => i.attributes.id === e)), t;
112
+ (r) => r.attributes.id === e
113
+ )), t || (t = this.crossLayer.graphics.find((r) => r.attributes.id === e)), t;
114
114
  }
115
115
  /**
116
116
  * 绘制区控与子区
@@ -119,23 +119,23 @@ class x {
119
119
  * @returns
120
120
  */
121
121
  drawArea(e, t) {
122
- const i = e.getAllCrossCoordinates();
123
- if (i.length >= 2) {
124
- let r = null;
125
- if (i.length === 2)
126
- r = n.lineString(i);
127
- else if (i.length > 2) {
128
- const c = n.featureCollection(
129
- i.map((u) => n.point(u))
122
+ const r = e.getAllCrossCoordinates();
123
+ if (r.length >= 2) {
124
+ let i = null;
125
+ if (r.length === 2)
126
+ i = h.lineString(r);
127
+ else if (r.length > 2) {
128
+ const n = h.featureCollection(
129
+ r.map((p) => h.point(p))
130
130
  );
131
- r = d(c, { maxEdge: 400, units: "meters" }), r || (r = f(c));
131
+ t ? i = m(n) : (i = f(n, { maxEdge: 400, units: "meters" }), i || (i = m(n)));
132
132
  }
133
- if (!r) {
133
+ if (!i) {
134
134
  console.log("生成区控面失败", e);
135
135
  return;
136
136
  }
137
- const a = g(
138
- r.geometry,
137
+ const a = d(
138
+ i.geometry,
139
139
  // 区控面积更大,需要更大的缓冲半径
140
140
  t ? 200 : 30,
141
141
  {
@@ -166,7 +166,7 @@ class x {
166
166
  label: "路口数量"
167
167
  }
168
168
  ];
169
- const m = {
169
+ const u = {
170
170
  type: "signalControlArea",
171
171
  id: e.id,
172
172
  name: e.name,
@@ -174,7 +174,7 @@ class x {
174
174
  parentName: e.parentName,
175
175
  crossCount: e.crossCount,
176
176
  subDistrictCount: e.subDistrictCount
177
- }, h = new y({
177
+ }, c = new y({
178
178
  geometry: {
179
179
  type: "polygon",
180
180
  rings: a.geometry.coordinates
@@ -188,7 +188,7 @@ class x {
188
188
  style: t ? "solid" : "long-dash"
189
189
  }
190
190
  },
191
- attributes: m,
191
+ attributes: u,
192
192
  popupTemplate: {
193
193
  title: `${t ? "区控" : "子区"} ${e.name}`,
194
194
  content: [
@@ -199,33 +199,33 @@ class x {
199
199
  ]
200
200
  }
201
201
  });
202
- t ? this.districtControllerLayer.add(h) : this.subDistrictControllerLayer.add(h);
202
+ t ? this.districtControllerLayer.add(c) : this.subDistrictControllerLayer.add(c);
203
203
  }
204
- for (const r of e.subDistricts)
205
- this.drawArea(r, !1);
206
- const s = e.crosses.map((r) => {
204
+ for (const i of e.subDistricts)
205
+ this.drawArea(i, !1);
206
+ const s = e.crosses.map((i) => {
207
207
  const a = {
208
208
  type: "cross",
209
- id: r.id,
210
- name: r.name,
209
+ id: i.id,
210
+ name: i.name,
211
211
  color: e.areaColor,
212
- signalId: r.signalId,
212
+ signalId: i.signalId,
213
213
  districtId: t ? e.id : e.parentId,
214
214
  districtName: t ? e.name : e.parentName,
215
215
  subDistrictId: t ? "" : e.id,
216
216
  subDistrictName: t ? "" : e.name,
217
- isKey: r.isKey
217
+ isKey: i.isKey
218
218
  };
219
219
  return new y({
220
220
  geometry: {
221
221
  type: "point",
222
- x: r.longitude,
223
- y: r.latitude
222
+ x: i.longitude,
223
+ y: i.latitude
224
224
  },
225
225
  symbol: this.getCrossGraphicSymbol(a, "marker"),
226
226
  attributes: a,
227
227
  popupTemplate: {
228
- title: r.name,
228
+ title: i.name,
229
229
  content: [
230
230
  {
231
231
  type: "fields",
@@ -261,16 +261,16 @@ class x {
261
261
  * @returns
262
262
  */
263
263
  getCrossGraphicSymbol(e, t) {
264
- const { isKey: i, color: s } = e;
264
+ const { isKey: r, color: s } = e;
265
265
  if (t === "marker")
266
266
  return {
267
267
  type: "simple-marker",
268
- style: i ? "diamond" : "circle",
268
+ style: r ? "diamond" : "circle",
269
269
  color: s,
270
- size: i ? 16 : 8,
270
+ size: r ? 16 : 8,
271
271
  outline: {
272
- color: i ? "red" : "white",
273
- width: i ? 2 : 1
272
+ color: r ? "red" : "white",
273
+ width: r ? 2 : 1
274
274
  }
275
275
  };
276
276
  if (t === "picture")
@@ -285,7 +285,7 @@ class x {
285
285
  type: "CIMSymbolReference",
286
286
  primitiveOverrides: [
287
287
  {
288
- // 将textGraphic的TextString替换为graphic.attributes.showName
288
+ // 将textGraphic的TextString替换为graphic.attributes.name
289
289
  type: "CIMPrimitiveOverride",
290
290
  primitiveName: "textGraphic",
291
291
  propertyName: "TextString",
@@ -300,7 +300,7 @@ class x {
300
300
  symbol: {
301
301
  type: "CIMPointSymbol",
302
302
  symbolLayers: [
303
- // 车辆号牌
303
+ // 路口名称
304
304
  {
305
305
  type: "CIMVectorMarker",
306
306
  size: 32,
@@ -317,7 +317,7 @@ class x {
317
317
  height: 12,
318
318
  horizontalAlignment: "Center",
319
319
  offsetX: 0,
320
- offsetY: i ? 30 : 22,
320
+ offsetY: r ? 30 : 22,
321
321
  haloSize: 1,
322
322
  haloSymbol: {
323
323
  type: "CIMPolygonSymbol",
@@ -347,7 +347,7 @@ class x {
347
347
  scaleSymbolsProportionally: !0,
348
348
  respectFrame: !0
349
349
  },
350
- // 车辆图标
350
+ // 路口图标
351
351
  {
352
352
  type: "CIMPictureMarker",
353
353
  enable: !0,
@@ -356,10 +356,10 @@ class x {
356
356
  y: 0
357
357
  },
358
358
  anchorPointUnits: "Relative",
359
- size: i ? 45 : 30,
359
+ size: r ? 45 : 30,
360
360
  rotateClockwise: !0,
361
361
  textureFilter: "Picture",
362
- url: `/GisViewerAssets/Images/xhj_${i ? 4 : 1}.png`
362
+ url: `/GisViewerAssets/Images/xhj_${r ? 4 : 1}.png`
363
363
  }
364
364
  ]
365
365
  }
@@ -1,9 +1,9 @@
1
+ import Graphic from '@arcgis/core/Graphic';
1
2
  import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
2
3
  import MapView from '@arcgis/core/views/MapView';
3
4
  import SceneView from '@arcgis/core/views/SceneView';
4
- import SketchViewModel from '@arcgis/core/widgets/Sketch/SketchViewModel';
5
5
  import Sketch from '@arcgis/core/widgets/Sketch';
6
- import Graphic from '@arcgis/core/Graphic';
6
+ import SketchViewModel from '@arcgis/core/widgets/Sketch/SketchViewModel';
7
7
  interface sketchViewOptions {
8
8
  /**
9
9
  * 最大允许绘制的图形数量
@@ -16,7 +16,7 @@ interface sketchViewOptions {
16
16
  /**
17
17
  * 绘制工具显示的元素
18
18
  */
19
- sketchvisibleElements?: {};
19
+ sketchVisibleElements?: {};
20
20
  /**
21
21
  * 绘制工具显示的位置
22
22
  */
@@ -27,7 +27,7 @@ interface sketchViewOptions {
27
27
  * @type {boolean}
28
28
  * @memberof sketchViewOptions
29
29
  */
30
- defaultsketchVisible?: boolean;
30
+ defaultSketchVisible?: boolean;
31
31
  sketchViewModelItemSymbol?: {
32
32
  polylineSymbol?: any;
33
33
  polygonSymbol?: any;
@@ -42,7 +42,7 @@ declare type LinearUnits = 'meters' | 'feet' | 'kilometers' | 'miles' | 'nautica
42
42
  export default class SketchView {
43
43
  private viewer;
44
44
  graphicsLayer: GraphicsLayer;
45
- TextgraphicsLayer: GraphicsLayer;
45
+ TextGraphicsLayer: GraphicsLayer;
46
46
  sketchViewModel: SketchViewModel;
47
47
  sketch: Sketch;
48
48
  options: sketchViewOptions;
@@ -74,10 +74,10 @@ export default class SketchView {
74
74
  * @returns
75
75
  * @memberof SketchView
76
76
  */
77
- inintSectionArea(data: any, reverse?: boolean): any;
77
+ initSectionArea(data: any, reverse?: boolean): any;
78
78
  createPolylineGraphic(paths: any, lineSymbol: any, attributes: any): Graphic;
79
79
  createPolygonGraphic(rings: any, lineSymbol: any, attributes: any): Graphic;
80
- on(callcack?: (type: string, points: any, event?: any) => void): void;
80
+ on(callback?: (type: string, points: any, event?: any) => void): void;
81
81
  /**
82
82
  * 获取当前绘制的计算区域
83
83
  * @returns
@@ -105,7 +105,7 @@ export default class SketchView {
105
105
  attributes: any;
106
106
  };
107
107
  };
108
- rawdata: {
108
+ rawData: {
109
109
  point: any;
110
110
  type: string;
111
111
  attributes: any;
@@ -115,7 +115,7 @@ export default class SketchView {
115
115
  * 获取进口道所在的进口道编号
116
116
  *
117
117
  * @param {armData} armData 进口道编号区域
118
- * @param {*} graphicPpolygon 绘制的区域
118
+ * @param {*} graphicPolygon 绘制的区域
119
119
  * @returns
120
120
  * @memberof SketchView
121
121
  */
@@ -126,7 +126,7 @@ export default class SketchView {
126
126
  *
127
127
  * @private
128
128
  * @param {*} geometry
129
- * @param {boolean} [isfilterData=true] 是否过滤首尾相同点数据
129
+ * @param {boolean} [isFilterData=true] 是否过滤首尾相同点数据
130
130
  * @returns
131
131
  * @memberof SketchView
132
132
  */
@@ -152,7 +152,7 @@ export default class SketchView {
152
152
  * @returns
153
153
  * @memberof SketchView
154
154
  */
155
- getshiftLine(lineGeometry: __esri.Geometry, distance: number, offsetUnit?: LinearUnits): __esri.Geometry | __esri.Geometry[];
155
+ getShiftLine(lineGeometry: __esri.Geometry, distance: number, offsetUnit?: LinearUnits): __esri.Geometry | __esri.Geometry[];
156
156
  /**
157
157
  * 设置线的平移
158
158
  *
@@ -161,7 +161,7 @@ export default class SketchView {
161
161
  * @param {*} symbol 线的样式
162
162
  * @memberof SketchView
163
163
  */
164
- setshiftLine(distance: number, offsetUnit?: LinearUnits, symbol?: any): void;
164
+ setShiftLine(distance: number, offsetUnit?: LinearUnits, symbol?: any): void;
165
165
  /**
166
166
  * 移除平移线
167
167
  *
@@ -173,7 +173,7 @@ export default class SketchView {
173
173
  *
174
174
  * @memberof SketchView
175
175
  */
176
- removedraw(): void;
176
+ removeDraw(): void;
177
177
  addGraphic(geometry: any, symbol?: any, attributes?: any): void;
178
178
  /**
179
179
  * 获取方向
@@ -202,7 +202,7 @@ export default class SketchView {
202
202
  * 设置最大允许绘制的图形数量
203
203
  * @param num 数量
204
204
  */
205
- setmaxAllowedGraphics(num: number): void;
205
+ setMaxAllowedGraphics(num: number): void;
206
206
  deepClone(obj: any): void;
207
207
  destroy(): void;
208
208
  }