gisviewer-vue3-arcgis 1.0.119 → 1.0.121
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/utils/common-utils.d.ts +4 -3
- package/es/src/gis-map/utils/common-utils.mjs +21 -8
- package/es/src/gis-map/utils/map-initializer.mjs +100 -99
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +23 -3
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +294 -136
- package/es/src/gis-map/utils/open-drive-renderer/junction.d.ts +2 -1
- package/es/src/gis-map/utils/open-drive-renderer/road.d.ts +2 -0
- package/es/src/gis-map/utils/open-drive-renderer/road.mjs +16 -8
- package/es/src/gis-map/utils/open-drive-renderer/wasm-loader.d.ts +20 -0
- package/es/src/gis-map/utils/open-drive-renderer/wasm-loader.mjs +154 -104
- package/es/src/types/index.d.ts +11 -0
- package/lib/src/gis-map/utils/common-utils.d.ts +4 -3
- package/lib/src/gis-map/utils/common-utils.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +23 -3
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +2 -1
- package/lib/src/gis-map/utils/open-drive-renderer/junction.d.ts +2 -1
- package/lib/src/gis-map/utils/open-drive-renderer/road.d.ts +2 -0
- package/lib/src/gis-map/utils/open-drive-renderer/road.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/wasm-loader.d.ts +20 -0
- package/lib/src/gis-map/utils/open-drive-renderer/wasm-loader.js +1 -1
- package/lib/src/types/index.d.ts +11 -0
- package/package.json +1 -1
|
@@ -66,9 +66,9 @@ export default class CommonUtils {
|
|
|
66
66
|
static getStdVecEntries(std_vec: any, delete_vec?: boolean): any[];
|
|
67
67
|
static getStdMapEntries(std_map: any): any[];
|
|
68
68
|
static getStdMapKeys(std_map: any, delete_map?: boolean): any[];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
static geoReference: string;
|
|
70
|
+
static xOffset: number;
|
|
71
|
+
static yOffset: number;
|
|
72
72
|
static setGeoData(geoReference: string, xOffset: number, yOffset: number): void;
|
|
73
73
|
/**
|
|
74
74
|
* OpenDrive坐标转换为WGS84坐标
|
|
@@ -76,6 +76,7 @@ export default class CommonUtils {
|
|
|
76
76
|
* @returns
|
|
77
77
|
*/
|
|
78
78
|
static transformLineProjection(line: number[][]): number[][];
|
|
79
|
+
static transformPointProjection(point: number[]): number[];
|
|
79
80
|
static pointsEqual(point1: number[], point2: number[]): boolean;
|
|
80
81
|
static getExtensionLine(pt1: number[], pt2: number[], distance: number): turf.Position;
|
|
81
82
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Point as
|
|
1
|
+
import { Point as L, Polyline as f } from "@arcgis/core/geometry";
|
|
2
2
|
import * as g from "@arcgis/core/geometry/geometryEngineAsync";
|
|
3
3
|
import * as y from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
4
4
|
import u from "@turf/bearing";
|
|
5
5
|
import p from "@turf/destination";
|
|
6
6
|
import * as a from "@turf/helpers";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import l from "pako";
|
|
8
|
+
import h from "proj4";
|
|
9
9
|
class i {
|
|
10
10
|
/**
|
|
11
11
|
* 得到某个点在一定方向、距离之外的另一个点
|
|
@@ -18,7 +18,7 @@ class i {
|
|
|
18
18
|
const r = a.point([t.x, t.y]), s = p(r, n, e, {
|
|
19
19
|
units: "meters"
|
|
20
20
|
});
|
|
21
|
-
return new
|
|
21
|
+
return new L({
|
|
22
22
|
x: s.geometry.coordinates[0],
|
|
23
23
|
y: s.geometry.coordinates[1]
|
|
24
24
|
});
|
|
@@ -40,12 +40,12 @@ class i {
|
|
|
40
40
|
static extendLineInTowDir(t, e) {
|
|
41
41
|
const n = t.paths[0], r = a.point(n[0]), s = a.point(n[1]), o = u(s, r), c = p(r, e, o, {
|
|
42
42
|
units: "meters"
|
|
43
|
-
}),
|
|
43
|
+
}), P = o > 0 ? o - 180 : o + 180, O = p(s, e, P, {
|
|
44
44
|
units: "meters"
|
|
45
45
|
});
|
|
46
46
|
return new f({
|
|
47
47
|
paths: [
|
|
48
|
-
[c.geometry.coordinates,
|
|
48
|
+
[c.geometry.coordinates, O.geometry.coordinates]
|
|
49
49
|
]
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -149,7 +149,7 @@ class i {
|
|
|
149
149
|
e.push(o.charCodeAt(0));
|
|
150
150
|
}
|
|
151
151
|
const r = new Uint8Array(e);
|
|
152
|
-
return
|
|
152
|
+
return l.inflate(r, { to: "string" });
|
|
153
153
|
} catch {
|
|
154
154
|
console.log(`非压缩内容: ${t}`);
|
|
155
155
|
}
|
|
@@ -183,7 +183,7 @@ class i {
|
|
|
183
183
|
static transformLineProjection(t) {
|
|
184
184
|
try {
|
|
185
185
|
return t.map(
|
|
186
|
-
(e) =>
|
|
186
|
+
(e) => h(i.geoReference).inverse([
|
|
187
187
|
e[0] - i.xOffset,
|
|
188
188
|
e[1] - i.yOffset
|
|
189
189
|
])
|
|
@@ -195,6 +195,19 @@ class i {
|
|
|
195
195
|
), t;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
static transformPointProjection(t) {
|
|
199
|
+
try {
|
|
200
|
+
return h(i.geoReference).inverse([
|
|
201
|
+
t[0] - i.xOffset,
|
|
202
|
+
t[1] - i.yOffset
|
|
203
|
+
]);
|
|
204
|
+
} catch {
|
|
205
|
+
return console.error(
|
|
206
|
+
"OpenDrive坐标转换为WGS84坐标失败",
|
|
207
|
+
i.geoReference
|
|
208
|
+
), t;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
198
211
|
static pointsEqual(t, e) {
|
|
199
212
|
return Math.abs(t[0] - e[0]) < Number.EPSILON && Math.abs(t[1] - e[1]) < Number.EPSILON;
|
|
200
213
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Polygon as z, Polyline as W, Point as k } from "@arcgis/core/geometry";
|
|
1
|
+
import b from "@arcgis/core/Basemap";
|
|
2
|
+
import u from "@arcgis/core/config";
|
|
3
|
+
import * as M from "@arcgis/core/core/reactiveUtils";
|
|
4
|
+
import { Polygon as T, Polyline as z, Point as P } from "@arcgis/core/geometry";
|
|
6
5
|
import * as f from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import S from "@arcgis/core/
|
|
6
|
+
import W from "@arcgis/core/layers/GeoJSONLayer";
|
|
7
|
+
import x from "@arcgis/core/layers/TileLayer";
|
|
8
|
+
import L from "@arcgis/core/layers/WebTileLayer";
|
|
9
|
+
import S from "@arcgis/core/Map";
|
|
10
|
+
import R from "@arcgis/core/views/MapView";
|
|
11
11
|
import H from "@arcgis/core/views/SceneView";
|
|
12
12
|
import I from "@turf/destination";
|
|
13
13
|
import * as O from "@turf/helpers";
|
|
14
|
-
import
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
import C from "../stores/index.mjs";
|
|
15
|
+
function k(h, e) {
|
|
16
|
+
return h && (h.startsWith("http://") || h.startsWith("https://") ? h : e + h);
|
|
17
17
|
}
|
|
18
18
|
class Q {
|
|
19
19
|
constructor() {
|
|
@@ -24,18 +24,18 @@ class Q {
|
|
|
24
24
|
* @param params 容器
|
|
25
25
|
* @returns view
|
|
26
26
|
*/
|
|
27
|
-
async initialize(
|
|
28
|
-
const i =
|
|
29
|
-
this.mapConfig =
|
|
30
|
-
const { container: a, markerClickCallback: r, mapClickCallback: d } =
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
if ((
|
|
34
|
-
map:
|
|
27
|
+
async initialize(e) {
|
|
28
|
+
const i = C.useAppDataStore, t = JSON.parse(JSON.stringify(i.mapConfig));
|
|
29
|
+
this.mapConfig = t;
|
|
30
|
+
const { container: a, markerClickCallback: r, mapClickCallback: d } = e;
|
|
31
|
+
u.assetsPath = `${t.assetsRoot}/ArcgisAssets`, u.fontsUrl = `${t.assetsRoot}/fonts`, u.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
|
|
32
|
+
const n = new S();
|
|
33
|
+
if ((t == null ? void 0 : t.mapOptions.mode.toLowerCase()) === "2d" ? this.view = new R({
|
|
34
|
+
map: n,
|
|
35
35
|
container: a,
|
|
36
|
-
...
|
|
36
|
+
...t.mapOptions
|
|
37
37
|
}) : this.view = new H({
|
|
38
|
-
map:
|
|
38
|
+
map: n,
|
|
39
39
|
container: a,
|
|
40
40
|
environment: {
|
|
41
41
|
atmosphereEnabled: !0,
|
|
@@ -43,9 +43,9 @@ class Q {
|
|
|
43
43
|
type: "virtual"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
...
|
|
46
|
+
...t == null ? void 0 : t.mapOptions
|
|
47
47
|
}), this.view.on("click", async (s) => {
|
|
48
|
-
var
|
|
48
|
+
var y, v;
|
|
49
49
|
if (d) {
|
|
50
50
|
let o = s.mapPoint;
|
|
51
51
|
o.spatialReference.isWebMercator && (o = f.webMercatorToGeographic(
|
|
@@ -59,14 +59,14 @@ class Q {
|
|
|
59
59
|
if (this.view.type === "3d") {
|
|
60
60
|
const o = this.view.camera;
|
|
61
61
|
if (this.view.spatialReference.isWebMercator) {
|
|
62
|
-
const
|
|
62
|
+
const m = f.webMercatorToGeographic(
|
|
63
63
|
o.position
|
|
64
64
|
), w = {
|
|
65
65
|
heading: o.heading,
|
|
66
66
|
tilt: o.tilt,
|
|
67
|
-
position:
|
|
67
|
+
position: m.toJSON()
|
|
68
68
|
};
|
|
69
|
-
console.log(w), (
|
|
69
|
+
console.log(w), (y = navigator.clipboard) == null || y.writeText(JSON.stringify(w));
|
|
70
70
|
} else
|
|
71
71
|
console.log(o.toJSON());
|
|
72
72
|
console.log(this.view.zoom, this.view.scale);
|
|
@@ -79,135 +79,136 @@ class Q {
|
|
|
79
79
|
zoom: this.view.zoom
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const c = (v = (await this.view.hitTest(s)).results) == null ? void 0 : v.filter(
|
|
83
83
|
(o) => o.type === "graphic"
|
|
84
84
|
);
|
|
85
|
-
|
|
85
|
+
c.length > 0 && c.forEach((o) => {
|
|
86
86
|
var w;
|
|
87
|
-
const
|
|
88
|
-
(w =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
const m = o.graphic;
|
|
88
|
+
(w = m.attributes) != null && w.type && r && r(
|
|
89
|
+
m.attributes.type,
|
|
90
|
+
m.attributes.id,
|
|
91
|
+
m.attributes,
|
|
92
92
|
s
|
|
93
93
|
);
|
|
94
94
|
});
|
|
95
|
-
}),
|
|
95
|
+
}), t != null && t.baseLayers ? t.baseLayers.forEach((s) => {
|
|
96
|
+
const l = k(s.url, t.assetsRoot);
|
|
96
97
|
switch (s.type.toLowerCase()) {
|
|
97
98
|
case "webTile".toLowerCase(): {
|
|
98
|
-
const
|
|
99
|
-
urlTemplate:
|
|
99
|
+
const c = new L({
|
|
100
|
+
urlTemplate: l,
|
|
100
101
|
...s.options
|
|
101
102
|
});
|
|
102
|
-
|
|
103
|
+
n.add(c);
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
case "tile": {
|
|
106
|
-
const
|
|
107
|
-
url:
|
|
107
|
+
const c = new x({
|
|
108
|
+
url: l,
|
|
108
109
|
...s.options
|
|
109
110
|
});
|
|
110
|
-
|
|
111
|
+
n.add(c);
|
|
111
112
|
break;
|
|
112
113
|
}
|
|
113
114
|
case "arcgis": {
|
|
114
|
-
const
|
|
115
|
-
|
|
115
|
+
const c = new b(s.options);
|
|
116
|
+
n.basemap = c;
|
|
116
117
|
break;
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
}) :
|
|
120
|
+
}) : n.basemap = new b({
|
|
120
121
|
style: {
|
|
121
122
|
id: "arcgis/dark-gray",
|
|
122
123
|
language: "zh-CN"
|
|
123
124
|
}
|
|
124
|
-
}),
|
|
125
|
-
const s =
|
|
126
|
-
(
|
|
125
|
+
}), t != null && t.hdLayers) {
|
|
126
|
+
const s = t.hdLayers.map(
|
|
127
|
+
(l) => (
|
|
127
128
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
128
|
-
new
|
|
129
|
-
url:
|
|
130
|
-
...
|
|
131
|
-
title:
|
|
129
|
+
new W({
|
|
130
|
+
url: k(l.url, t.assetsRoot),
|
|
131
|
+
...l.options,
|
|
132
|
+
title: l.options.id
|
|
132
133
|
})
|
|
133
134
|
)
|
|
134
135
|
);
|
|
135
|
-
|
|
136
|
+
n.addMany(s);
|
|
136
137
|
}
|
|
137
138
|
this.view.ui.remove("attribution"), this.view.ui.add("compass", "top-left"), await this.view.when();
|
|
138
139
|
const p = this.mapConfig.camera;
|
|
139
|
-
let
|
|
140
|
+
let g;
|
|
140
141
|
if (this.view.type === "2d") {
|
|
141
142
|
let s = this.view.center;
|
|
142
143
|
this.view.spatialReference.isWebMercator && (s = f.webMercatorToGeographic(
|
|
143
144
|
s
|
|
144
|
-
)),
|
|
145
|
+
)), g = { center: [s.x, s.y], zoom: this.view.zoom };
|
|
145
146
|
} else {
|
|
146
147
|
let s = this.view.camera.position;
|
|
147
148
|
this.view.spatialReference.isWebMercator && (s = f.webMercatorToGeographic(
|
|
148
149
|
s
|
|
149
|
-
)),
|
|
150
|
+
)), g = {
|
|
150
151
|
position: s,
|
|
151
152
|
heading: this.view.camera.heading,
|
|
152
153
|
tilt: this.view.camera.tilt
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
|
-
return p ? p.home =
|
|
156
|
+
return p ? p.home = g : this.mapConfig.camera = { home: g }, this.view;
|
|
156
157
|
}
|
|
157
|
-
setLayerVisibility(
|
|
158
|
-
const { id: i, visible:
|
|
159
|
-
return a ? (a.visible =
|
|
158
|
+
setLayerVisibility(e) {
|
|
159
|
+
const { id: i, visible: t } = e, a = this.view.map.findLayerById(i);
|
|
160
|
+
return a ? (a.visible = t, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
|
|
160
161
|
}
|
|
161
162
|
/**
|
|
162
163
|
* 设置地图中心点
|
|
163
164
|
* @param params
|
|
164
165
|
* @returns
|
|
165
166
|
*/
|
|
166
|
-
async setMapCenter(
|
|
167
|
+
async setMapCenter(e) {
|
|
167
168
|
var i;
|
|
168
169
|
if (!this.view)
|
|
169
170
|
return { status: -1, message: "未初始化" };
|
|
170
|
-
if (
|
|
171
|
-
switch ((i =
|
|
171
|
+
if (e.center || e.target) {
|
|
172
|
+
switch ((i = e.target) == null ? void 0 : i.type) {
|
|
172
173
|
case "point":
|
|
173
|
-
|
|
174
|
+
e.target = new P(e.target);
|
|
174
175
|
break;
|
|
175
176
|
case "polyline":
|
|
176
|
-
|
|
177
|
+
e.target = new z(e.target);
|
|
177
178
|
break;
|
|
178
179
|
case "polygon":
|
|
179
|
-
|
|
180
|
+
e.target = new T(e.target);
|
|
180
181
|
break;
|
|
181
182
|
}
|
|
182
|
-
await this.view.goTo(
|
|
183
|
+
await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
|
|
183
184
|
}
|
|
184
185
|
return { status: 0, message: "成功" };
|
|
185
186
|
}
|
|
186
187
|
/**
|
|
187
188
|
* 在一定的高度,以一定的角度去观察某个坐标
|
|
188
189
|
* */
|
|
189
|
-
async lookAt(
|
|
190
|
+
async lookAt(e) {
|
|
190
191
|
if (this.view.type === "2d")
|
|
191
192
|
return;
|
|
192
|
-
const i =
|
|
193
|
+
const i = e.tilt || 0, t = e.heading || 0;
|
|
193
194
|
if (i === 0)
|
|
194
195
|
await this.view.goTo(
|
|
195
196
|
{
|
|
196
197
|
position: {
|
|
197
|
-
x:
|
|
198
|
-
y:
|
|
199
|
-
z:
|
|
198
|
+
x: e.center[0],
|
|
199
|
+
y: e.center[1],
|
|
200
|
+
z: e.height
|
|
200
201
|
},
|
|
201
|
-
heading:
|
|
202
|
+
heading: t,
|
|
202
203
|
tilt: 0
|
|
203
204
|
},
|
|
204
|
-
{ duration: (
|
|
205
|
+
{ duration: (e.duration || 2) * 1e3 }
|
|
205
206
|
);
|
|
206
207
|
else {
|
|
207
|
-
const a = Math.tan(i * Math.PI / 180) *
|
|
208
|
-
O.point(
|
|
208
|
+
const a = Math.tan(i * Math.PI / 180) * e.height, r = I(
|
|
209
|
+
O.point(e.center),
|
|
209
210
|
a,
|
|
210
|
-
|
|
211
|
+
t + 180,
|
|
211
212
|
{
|
|
212
213
|
units: "meters"
|
|
213
214
|
}
|
|
@@ -217,63 +218,63 @@ class Q {
|
|
|
217
218
|
position: {
|
|
218
219
|
x: r.geometry.coordinates[0],
|
|
219
220
|
y: r.geometry.coordinates[1],
|
|
220
|
-
z:
|
|
221
|
+
z: e.height
|
|
221
222
|
},
|
|
222
|
-
heading:
|
|
223
|
+
heading: t,
|
|
223
224
|
tilt: i
|
|
224
225
|
},
|
|
225
|
-
{ duration: (
|
|
226
|
+
{ duration: (e.duration || 2) * 1e3 }
|
|
226
227
|
);
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
async setMapCamera(
|
|
230
|
+
async setMapCamera(e) {
|
|
230
231
|
if (!this.view)
|
|
231
232
|
return { status: -1, message: "未初始化" };
|
|
232
|
-
const { name: i, duration:
|
|
233
|
+
const { name: i, duration: t = 0 } = e, { camera: a } = this.mapConfig;
|
|
233
234
|
if (!a)
|
|
234
235
|
return { status: -1, message: "未配置camera" };
|
|
235
236
|
const r = a[i];
|
|
236
|
-
return r ? (await this.view.goTo(r, { duration:
|
|
237
|
+
return r ? (await this.view.goTo(r, { duration: t * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
|
|
237
238
|
}
|
|
238
239
|
/**
|
|
239
240
|
* 经纬度转像素坐标,在地图移动时回调
|
|
240
241
|
* */
|
|
241
|
-
requestCoordinateTransform(
|
|
242
|
-
let
|
|
243
|
-
const r = 1e3 / 30, d =
|
|
242
|
+
requestCoordinateTransform(e, i) {
|
|
243
|
+
let t = 0;
|
|
244
|
+
const r = 1e3 / 30, d = M.watch(
|
|
244
245
|
() => this.view.center,
|
|
245
246
|
() => {
|
|
246
|
-
const
|
|
247
|
-
p -
|
|
247
|
+
const n = this.transformPoints(e), p = Date.now();
|
|
248
|
+
p - t > r && (i(n), t = p);
|
|
248
249
|
}
|
|
249
250
|
);
|
|
250
|
-
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, d), { handle: this.handleIndex, points: this.transformPoints(
|
|
251
|
+
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, d), { handle: this.handleIndex, points: this.transformPoints(e) };
|
|
251
252
|
}
|
|
252
|
-
transformPoints(
|
|
253
|
-
return
|
|
254
|
-
const
|
|
253
|
+
transformPoints(e) {
|
|
254
|
+
return e.map((i) => {
|
|
255
|
+
const t = new P({
|
|
255
256
|
x: i[0],
|
|
256
257
|
y: i[1]
|
|
257
|
-
}), a = this.view.toScreen(
|
|
258
|
+
}), a = this.view.toScreen(t);
|
|
258
259
|
return [a.x, a.y];
|
|
259
260
|
});
|
|
260
261
|
}
|
|
261
262
|
/**
|
|
262
263
|
* 停止坐标转换回调
|
|
263
264
|
* */
|
|
264
|
-
cancelCoordinateTransform(
|
|
265
|
-
const i = this.watchHandleMap.get(
|
|
266
|
-
i && (i.remove(), this.watchHandleMap.delete(
|
|
265
|
+
cancelCoordinateTransform(e) {
|
|
266
|
+
const i = this.watchHandleMap.get(e);
|
|
267
|
+
i && (i.remove(), this.watchHandleMap.delete(e));
|
|
267
268
|
}
|
|
268
269
|
/**
|
|
269
270
|
* 设置地图zoom范围
|
|
270
271
|
* */
|
|
271
|
-
setMapZoomRange(
|
|
272
|
-
const { min: i, max:
|
|
273
|
-
!i && !
|
|
272
|
+
setMapZoomRange(e) {
|
|
273
|
+
const { min: i, max: t } = e;
|
|
274
|
+
!i && !t || (this.zoomWatchHandle && this.zoomWatchHandle.remove(), this.zoomWatchHandle = M.watch(
|
|
274
275
|
() => this.view.zoom,
|
|
275
276
|
(a) => {
|
|
276
|
-
i && a <= i && (this.view.zoom = i),
|
|
277
|
+
i && a <= i && (this.view.zoom = i), t && a >= t && (this.view.zoom = t);
|
|
277
278
|
}
|
|
278
279
|
));
|
|
279
280
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import View from '@arcgis/core/views/View';
|
|
2
1
|
import { IFindSumoParams, IResult, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams } from '../../../types';
|
|
3
2
|
export default class OpenDriveRenderer {
|
|
4
3
|
private static instance;
|
|
5
|
-
static getInstance(view:
|
|
4
|
+
static getInstance(view: __esri.MapView | __esri.SceneView): OpenDriveRenderer;
|
|
6
5
|
private readonly view;
|
|
7
6
|
private laneLayer;
|
|
8
7
|
private roadNameLayer;
|
|
@@ -10,8 +9,12 @@ export default class OpenDriveRenderer {
|
|
|
10
9
|
private highlightLayer;
|
|
11
10
|
private allLaneGraphics;
|
|
12
11
|
private allRefLineGraphics;
|
|
12
|
+
private mouseMoveHandler;
|
|
13
|
+
private mouseClickHandler;
|
|
13
14
|
private wasmLoader;
|
|
14
|
-
constructor(view:
|
|
15
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
16
|
+
private projectName;
|
|
17
|
+
private openDriveServer;
|
|
15
18
|
showOpenDriveFromFile(params: IShowOpenDriveFromFileParams): Promise<IResult>;
|
|
16
19
|
/**
|
|
17
20
|
* 从服务器载入OpenDrive文件解析结果并显示
|
|
@@ -21,6 +24,23 @@ export default class OpenDriveRenderer {
|
|
|
21
24
|
showOpenDriveFromServer(server: string, projectName: string): Promise<IResult>;
|
|
22
25
|
private showAllLanes;
|
|
23
26
|
private showJunction;
|
|
27
|
+
private currentSectionCode;
|
|
28
|
+
private currentJunctionId;
|
|
29
|
+
private hitGraphic;
|
|
30
|
+
private highlightGraphic;
|
|
31
|
+
/**
|
|
32
|
+
* 监听鼠标移动事件,高亮显示鼠标所在路段和路口
|
|
33
|
+
*/
|
|
34
|
+
private monitorMouseMove;
|
|
35
|
+
/**
|
|
36
|
+
* 监听鼠标点击事件,获取高亮要素的拓扑信息
|
|
37
|
+
*/
|
|
38
|
+
private monitorMouseClick;
|
|
39
|
+
private increasePictureMarkerSize;
|
|
40
|
+
private decreasePictureMarkerSize;
|
|
41
|
+
/**
|
|
42
|
+
* 清除OpenDrive内容
|
|
43
|
+
*/
|
|
24
44
|
clearOpenDrive(): Promise<void>;
|
|
25
45
|
/**
|
|
26
46
|
* 用sumo的id定位车道、基本段、路段
|