gisviewer-vue3-arcgis 1.0.122 → 1.0.124
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.d.ts +5 -0
- package/es/src/gis-map/gis-map.vue.mjs +103 -97
- package/es/src/gis-map/index.d.ts +4 -0
- package/es/src/gis-map/style/index.css +1 -1
- package/es/src/gis-map/utils/custom-layer/custom-wmts-layer.d.ts +6 -0
- package/es/src/gis-map/utils/custom-layer/custom-wmts-layer.mjs +21 -0
- package/es/src/gis-map/utils/map-initializer.mjs +43 -33
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +128 -116
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +20 -0
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.mjs +34 -0
- package/es/src/gis-map/utils/signal-control-area-controller/index.d.ts +15 -0
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +171 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +5 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +4 -0
- package/lib/src/gis-map/style/index.css +1 -1
- package/lib/src/gis-map/utils/custom-layer/custom-wmts-layer.d.ts +6 -0
- package/lib/src/gis-map/utils/custom-layer/custom-wmts-layer.js +1 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +4 -2
- package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +20 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.js +1 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/index.d.ts +15 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -0
- package/package.json +3 -1
|
@@ -7,6 +7,7 @@ import OpenDriveRenderer from './utils/open-drive-renderer';
|
|
|
7
7
|
import Overlay from './utils/overlay';
|
|
8
8
|
import QueueLength from './utils/queue-length';
|
|
9
9
|
import RoadConfigTool from './utils/road-config-tool';
|
|
10
|
+
import SignalControlAreaController from './utils/signal-control-area-controller';
|
|
10
11
|
import TrafficFlow from './utils/traffic-flow';
|
|
11
12
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
12
13
|
config: {
|
|
@@ -27,6 +28,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
27
28
|
overlay: Overlay;
|
|
28
29
|
queueLength: QueueLength;
|
|
29
30
|
openDriveRenderer: OpenDriveRenderer;
|
|
31
|
+
signalControlAreaController: SignalControlAreaController;
|
|
30
32
|
showLogDiv: import("vue").Ref<boolean>;
|
|
31
33
|
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
32
34
|
startSaveTrackLog: () => void;
|
|
@@ -72,6 +74,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
72
74
|
clearOpenDrive: () => Promise<void>;
|
|
73
75
|
findSumoInOpenDrive: (params: IFindSumoParams) => Promise<import("../types").IResult>;
|
|
74
76
|
splitOpenDriveLane: (params: ISplitOpenDriveLaneParams) => Promise<import("../types").IResult>;
|
|
77
|
+
showSignalControlArea: (params: any) => import("../types").IResult;
|
|
78
|
+
clearSignalControlArea: () => void;
|
|
79
|
+
locateSignalControlArea: (params: any) => import("../types").IResult;
|
|
75
80
|
props: any;
|
|
76
81
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
77
82
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick")[], "mapLoaded" | "markerClick" | "mapClick", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1,146 +1,152 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as de, ref as h, onMounted as ve, getCurrentInstance as ye, computed as Ce, openBlock as he, createElementBlock as Oe, createElementVNode as u, withDirectives as ke, vShow as Se } from "vue";
|
|
2
|
+
import O, { registerStore as Te } from "./stores/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
4
|
+
import Le from "./utils/holo-flow/index.mjs";
|
|
5
|
+
import Ae from "./utils/map-initializer.mjs";
|
|
6
|
+
import k from "./utils/open-drive-renderer/index.mjs";
|
|
7
|
+
import De from "./utils/overlay.mjs";
|
|
8
|
+
import be from "./utils/queue-length.mjs";
|
|
9
|
+
import S from "./utils/road-config-tool/index.mjs";
|
|
10
|
+
import Ie from "./utils/signal-control-area-controller/index.mjs";
|
|
11
|
+
import _e from "./utils/traffic-flow.mjs";
|
|
12
|
+
const xe = { class: "gis-viewer" }, Me = { style: { position: "absolute", bottom: "10px", left: "10px" } }, Ze = /* @__PURE__ */ de({
|
|
12
13
|
__name: "gis-map",
|
|
13
14
|
props: {
|
|
14
15
|
config: {},
|
|
15
16
|
assetsRoot: {}
|
|
16
17
|
},
|
|
17
18
|
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
18
|
-
setup(T, { expose: L, emit:
|
|
19
|
-
const
|
|
20
|
-
let s, i, o, n, r, a,
|
|
19
|
+
setup(T, { expose: L, emit: A }) {
|
|
20
|
+
const g = h(null);
|
|
21
|
+
let s, i, o, n, r, a, m, t, c;
|
|
21
22
|
const f = h(!1);
|
|
22
|
-
|
|
23
|
-
if (
|
|
23
|
+
ve(async () => {
|
|
24
|
+
if (Te(), !g.value)
|
|
24
25
|
return;
|
|
25
|
-
document.addEventListener("keydown", (
|
|
26
|
-
|
|
26
|
+
document.addEventListener("keydown", (p) => {
|
|
27
|
+
p.ctrlKey && p.key === "i" && (f.value = !f.value);
|
|
27
28
|
});
|
|
28
|
-
const e =
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
container:
|
|
33
|
-
markerClickCallback: (
|
|
34
|
-
|
|
29
|
+
const e = ye(), { $gisviewerAssetsRoot: l } = e.appContext.config.globalProperties, C = await (await fetch(y.config)).json();
|
|
30
|
+
C.assetsRoot = y.assetsRoot || l;
|
|
31
|
+
const fe = O.useAppDataStore;
|
|
32
|
+
fe.mapConfig = C, i = new Ae(), s = await i.initialize({
|
|
33
|
+
container: g.value,
|
|
34
|
+
markerClickCallback: (p, d, v, we) => {
|
|
35
|
+
w("markerClick", p, d, v, we);
|
|
35
36
|
},
|
|
36
|
-
mapClickCallback: (
|
|
37
|
-
|
|
37
|
+
mapClickCallback: (p, d, v) => {
|
|
38
|
+
w("mapClick", p, d, v);
|
|
38
39
|
}
|
|
39
|
-
}), r = new
|
|
40
|
+
}), r = new Le(s), await r.init(), w("mapLoaded");
|
|
40
41
|
});
|
|
41
|
-
const
|
|
42
|
-
const e =
|
|
42
|
+
const D = Ce(() => s), b = () => {
|
|
43
|
+
const e = O.useAppDataStore;
|
|
43
44
|
e.saveTrackLog = !0;
|
|
44
45
|
}, I = () => {
|
|
45
46
|
r.downloadTrackLog();
|
|
46
|
-
},
|
|
47
|
+
}, _ = async (e) => await i.setMapCenter(e), x = async (e) => await i.setMapCamera(e), M = async (e) => await i.lookAt(e), F = (e) => i.setLayerVisibility(e), V = (e, l) => i.requestCoordinateTransform(e, l), B = (e) => {
|
|
47
48
|
i.cancelCoordinateTransform(e);
|
|
48
|
-
},
|
|
49
|
+
}, H = (e) => {
|
|
49
50
|
i.setMapZoomRange(e);
|
|
50
|
-
},
|
|
51
|
+
}, z = (e) => (o || (o = new S(s)), o.showLaneNumber(e)), N = () => {
|
|
51
52
|
o == null || o.clearLaneNumber();
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
n || (n = new
|
|
55
|
-
},
|
|
53
|
+
}, Q = async (e) => (o || (o = new S(s)), await o.initializeSearch(e)), j = async () => o == null ? void 0 : o.calCrossIndicatorArea(), P = async () => {
|
|
54
|
+
}, R = async (e, l) => {
|
|
55
|
+
n || (n = new _e(s)), n.connectTrafficFlow(e, l);
|
|
56
|
+
}, E = () => {
|
|
56
57
|
n == null || n.disconnectTrafficFlow();
|
|
57
|
-
},
|
|
58
|
+
}, Z = (e) => {
|
|
58
59
|
r.handleVehicleTraceData(e);
|
|
59
|
-
},
|
|
60
|
+
}, q = () => {
|
|
60
61
|
r.clearHoloTrace();
|
|
61
|
-
},
|
|
62
|
+
}, K = (e) => {
|
|
62
63
|
r.setInterpolate(e);
|
|
63
|
-
},
|
|
64
|
+
}, $ = async (e) => {
|
|
64
65
|
await r.handleSignalData(e);
|
|
65
|
-
},
|
|
66
|
+
}, G = () => {
|
|
66
67
|
r.clearHoloSignal();
|
|
67
|
-
}, G = (e) => {
|
|
68
|
-
n == null || n.toggleTrafficInfo(e), r.toggleTrafficInfo(e);
|
|
69
68
|
}, J = (e) => {
|
|
70
|
-
r.
|
|
69
|
+
n == null || n.toggleTrafficInfo(e), r.toggleTrafficInfo(e);
|
|
71
70
|
}, U = (e) => {
|
|
72
|
-
|
|
71
|
+
r.togglePause(e);
|
|
73
72
|
}, W = (e) => {
|
|
73
|
+
n == null || n.toggleTrafficObject(e), r.toggleTrafficObject(e);
|
|
74
|
+
}, X = (e) => {
|
|
74
75
|
r.updatePanelContent(e);
|
|
75
|
-
},
|
|
76
|
+
}, Y = async (e) => (a || (a = new De(s)), a.addOverlays(e)), ee = (e) => a == null ? void 0 : a.removeOverlaysByType(e), te = (e) => a == null ? void 0 : a.removeOverlaysById(e), ae = () => a == null ? void 0 : a.removeAllOverlays(), oe = () => {
|
|
76
77
|
a == null || a.showAllOverlays();
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
},
|
|
78
|
+
}, ne = (e) => {
|
|
79
|
+
m || (m = new be(s)), m.updateQueueLength(e);
|
|
80
|
+
}, re = () => {
|
|
81
|
+
m == null || m.removeQueueLength();
|
|
82
|
+
}, se = async (e, l) => (t || (t = new k(s)), await t.showOpenDriveFromServer(e, l)), ie = async (e) => (t || (t = new k(s)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ce = async () => await (t == null ? void 0 : t.clearOpenDrive()), le = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
82
83
|
status: -1,
|
|
83
84
|
message: "未加载OpenDrive地图"
|
|
84
|
-
},
|
|
85
|
+
}, me = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
|
|
85
86
|
status: -1,
|
|
86
87
|
message: "未加载OpenDrive地图"
|
|
87
|
-
},
|
|
88
|
+
}, pe = (e) => (c || (c = new Ie(s)), c.showSignalControlArea(e)), ue = () => {
|
|
89
|
+
c == null || c.clearSignalControlArea();
|
|
90
|
+
}, ge = (e) => c ? c.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, y = T, w = A;
|
|
88
91
|
return L({
|
|
89
|
-
mapViewer:
|
|
90
|
-
setLayerVisibility:
|
|
91
|
-
setMapCenter:
|
|
92
|
-
lookAt:
|
|
93
|
-
setMapCamera:
|
|
94
|
-
setMapZoomRange:
|
|
95
|
-
requestCoordinateTransform:
|
|
96
|
-
cancelCoordinateTransform:
|
|
97
|
-
addOverlays:
|
|
98
|
-
showAllOverlays:
|
|
99
|
-
removeOverlaysByType:
|
|
100
|
-
removeOverlaysById:
|
|
101
|
-
removeAllOverlays:
|
|
102
|
-
showLaneNumber:
|
|
103
|
-
clearLaneNumber:
|
|
104
|
-
initializeAreaTool:
|
|
105
|
-
calCrossIndicatorArea:
|
|
106
|
-
calRoadIndicatorArea:
|
|
107
|
-
connectCarFlow:
|
|
108
|
-
disconnectCarFlow:
|
|
109
|
-
handleHoloVehicleTraceData:
|
|
110
|
-
clearHoloTrace:
|
|
111
|
-
handleHoloSignalData:
|
|
112
|
-
clearHoloSignal:
|
|
113
|
-
setInterpolate:
|
|
114
|
-
toggleTrafficInfo:
|
|
115
|
-
toggleTrafficObject:
|
|
116
|
-
toggleVehicleInfo:
|
|
117
|
-
togglePause:
|
|
118
|
-
updateQueueLength:
|
|
119
|
-
removeQueueLength:
|
|
120
|
-
showOpenDriveFromServer:
|
|
121
|
-
showOpenDriveFromFile:
|
|
122
|
-
clearOpenDrive:
|
|
123
|
-
findSumoInOpenDrive:
|
|
124
|
-
splitOpenDriveLane:
|
|
125
|
-
|
|
126
|
-
|
|
92
|
+
mapViewer: D,
|
|
93
|
+
setLayerVisibility: F,
|
|
94
|
+
setMapCenter: _,
|
|
95
|
+
lookAt: M,
|
|
96
|
+
setMapCamera: x,
|
|
97
|
+
setMapZoomRange: H,
|
|
98
|
+
requestCoordinateTransform: V,
|
|
99
|
+
cancelCoordinateTransform: B,
|
|
100
|
+
addOverlays: Y,
|
|
101
|
+
showAllOverlays: oe,
|
|
102
|
+
removeOverlaysByType: ee,
|
|
103
|
+
removeOverlaysById: te,
|
|
104
|
+
removeAllOverlays: ae,
|
|
105
|
+
showLaneNumber: z,
|
|
106
|
+
clearLaneNumber: N,
|
|
107
|
+
initializeAreaTool: Q,
|
|
108
|
+
calCrossIndicatorArea: j,
|
|
109
|
+
calRoadIndicatorArea: P,
|
|
110
|
+
connectCarFlow: R,
|
|
111
|
+
disconnectCarFlow: E,
|
|
112
|
+
handleHoloVehicleTraceData: Z,
|
|
113
|
+
clearHoloTrace: q,
|
|
114
|
+
handleHoloSignalData: $,
|
|
115
|
+
clearHoloSignal: G,
|
|
116
|
+
setInterpolate: K,
|
|
117
|
+
toggleTrafficInfo: J,
|
|
118
|
+
toggleTrafficObject: W,
|
|
119
|
+
toggleVehicleInfo: X,
|
|
120
|
+
togglePause: U,
|
|
121
|
+
updateQueueLength: ne,
|
|
122
|
+
removeQueueLength: re,
|
|
123
|
+
showOpenDriveFromServer: se,
|
|
124
|
+
showOpenDriveFromFile: ie,
|
|
125
|
+
clearOpenDrive: ce,
|
|
126
|
+
findSumoInOpenDrive: le,
|
|
127
|
+
splitOpenDriveLane: me,
|
|
128
|
+
showSignalControlArea: pe,
|
|
129
|
+
clearSignalControlArea: ue,
|
|
130
|
+
locateSignalControlArea: ge
|
|
131
|
+
}), (e, l) => (he(), Oe("div", xe, [
|
|
132
|
+
u("div", {
|
|
127
133
|
class: "gis-viewer-main",
|
|
128
134
|
ref_key: "mapContainer",
|
|
129
|
-
ref:
|
|
135
|
+
ref: g
|
|
130
136
|
}, [
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
ke(u("div", Me, [
|
|
138
|
+
u("button", {
|
|
133
139
|
style: { "margin-right": "10px" },
|
|
134
140
|
onClick: b
|
|
135
141
|
}, " 开始记录 "),
|
|
136
|
-
|
|
142
|
+
u("button", { onClick: I }, "下载日志")
|
|
137
143
|
], 512), [
|
|
138
|
-
[
|
|
144
|
+
[Se, f.value]
|
|
139
145
|
])
|
|
140
146
|
], 512)
|
|
141
147
|
]));
|
|
142
148
|
}
|
|
143
149
|
});
|
|
144
150
|
export {
|
|
145
|
-
|
|
151
|
+
Ze as default
|
|
146
152
|
};
|
|
@@ -17,6 +17,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
17
17
|
overlay: import("./utils/overlay").default;
|
|
18
18
|
queueLength: import("./utils/queue-length").default;
|
|
19
19
|
openDriveRenderer: import("./utils/open-drive-renderer").default;
|
|
20
|
+
signalControlAreaController: import("./utils/signal-control-area-controller").default;
|
|
20
21
|
showLogDiv: import("vue").Ref<boolean>;
|
|
21
22
|
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
22
23
|
startSaveTrackLog: () => void;
|
|
@@ -62,6 +63,9 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
62
63
|
clearOpenDrive: () => Promise<void>;
|
|
63
64
|
findSumoInOpenDrive: (params: import("../types").IFindSumoParams) => Promise<import("../types").IResult>;
|
|
64
65
|
splitOpenDriveLane: (params: import("../types").ISplitOpenDriveLaneParams) => Promise<import("../types").IResult>;
|
|
66
|
+
showSignalControlArea: (params: any) => import("../types").IResult;
|
|
67
|
+
clearSignalControlArea: () => void;
|
|
68
|
+
locateSignalControlArea: (params: any) => import("../types").IResult;
|
|
65
69
|
props: any;
|
|
66
70
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
67
71
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick")[], "mapLoaded" | "markerClick" | "mapClick", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { subclass as a } from "@arcgis/core/core/accessorSupport/decorators";
|
|
2
|
+
import c from "@arcgis/core/layers/BaseTileLayer.js";
|
|
3
|
+
var i = Object.defineProperty, m = Object.getOwnPropertyDescriptor, f = (e, l, t, s) => {
|
|
4
|
+
for (var r = s > 1 ? void 0 : s ? m(l, t) : l, p = e.length - 1, o; p >= 0; p--)
|
|
5
|
+
(o = e[p]) && (r = (s ? o(l, t, r) : o(r)) || r);
|
|
6
|
+
return s && r && i(l, t, r), r;
|
|
7
|
+
};
|
|
8
|
+
let u = class extends c {
|
|
9
|
+
constructor(e) {
|
|
10
|
+
super(e), this.urlTemplate = "", this.urlTemplate = e.urlTemplate;
|
|
11
|
+
}
|
|
12
|
+
getTileUrl(e, l, t) {
|
|
13
|
+
return this.urlTemplate.replace("{level}", String(e)).replace("{col}", String(t)).replace("{row}", String(l));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
u = f([
|
|
17
|
+
a("CustomWMTS")
|
|
18
|
+
], u);
|
|
19
|
+
export {
|
|
20
|
+
u as default
|
|
21
|
+
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import b from "@arcgis/core/Basemap";
|
|
2
|
-
import
|
|
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 P, Polyline as W, Point as T } from "@arcgis/core/geometry";
|
|
5
5
|
import * as f from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
6
|
-
import
|
|
6
|
+
import z from "@arcgis/core/layers/GeoJSONLayer";
|
|
7
7
|
import x from "@arcgis/core/layers/TileLayer";
|
|
8
8
|
import L from "@arcgis/core/layers/WebTileLayer";
|
|
9
9
|
import S from "@arcgis/core/Map";
|
|
10
10
|
import R from "@arcgis/core/views/MapView";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
import C from "@arcgis/core/views/SceneView";
|
|
12
|
+
import H from "@turf/destination";
|
|
13
|
+
import * as I from "@turf/helpers";
|
|
14
|
+
import O from "../stores/index.mjs";
|
|
15
|
+
import G from "./custom-layer/custom-wmts-layer.mjs";
|
|
16
|
+
function k(l, e) {
|
|
17
|
+
return l && (l.startsWith("http://") || l.startsWith("https://") ? l : e + l);
|
|
17
18
|
}
|
|
18
|
-
class
|
|
19
|
+
class F {
|
|
19
20
|
constructor() {
|
|
20
21
|
this.mapConfig = {}, this.watchHandleMap = /* @__PURE__ */ new Map(), this.handleIndex = 0, this.zoomWatchHandle = null;
|
|
21
22
|
}
|
|
@@ -25,16 +26,16 @@ class Q {
|
|
|
25
26
|
* @returns view
|
|
26
27
|
*/
|
|
27
28
|
async initialize(e) {
|
|
28
|
-
const i =
|
|
29
|
+
const i = O.useAppDataStore, t = JSON.parse(JSON.stringify(i.mapConfig));
|
|
29
30
|
this.mapConfig = t;
|
|
30
31
|
const { container: a, markerClickCallback: r, mapClickCallback: d } = e;
|
|
31
|
-
|
|
32
|
+
g.assetsPath = `${t.assetsRoot}/ArcgisAssets`, g.fontsUrl = `${t.assetsRoot}/fonts`, g.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
|
|
32
33
|
const n = new S();
|
|
33
34
|
if ((t == null ? void 0 : t.mapOptions.mode.toLowerCase()) === "2d" ? this.view = new R({
|
|
34
35
|
map: n,
|
|
35
36
|
container: a,
|
|
36
37
|
...t.mapOptions
|
|
37
|
-
}) : this.view = new
|
|
38
|
+
}) : this.view = new C({
|
|
38
39
|
map: n,
|
|
39
40
|
container: a,
|
|
40
41
|
environment: {
|
|
@@ -76,7 +77,8 @@ class Q {
|
|
|
76
77
|
o
|
|
77
78
|
)), console.log({
|
|
78
79
|
center: o.toJSON(),
|
|
79
|
-
zoom: this.view.zoom
|
|
80
|
+
zoom: this.view.zoom,
|
|
81
|
+
scale: this.view.scale
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
84
|
const c = (v = (await this.view.hitTest(s)).results) == null ? void 0 : v.filter(
|
|
@@ -93,11 +95,11 @@ class Q {
|
|
|
93
95
|
);
|
|
94
96
|
});
|
|
95
97
|
}), t != null && t.baseLayers ? t.baseLayers.forEach((s) => {
|
|
96
|
-
const
|
|
98
|
+
const h = k(s.url, t.assetsRoot);
|
|
97
99
|
switch (s.type.toLowerCase()) {
|
|
98
100
|
case "webTile".toLowerCase(): {
|
|
99
101
|
const c = new L({
|
|
100
|
-
urlTemplate:
|
|
102
|
+
urlTemplate: h,
|
|
101
103
|
...s.options
|
|
102
104
|
});
|
|
103
105
|
n.add(c);
|
|
@@ -105,7 +107,15 @@ class Q {
|
|
|
105
107
|
}
|
|
106
108
|
case "tile": {
|
|
107
109
|
const c = new x({
|
|
108
|
-
url:
|
|
110
|
+
url: h,
|
|
111
|
+
...s.options
|
|
112
|
+
});
|
|
113
|
+
n.add(c);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "customWMTS".toLowerCase(): {
|
|
117
|
+
const c = new G({
|
|
118
|
+
urlTemplate: h,
|
|
109
119
|
...s.options
|
|
110
120
|
});
|
|
111
121
|
n.add(c);
|
|
@@ -124,12 +134,12 @@ class Q {
|
|
|
124
134
|
}
|
|
125
135
|
}), t != null && t.hdLayers) {
|
|
126
136
|
const s = t.hdLayers.map(
|
|
127
|
-
(
|
|
137
|
+
(h) => (
|
|
128
138
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
129
|
-
new
|
|
130
|
-
url: k(
|
|
131
|
-
...
|
|
132
|
-
title:
|
|
139
|
+
new z({
|
|
140
|
+
url: k(h.url, t.assetsRoot),
|
|
141
|
+
...h.options,
|
|
142
|
+
title: h.options.id
|
|
133
143
|
})
|
|
134
144
|
)
|
|
135
145
|
);
|
|
@@ -137,23 +147,23 @@ class Q {
|
|
|
137
147
|
}
|
|
138
148
|
this.view.ui.remove("attribution"), this.view.ui.add("compass", "top-left"), await this.view.when();
|
|
139
149
|
const p = this.mapConfig.camera;
|
|
140
|
-
let
|
|
150
|
+
let u;
|
|
141
151
|
if (this.view.type === "2d") {
|
|
142
152
|
let s = this.view.center;
|
|
143
153
|
this.view.spatialReference.isWebMercator && (s = f.webMercatorToGeographic(
|
|
144
154
|
s
|
|
145
|
-
)),
|
|
155
|
+
)), u = { center: [s.x, s.y], zoom: this.view.zoom };
|
|
146
156
|
} else {
|
|
147
157
|
let s = this.view.camera.position;
|
|
148
158
|
this.view.spatialReference.isWebMercator && (s = f.webMercatorToGeographic(
|
|
149
159
|
s
|
|
150
|
-
)),
|
|
160
|
+
)), u = {
|
|
151
161
|
position: s,
|
|
152
162
|
heading: this.view.camera.heading,
|
|
153
163
|
tilt: this.view.camera.tilt
|
|
154
164
|
};
|
|
155
165
|
}
|
|
156
|
-
return p ? p.home =
|
|
166
|
+
return p ? p.home = u : this.mapConfig.camera = { home: u }, this.view;
|
|
157
167
|
}
|
|
158
168
|
setLayerVisibility(e) {
|
|
159
169
|
const { id: i, visible: t } = e, a = this.view.map.findLayerById(i);
|
|
@@ -171,13 +181,13 @@ class Q {
|
|
|
171
181
|
if (e.center || e.target) {
|
|
172
182
|
switch ((i = e.target) == null ? void 0 : i.type) {
|
|
173
183
|
case "point":
|
|
174
|
-
e.target = new
|
|
184
|
+
e.target = new T(e.target);
|
|
175
185
|
break;
|
|
176
186
|
case "polyline":
|
|
177
|
-
e.target = new
|
|
187
|
+
e.target = new W(e.target);
|
|
178
188
|
break;
|
|
179
189
|
case "polygon":
|
|
180
|
-
e.target = new
|
|
190
|
+
e.target = new P(e.target);
|
|
181
191
|
break;
|
|
182
192
|
}
|
|
183
193
|
await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
|
|
@@ -205,8 +215,8 @@ class Q {
|
|
|
205
215
|
{ duration: (e.duration || 2) * 1e3 }
|
|
206
216
|
);
|
|
207
217
|
else {
|
|
208
|
-
const a = Math.tan(i * Math.PI / 180) * e.height, r =
|
|
209
|
-
|
|
218
|
+
const a = Math.tan(i * Math.PI / 180) * e.height, r = H(
|
|
219
|
+
I.point(e.center),
|
|
210
220
|
a,
|
|
211
221
|
t + 180,
|
|
212
222
|
{
|
|
@@ -252,7 +262,7 @@ class Q {
|
|
|
252
262
|
}
|
|
253
263
|
transformPoints(e) {
|
|
254
264
|
return e.map((i) => {
|
|
255
|
-
const t = new
|
|
265
|
+
const t = new T({
|
|
256
266
|
x: i[0],
|
|
257
267
|
y: i[1]
|
|
258
268
|
}), a = this.view.toScreen(t);
|
|
@@ -280,5 +290,5 @@ class Q {
|
|
|
280
290
|
}
|
|
281
291
|
}
|
|
282
292
|
export {
|
|
283
|
-
|
|
293
|
+
F as default
|
|
284
294
|
};
|
|
@@ -18,6 +18,7 @@ export default class OpenDriveRenderer {
|
|
|
18
18
|
private projectName;
|
|
19
19
|
private openDriveServer;
|
|
20
20
|
private openDriveClickCallback;
|
|
21
|
+
private makeMd5FromFile;
|
|
21
22
|
showOpenDriveFromFile(params: IShowOpenDriveFromFileParams): Promise<IResult>;
|
|
22
23
|
/**
|
|
23
24
|
* 从服务器载入OpenDrive文件解析结果并显示
|