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.
- package/es/src/gis-map/gis-map.vue.mjs +32 -32
- package/es/src/gis-map/utils/components/sketch-tool.vue.mjs +2 -2
- package/es/src/gis-map/utils/components/sketch-tool.vue2.mjs +10 -10
- package/es/src/gis-map/utils/map-initializer.mjs +6 -6
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +57 -57
- package/es/src/gis-map/utils/sketchView.d.ts +14 -14
- package/es/src/gis-map/utils/sketchView.mjs +167 -163
- package/es/src/gis-map/utils/sketchViewTool.d.ts +16 -16
- package/es/src/gis-map/utils/sketchViewTool.mjs +39 -39
- package/es/style.css +1 -1
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/utils/components/sketch-tool.vue.js +1 -1
- package/lib/src/gis-map/utils/components/sketch-tool.vue2.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/lib/src/gis-map/utils/sketchView.d.ts +14 -14
- package/lib/src/gis-map/utils/sketchView.js +1 -1
- package/lib/src/gis-map/utils/sketchViewTool.d.ts +16 -16
- package/lib/src/gis-map/utils/sketchViewTool.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as ke, ref as
|
|
2
|
-
import
|
|
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
|
|
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
|
|
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(
|
|
21
|
-
const g =
|
|
22
|
-
let s, c, i, n, a,
|
|
23
|
-
const f =
|
|
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,
|
|
31
|
-
|
|
32
|
-
const Ce =
|
|
33
|
-
Ce.mapConfig =
|
|
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,
|
|
36
|
-
|
|
35
|
+
markerClickCallback: (m, d, y, Oe) => {
|
|
36
|
+
v("markerClick", m, d, y, Oe);
|
|
37
37
|
},
|
|
38
|
-
mapClickCallback: (m,
|
|
39
|
-
|
|
38
|
+
mapClickCallback: (m, d, y) => {
|
|
39
|
+
v("mapClick", m, d, y);
|
|
40
40
|
}
|
|
41
|
-
}), a = new Ne(s), await a.init(),
|
|
41
|
+
}), a = new Ne(s), await a.init(), v("mapLoaded");
|
|
42
42
|
}), De(() => {
|
|
43
|
-
|
|
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 =
|
|
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
|
|
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
|
|
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) => (
|
|
80
|
-
|
|
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
|
|
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) => (
|
|
101
|
-
|
|
102
|
-
}, ye = async (e) =>
|
|
103
|
-
return
|
|
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:
|
|
113
|
+
showAllOverlays: oe,
|
|
114
114
|
removeOverlaysByType: ae,
|
|
115
115
|
removeOverlaysById: ne,
|
|
116
|
-
removeAllOverlays:
|
|
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) => (
|
|
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
|
-
|
|
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
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f302a42f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
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
|
|
4
|
-
const
|
|
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
|
|
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
|
-
},
|
|
23
|
-
var
|
|
22
|
+
}, r = (e) => {
|
|
23
|
+
var s;
|
|
24
24
|
console.log(e);
|
|
25
|
-
const t = (
|
|
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",
|
|
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-
|
|
34
|
+
class: "esri-icon-cursor geometry-button",
|
|
35
35
|
value: "rectangle",
|
|
36
|
-
onClick:
|
|
36
|
+
onClick: r
|
|
37
37
|
}),
|
|
38
38
|
n("button", {
|
|
39
39
|
class: "esri-icon-polygon geometry-button",
|
|
40
40
|
value: "polygon",
|
|
41
|
-
onClick:
|
|
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
|
|
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
|
|
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 =
|
|
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/
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
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
|
|
40
|
-
this.drawArea(
|
|
39
|
+
const r = new b(t);
|
|
40
|
+
this.drawArea(r, !0);
|
|
41
41
|
}
|
|
42
|
-
return this.watchHandle =
|
|
42
|
+
return this.watchHandle = g.watch(
|
|
43
43
|
() => this.view.scale,
|
|
44
|
-
(t,
|
|
45
|
-
t > this.crossScale &&
|
|
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 &&
|
|
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((
|
|
90
|
-
(
|
|
91
|
-
).toArray().map((
|
|
92
|
-
(
|
|
93
|
-
).toArray().map((
|
|
94
|
-
return t.length > 0 && this.highlightLayer.addMany(t),
|
|
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
|
-
(
|
|
109
|
+
(r) => r.attributes.id === e
|
|
110
110
|
);
|
|
111
111
|
return t || (t = this.subDistrictControllerLayer.graphics.find(
|
|
112
|
-
(
|
|
113
|
-
)), t || (t = this.crossLayer.graphics.find((
|
|
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
|
|
123
|
-
if (
|
|
124
|
-
let
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
else if (
|
|
128
|
-
const
|
|
129
|
-
|
|
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
|
-
|
|
131
|
+
t ? i = m(n) : (i = f(n, { maxEdge: 400, units: "meters" }), i || (i = m(n)));
|
|
132
132
|
}
|
|
133
|
-
if (!
|
|
133
|
+
if (!i) {
|
|
134
134
|
console.log("生成区控面失败", e);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
const a =
|
|
138
|
-
|
|
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
|
|
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
|
-
},
|
|
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:
|
|
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(
|
|
202
|
+
t ? this.districtControllerLayer.add(c) : this.subDistrictControllerLayer.add(c);
|
|
203
203
|
}
|
|
204
|
-
for (const
|
|
205
|
-
this.drawArea(
|
|
206
|
-
const s = e.crosses.map((
|
|
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:
|
|
210
|
-
name:
|
|
209
|
+
id: i.id,
|
|
210
|
+
name: i.name,
|
|
211
211
|
color: e.areaColor,
|
|
212
|
-
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:
|
|
217
|
+
isKey: i.isKey
|
|
218
218
|
};
|
|
219
219
|
return new y({
|
|
220
220
|
geometry: {
|
|
221
221
|
type: "point",
|
|
222
|
-
x:
|
|
223
|
-
y:
|
|
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:
|
|
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:
|
|
264
|
+
const { isKey: r, color: s } = e;
|
|
265
265
|
if (t === "marker")
|
|
266
266
|
return {
|
|
267
267
|
type: "simple-marker",
|
|
268
|
-
style:
|
|
268
|
+
style: r ? "diamond" : "circle",
|
|
269
269
|
color: s,
|
|
270
|
-
size:
|
|
270
|
+
size: r ? 16 : 8,
|
|
271
271
|
outline: {
|
|
272
|
-
color:
|
|
273
|
-
width:
|
|
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.
|
|
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:
|
|
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:
|
|
359
|
+
size: r ? 45 : 30,
|
|
360
360
|
rotateClockwise: !0,
|
|
361
361
|
textureFilter: "Picture",
|
|
362
|
-
url: `/GisViewerAssets/Images/xhj_${
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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 {*}
|
|
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} [
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
205
|
+
setMaxAllowedGraphics(num: number): void;
|
|
206
206
|
deepClone(obj: any): void;
|
|
207
207
|
destroy(): void;
|
|
208
208
|
}
|