@vcmap/viewshed 2.0.7 → 2.0.9
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/CHANGELOG.md +12 -0
- package/dist/index.js +409 -384
- package/package.json +3 -3
- package/src/util/windowHelper.js +1 -1
- package/src/viewshedCategory.js +43 -6
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { VcsCameraPrimitive as
|
|
5
|
-
import { Color as
|
|
6
|
-
import { shallowRef as
|
|
7
|
-
import { ol$Observable$unByKey as
|
|
8
|
-
import { VcsTextField as
|
|
9
|
-
import { VContainer as
|
|
10
|
-
const
|
|
1
|
+
var we = Object.defineProperty;
|
|
2
|
+
var me = (s, e, i) => e in s ? we(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
|
|
3
|
+
var ee = (s, e, i) => (me(s, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
+
import { VcsCameraPrimitive as ge, VcsObject as _e, VcsEvent as F, AbstractInteraction as Ce, EventType as L, Projection as A, SessionType as Ee, CesiumMap as N, startEditFeaturesSession as ye, startEditGeometrySession as Ve, VectorLayer as be, wgs84Projection as Me, maxZIndex as Te, markVolatile as Oe, Viewpoint as Se, TransformationMode as Pe, Category as Ie, moduleIdSymbol as Re } from "../../../assets/core.js";
|
|
5
|
+
import { Color as B, Matrix4 as Ae, Transforms as $e, Primitive as te, GeometryInstance as ie, SphereGeometry as Ne, ColorGeometryInstanceAttribute as se, PerInstanceColorAppearance as oe, SphereOutlineGeometry as xe, Math as O, Cartesian3 as I, ShadowMap as De, Camera as Le, HeightReference as Fe } from "../../../assets/cesium.js";
|
|
6
|
+
import { shallowRef as X, ref as R, nextTick as ke, inject as ne, computed as re, reactive as z, watchEffect as je, watch as $, onMounted as We, onUnmounted as Be } from "../../../assets/vue.js";
|
|
7
|
+
import { ol$Observable$unByKey as ze, Feature as Ge, ol$geom$Point as He, ol$style$Style as Ue } from "../../../assets/ol.js";
|
|
8
|
+
import { VcsTextField as Ke, VcsSlider as Xe, VcsLabel as le, VcsFormSection as ce, VcsSelect as de, VcsFormButton as Ye, VcsFeatureTransforms as Je, makeEditorCollectionComponentClass as Ze, WindowSlot as qe, ToolboxType as Qe, createSupportedMapMappingFunction as et, createListExportAction as tt, downloadText as it, createListImportAction as st, NotificationType as j, AbstractConfigEditor as ot } from "../../../assets/ui.js";
|
|
9
|
+
import { VContainer as he, VRow as ue, VCol as fe, VDivider as nt, VColorPicker as rt } from "../../../assets/vuetify.js";
|
|
10
|
+
const D = [
|
|
11
11
|
[String, "string"],
|
|
12
12
|
[Number, "number"],
|
|
13
13
|
[Boolean, "boolean"],
|
|
@@ -15,7 +15,7 @@ const N = [
|
|
|
15
15
|
[void 0, "undefined"],
|
|
16
16
|
[Symbol, "symbol"]
|
|
17
17
|
];
|
|
18
|
-
function
|
|
18
|
+
function G(s) {
|
|
19
19
|
const e = {};
|
|
20
20
|
if (!s || e.toString(s) !== "[object Object]")
|
|
21
21
|
return !1;
|
|
@@ -25,7 +25,7 @@ function B(s) {
|
|
|
25
25
|
const t = e.hasOwnProperty, o = t.call(i, "constructor") && i.constructor;
|
|
26
26
|
return typeof o == "function" && t.toString.call(o) === t.toString.call(Object);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function M(s, e) {
|
|
29
29
|
if (s === null)
|
|
30
30
|
return "null";
|
|
31
31
|
if (typeof s > "u")
|
|
@@ -34,7 +34,7 @@ function b(s, e) {
|
|
|
34
34
|
return typeof s;
|
|
35
35
|
let i;
|
|
36
36
|
if (Array.isArray(s))
|
|
37
|
-
i = `[${s.map((o) =>
|
|
37
|
+
i = `[${s.map((o) => M(o, e)).join(",")}]`;
|
|
38
38
|
else
|
|
39
39
|
try {
|
|
40
40
|
i = JSON.stringify(s);
|
|
@@ -43,10 +43,10 @@ function b(s, e) {
|
|
|
43
43
|
}
|
|
44
44
|
return i = i || typeof s, i.length > 20 ? `${i.substr(0, 20)}...` : i;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? s === e ? !1 : `Expected ${
|
|
46
|
+
function at(s, e) {
|
|
47
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? s === e ? !1 : `Expected ${M(s)} to equal ${e.toString()}` : null;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function lt(s, e, i) {
|
|
50
50
|
if (Array.isArray(e)) {
|
|
51
51
|
if (e.length !== 1)
|
|
52
52
|
throw new Error("Array patterns may only have on type");
|
|
@@ -54,48 +54,48 @@ function at(s, e, i) {
|
|
|
54
54
|
let t = !1;
|
|
55
55
|
return s.findIndex((n) => {
|
|
56
56
|
try {
|
|
57
|
-
|
|
58
|
-
} catch (
|
|
59
|
-
t =
|
|
57
|
+
H(n, e[0], i);
|
|
58
|
+
} catch (l) {
|
|
59
|
+
t = l.message.replace(/Match failed:\s/, "");
|
|
60
60
|
}
|
|
61
61
|
return t;
|
|
62
|
-
}) > -1 ? `${t} in ${
|
|
62
|
+
}) > -1 ? `${t} in ${M(s)}` : !1;
|
|
63
63
|
}
|
|
64
|
-
return `Expected ${
|
|
64
|
+
return `Expected ${M(s)} to be an Array`;
|
|
65
65
|
}
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Y(s, e, i) {
|
|
69
69
|
const t = i ? `${i}.` : "";
|
|
70
|
-
if (!
|
|
71
|
-
return `Expected ${
|
|
70
|
+
if (!G(s))
|
|
71
|
+
return `Expected ${M(s)} to be a plain Object`;
|
|
72
72
|
let n = !1;
|
|
73
|
-
const
|
|
73
|
+
const l = Object.keys(e).find((c) => {
|
|
74
74
|
const r = s[c];
|
|
75
|
-
if (
|
|
76
|
-
n =
|
|
75
|
+
if (G(e[c]))
|
|
76
|
+
n = Y(r, e[c], t + c);
|
|
77
77
|
else
|
|
78
78
|
try {
|
|
79
|
-
|
|
79
|
+
H(r, e[c]);
|
|
80
80
|
} catch (f) {
|
|
81
81
|
n = f.message.replace(/Match failed:\s/, "");
|
|
82
82
|
}
|
|
83
83
|
return n;
|
|
84
84
|
});
|
|
85
|
-
return
|
|
85
|
+
return l ? `${n} in object.${t}${l}` : !1;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function ct(s, e) {
|
|
88
88
|
if (e === Number)
|
|
89
|
-
return Number.isFinite(s) ? !1 : `expected ${
|
|
90
|
-
for (let i =
|
|
91
|
-
if (e ===
|
|
92
|
-
return typeof s ===
|
|
89
|
+
return Number.isFinite(s) ? !1 : `expected ${M(s)} to be a number, excluding NaN`;
|
|
90
|
+
for (let i = D.length; i--; )
|
|
91
|
+
if (e === D[i][0])
|
|
92
|
+
return typeof s === D[i][1] ? !1 : `expected ${M(s)} to be a ${D[i][1]}`;
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function J(s) {
|
|
96
96
|
if (s === null)
|
|
97
97
|
return "null";
|
|
98
|
-
const e =
|
|
98
|
+
const e = D.find((o) => o[0] === s);
|
|
99
99
|
if (e)
|
|
100
100
|
return e[1];
|
|
101
101
|
let i = s.toString();
|
|
@@ -104,10 +104,10 @@ function Y(s) {
|
|
|
104
104
|
const t = i.match(/function (.*)\(/);
|
|
105
105
|
if (t && t.length > 1)
|
|
106
106
|
return t[1];
|
|
107
|
-
if (
|
|
107
|
+
if (G(s)) {
|
|
108
108
|
const o = {};
|
|
109
109
|
Object.keys(s).forEach((n) => {
|
|
110
|
-
o[n] =
|
|
110
|
+
o[n] = J(s[n]);
|
|
111
111
|
});
|
|
112
112
|
try {
|
|
113
113
|
i = `Object of ${JSON.stringify(o)}`;
|
|
@@ -117,49 +117,49 @@ function Y(s) {
|
|
|
117
117
|
}
|
|
118
118
|
return i;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function ve(s, e, i) {
|
|
121
121
|
const t = i ? `${i}.` : "";
|
|
122
122
|
let o = !1;
|
|
123
|
-
return Object.keys(s).find((
|
|
124
|
-
if (
|
|
125
|
-
const c = s[
|
|
126
|
-
o =
|
|
123
|
+
return Object.keys(s).find((l) => {
|
|
124
|
+
if (G(e[l])) {
|
|
125
|
+
const c = s[l];
|
|
126
|
+
o = ve(c, e[l], t + l);
|
|
127
127
|
} else
|
|
128
|
-
e[
|
|
128
|
+
e[l] || (o = `Found additional key ${t}${l}`);
|
|
129
129
|
return o = o ? o.replace(/\sin.*/, "") : !1, o;
|
|
130
|
-
}) ? `${o} in ${
|
|
130
|
+
}) ? `${o} in ${M(s)}` : !1;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
const t = function(
|
|
132
|
+
function dt(s, e, i) {
|
|
133
|
+
const t = function(l, c) {
|
|
134
134
|
if (c == null)
|
|
135
|
-
return
|
|
136
|
-
const r =
|
|
135
|
+
return l === c ? !1 : `Expected ${M(l)} to be ${c}`;
|
|
136
|
+
const r = ct(l, c);
|
|
137
137
|
if (r !== null)
|
|
138
138
|
return r;
|
|
139
|
-
const f =
|
|
139
|
+
const f = at(l, c);
|
|
140
140
|
if (f !== null)
|
|
141
141
|
return f;
|
|
142
142
|
if (Array.isArray(c))
|
|
143
|
-
return
|
|
143
|
+
return lt(l, c, i);
|
|
144
144
|
if (c instanceof Function)
|
|
145
|
-
return
|
|
145
|
+
return l instanceof c ? !1 : `Expected ${M(l, !0)} to be of Type ${J(c)}`;
|
|
146
146
|
if (c === Object)
|
|
147
|
-
return
|
|
147
|
+
return Y(l, {});
|
|
148
148
|
if (typeof c != "object")
|
|
149
149
|
throw new Error(`Cannot handler pattern ${c}`);
|
|
150
|
-
const h =
|
|
151
|
-
return h || (i ?
|
|
150
|
+
const h = Y(l, c);
|
|
151
|
+
return h || (i ? ve(l, c) : !1);
|
|
152
152
|
};
|
|
153
153
|
let o;
|
|
154
|
-
return Array.isArray(e) && e.length > 1 ? e.every((
|
|
154
|
+
return Array.isArray(e) && e.length > 1 ? e.every((l) => t(s, l)) && (o = `Expected ${M(s)} to be a ${e.map((l) => J(l)).join(" or ")}`) : o = t(s, e), o;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const t =
|
|
156
|
+
function H(s, e, i) {
|
|
157
|
+
const t = dt(s, e, i);
|
|
158
158
|
if (t)
|
|
159
159
|
throw new Error(`Match failed: ${t}`);
|
|
160
160
|
return !1;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function ht(s, e, i) {
|
|
163
163
|
if (s != null) {
|
|
164
164
|
const t = Object.values(e).find((o) => o == s);
|
|
165
165
|
if (t != null)
|
|
@@ -167,8 +167,8 @@ function dt(s, e, i) {
|
|
|
167
167
|
}
|
|
168
168
|
return i;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
class
|
|
170
|
+
const ut = new B(), U = new Ae();
|
|
171
|
+
class ft extends ge {
|
|
172
172
|
constructor(e) {
|
|
173
173
|
super(e), this.spot = e.spot;
|
|
174
174
|
}
|
|
@@ -182,40 +182,40 @@ class ut extends me {
|
|
|
182
182
|
super.update(e);
|
|
183
183
|
else {
|
|
184
184
|
const i = this._planesPrimitives, t = this._outlinePrimitives;
|
|
185
|
-
i.length === 0 && (
|
|
185
|
+
i.length === 0 && ($e.eastNorthUpToFixedFrame(
|
|
186
186
|
this._camera.positionWC,
|
|
187
187
|
void 0,
|
|
188
|
-
|
|
189
|
-
), i[0] = new
|
|
188
|
+
U
|
|
189
|
+
), i[0] = new te({
|
|
190
190
|
allowPicking: this.allowPicking,
|
|
191
|
-
geometryInstances: new
|
|
192
|
-
geometry: new
|
|
191
|
+
geometryInstances: new ie({
|
|
192
|
+
geometry: new Ne({
|
|
193
193
|
radius: 2
|
|
194
194
|
}),
|
|
195
195
|
attributes: {
|
|
196
|
-
color:
|
|
197
|
-
|
|
196
|
+
color: se.fromColor(
|
|
197
|
+
B.fromAlpha(this._color, 0.1, ut)
|
|
198
198
|
)
|
|
199
199
|
},
|
|
200
|
-
modelMatrix:
|
|
200
|
+
modelMatrix: U
|
|
201
201
|
}),
|
|
202
|
-
appearance: new
|
|
202
|
+
appearance: new oe({
|
|
203
203
|
translucent: !0,
|
|
204
204
|
flat: !0
|
|
205
205
|
}),
|
|
206
206
|
asynchronous: !1
|
|
207
|
-
}), t[0] = new
|
|
207
|
+
}), t[0] = new te({
|
|
208
208
|
allowPicking: this.allowPicking,
|
|
209
|
-
geometryInstances: new
|
|
210
|
-
geometry: new
|
|
209
|
+
geometryInstances: new ie({
|
|
210
|
+
geometry: new xe({
|
|
211
211
|
radius: 2
|
|
212
212
|
}),
|
|
213
213
|
attributes: {
|
|
214
|
-
color:
|
|
214
|
+
color: se.fromColor(this._color)
|
|
215
215
|
},
|
|
216
|
-
modelMatrix:
|
|
216
|
+
modelMatrix: U
|
|
217
217
|
}),
|
|
218
|
-
appearance: new
|
|
218
|
+
appearance: new oe({
|
|
219
219
|
translucent: !1,
|
|
220
220
|
flat: !0
|
|
221
221
|
}),
|
|
@@ -231,14 +231,14 @@ const w = {
|
|
|
231
231
|
CONE: "cone",
|
|
232
232
|
THREESIXTY: "360"
|
|
233
233
|
};
|
|
234
|
-
function
|
|
235
|
-
const i = new
|
|
234
|
+
function vt(s, e) {
|
|
235
|
+
const i = new Le(s), t = (
|
|
236
236
|
/** @type {import("@vcmap-cesium/engine").PerspectiveFrustum} */
|
|
237
237
|
i.frustum
|
|
238
238
|
);
|
|
239
239
|
return t.fov = e.fov, t.near = e.near, t.aspectRatio = e.aspectRatio, t.far = e.far, i;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const y = class y extends _e {
|
|
242
242
|
static get className() {
|
|
243
243
|
return "Viewshed";
|
|
244
244
|
}
|
|
@@ -249,7 +249,7 @@ const E = class E extends ge {
|
|
|
249
249
|
static getDefaultOptions() {
|
|
250
250
|
return {
|
|
251
251
|
frustum: {
|
|
252
|
-
fov:
|
|
252
|
+
fov: O.PI / 3,
|
|
253
253
|
near: 1,
|
|
254
254
|
aspectRatio: 1,
|
|
255
255
|
far: 300
|
|
@@ -268,29 +268,29 @@ const E = class E extends ge {
|
|
|
268
268
|
* @param {ViewshedOptions} options The options for the viewshed.
|
|
269
269
|
*/
|
|
270
270
|
constructor(e) {
|
|
271
|
-
var i, t, o, n,
|
|
271
|
+
var i, t, o, n, l, c;
|
|
272
272
|
super(e), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
|
|
273
|
-
fov: ((i = e.frustumOptions) == null ? void 0 : i.fov) ||
|
|
274
|
-
far: ((t = e.frustumOptions) == null ? void 0 : t.far) ||
|
|
275
|
-
near: ((o = e.frustumOptions) == null ? void 0 : o.near) ||
|
|
276
|
-
aspectRatio: ((n = e.frustumOptions) == null ? void 0 : n.aspectRatio) ||
|
|
273
|
+
fov: ((i = e.frustumOptions) == null ? void 0 : i.fov) || y.getDefaultOptions().frustum.fov,
|
|
274
|
+
far: ((t = e.frustumOptions) == null ? void 0 : t.far) || y.getDefaultOptions().frustum.far,
|
|
275
|
+
near: ((o = e.frustumOptions) == null ? void 0 : o.near) || y.getDefaultOptions().frustum.near,
|
|
276
|
+
aspectRatio: ((n = e.frustumOptions) == null ? void 0 : n.aspectRatio) || y.getDefaultOptions().frustum.aspectRatio
|
|
277
277
|
}, this._headingPitchRollValues = e.orientation || {
|
|
278
|
-
...
|
|
279
|
-
}, this._position = e.position ||
|
|
280
|
-
visibleColor:
|
|
281
|
-
((
|
|
278
|
+
...y.getDefaultOptions().orientation
|
|
279
|
+
}, this._position = e.position || y.getDefaultOptions().position, this._viewshedType = ht(e.viewshedType, w), this._colors = {
|
|
280
|
+
visibleColor: B.fromCssColorString(
|
|
281
|
+
((l = e.colorOptions) == null ? void 0 : l.visibleColor) || y.getDefaultOptions().visibleColor
|
|
282
282
|
),
|
|
283
|
-
shadowColor:
|
|
284
|
-
((c = e.colorOptions) == null ? void 0 : c.shadowColor) ||
|
|
283
|
+
shadowColor: B.fromCssColorString(
|
|
284
|
+
((c = e.colorOptions) == null ? void 0 : c.shadowColor) || y.getDefaultOptions().shadowColor
|
|
285
285
|
)
|
|
286
|
-
}, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this._positionChanged = new
|
|
286
|
+
}, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this._positionChanged = new F(), this._active = !1;
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
289
289
|
* Sets a new position for the shadow map. If no shadow map was created yet, due to missing position, this method triggers the creation of a shadow map.
|
|
290
290
|
* @param {import("ol/coordinate").Coordinate} coords The new positions coordinates in degrees
|
|
291
291
|
*/
|
|
292
292
|
set position(e) {
|
|
293
|
-
|
|
293
|
+
H(e, [Number]), this._position = e, this._shadowCamera && (this._shadowCamera.position = I.fromDegrees(
|
|
294
294
|
e[0],
|
|
295
295
|
e[1],
|
|
296
296
|
e[2] + this._heightOffset
|
|
@@ -314,7 +314,7 @@ const E = class E extends ge {
|
|
|
314
314
|
* @param {number} value the offset that is added to the position height.
|
|
315
315
|
*/
|
|
316
316
|
set heightOffset(e) {
|
|
317
|
-
this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position =
|
|
317
|
+
this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position = I.fromDegrees(
|
|
318
318
|
this.position[0],
|
|
319
319
|
this.position[1],
|
|
320
320
|
this.position[2] + e
|
|
@@ -332,7 +332,7 @@ const E = class E extends ge {
|
|
|
332
332
|
* @param {number} value The distance in meters.
|
|
333
333
|
*/
|
|
334
334
|
set distance(e) {
|
|
335
|
-
this._frustumOptions.far = e >
|
|
335
|
+
this._frustumOptions.far = e > y.MIN_DISTANCE ? e : y.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === w.THREESIXTY && this._updateShadowMap(), this._viewshedType === w.CONE && this._updatePrimitive());
|
|
336
336
|
}
|
|
337
337
|
/**
|
|
338
338
|
* Returns the reach of the viewshed.
|
|
@@ -346,23 +346,23 @@ const E = class E extends ge {
|
|
|
346
346
|
* @param {number} value The field of view in degrees.
|
|
347
347
|
*/
|
|
348
348
|
set fov(e) {
|
|
349
|
-
this._frustumOptions.fov = e *
|
|
349
|
+
this._frustumOptions.fov = e * O.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = e * O.RADIANS_PER_DEGREE, this._viewshedType === w.CONE && this._updatePrimitive());
|
|
350
350
|
}
|
|
351
351
|
/**
|
|
352
352
|
* Returns the field of view.
|
|
353
353
|
* @returns {number} The field of view in degrees.
|
|
354
354
|
*/
|
|
355
355
|
get fov() {
|
|
356
|
-
return this._frustumOptions.fov *
|
|
356
|
+
return this._frustumOptions.fov * O.DEGREES_PER_RADIAN;
|
|
357
357
|
}
|
|
358
358
|
/**
|
|
359
359
|
* Sets the heading of a cone viewshed. Does not have impact on 360 viewshed.
|
|
360
360
|
* @param {number} value Heading in degrees.
|
|
361
361
|
*/
|
|
362
362
|
set heading(e) {
|
|
363
|
-
this._headingPitchRollValues.heading = e *
|
|
363
|
+
this._headingPitchRollValues.heading = e * O.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
|
|
364
364
|
orientation: {
|
|
365
|
-
heading: e *
|
|
365
|
+
heading: e * O.RADIANS_PER_DEGREE,
|
|
366
366
|
pitch: this._shadowCamera.pitch,
|
|
367
367
|
roll: 0
|
|
368
368
|
}
|
|
@@ -373,15 +373,15 @@ const E = class E extends ge {
|
|
|
373
373
|
* @returns {number} The heading in degress.
|
|
374
374
|
*/
|
|
375
375
|
get heading() {
|
|
376
|
-
return this._headingPitchRollValues.heading *
|
|
376
|
+
return this._headingPitchRollValues.heading * O.DEGREES_PER_RADIAN;
|
|
377
377
|
}
|
|
378
378
|
/**
|
|
379
379
|
* Sets the pitch of a cone viewshed. 0 is horizontal. Does not have impact on 360 viewshed.
|
|
380
380
|
* @param {number} value The pitch in degrees.
|
|
381
381
|
*/
|
|
382
382
|
set pitch(e) {
|
|
383
|
-
if (this._headingPitchRollValues.pitch = e *
|
|
384
|
-
const i = e *
|
|
383
|
+
if (this._headingPitchRollValues.pitch = e * O.RADIANS_PER_DEGREE, this._shadowCamera) {
|
|
384
|
+
const i = e * O.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
|
|
385
385
|
this._shadowCamera.lookUp(i), this._viewshedType === w.CONE && this._updatePrimitive();
|
|
386
386
|
}
|
|
387
387
|
}
|
|
@@ -390,7 +390,7 @@ const E = class E extends ge {
|
|
|
390
390
|
* @returns {number} The pitch in degrees.
|
|
391
391
|
*/
|
|
392
392
|
get pitch() {
|
|
393
|
-
return this._headingPitchRollValues.pitch *
|
|
393
|
+
return this._headingPitchRollValues.pitch * O.DEGREES_PER_RADIAN;
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
396
|
* Sets whether the primitive of the viewshed should be shown or not.
|
|
@@ -435,7 +435,7 @@ const E = class E extends ge {
|
|
|
435
435
|
this._cesiumMap = e;
|
|
436
436
|
const i = e.getScene();
|
|
437
437
|
if (i)
|
|
438
|
-
this._shadowCamera =
|
|
438
|
+
this._shadowCamera = vt(i, this._frustumOptions), this._position && (this.position = this._position), this._scene = i;
|
|
439
439
|
else
|
|
440
440
|
throw new Error("CesiumMap contains no scene");
|
|
441
441
|
this._updateShadowMap(), this._updatePrimitive();
|
|
@@ -446,7 +446,7 @@ const E = class E extends ge {
|
|
|
446
446
|
*/
|
|
447
447
|
_updateShadowMap() {
|
|
448
448
|
var e;
|
|
449
|
-
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((e = this._shadowMap) == null || e.destroy(), this._shadowMap = new
|
|
449
|
+
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((e = this._shadowMap) == null || e.destroy(), this._shadowMap = new De({
|
|
450
450
|
// @ts-ignore
|
|
451
451
|
context: this._scene.context,
|
|
452
452
|
lightCamera: this._shadowCamera,
|
|
@@ -465,7 +465,7 @@ const E = class E extends ge {
|
|
|
465
465
|
this._primitive && !((i = (e = this._primitive).isDestroyed) != null && i.call(e)) && ((t = this._scene) == null || t.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
|
|
466
466
|
}
|
|
467
467
|
_updatePrimitive() {
|
|
468
|
-
this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new
|
|
468
|
+
this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new ft({
|
|
469
469
|
camera: this._shadowCamera,
|
|
470
470
|
allowPicking: !1,
|
|
471
471
|
spot: this._viewshedType === w.CONE
|
|
@@ -478,10 +478,10 @@ const E = class E extends ge {
|
|
|
478
478
|
lookAt(e) {
|
|
479
479
|
if (!this._shadowCamera)
|
|
480
480
|
return;
|
|
481
|
-
const i =
|
|
482
|
-
if (this.distance =
|
|
483
|
-
const t = new
|
|
484
|
-
|
|
481
|
+
const i = I.fromDegrees(e[0], e[1], e[2]);
|
|
482
|
+
if (this.distance = I.distance(this._shadowCamera.position, i), this.type === w.CONE && !i.equals(this._shadowCamera.position)) {
|
|
483
|
+
const t = new I();
|
|
484
|
+
I.subtract(i, this._shadowCamera.position, i), I.normalize(i, i), I.normalize(this._shadowCamera.position, t), this._shadowCamera.setView({
|
|
485
485
|
orientation: {
|
|
486
486
|
direction: i,
|
|
487
487
|
up: t
|
|
@@ -518,15 +518,15 @@ const E = class E extends ge {
|
|
|
518
518
|
this.deactivate(), ((t = e == null ? void 0 : e.getScene()) == null ? void 0 : t.shadowMap) === i && e.setDefaultShadowMap();
|
|
519
519
|
}
|
|
520
520
|
};
|
|
521
|
-
|
|
522
|
-
let
|
|
523
|
-
class
|
|
521
|
+
ee(y, "MIN_DISTANCE", 10);
|
|
522
|
+
let T = y;
|
|
523
|
+
class pt extends Ce {
|
|
524
524
|
/**
|
|
525
525
|
*
|
|
526
526
|
* @param {import("./viewshed").default} viewshed
|
|
527
527
|
*/
|
|
528
528
|
constructor(e) {
|
|
529
|
-
super(
|
|
529
|
+
super(L.CLICKMOVE), this._viewshed = e, this._positioned = new F(), this._finished = new F(), this._position = !1, this.setActive();
|
|
530
530
|
}
|
|
531
531
|
get finished() {
|
|
532
532
|
return this._finished;
|
|
@@ -535,13 +535,13 @@ class vt extends _e {
|
|
|
535
535
|
return this._positioned;
|
|
536
536
|
}
|
|
537
537
|
async pipe(e) {
|
|
538
|
-
return e.position && (this._position ? (this._viewshed.lookAt(
|
|
538
|
+
return e.position && (this._position ? (this._viewshed.lookAt(A.mercatorToWgs84(e.position)), e.type & L.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = A.mercatorToWgs84(e.position), e.type & L.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
|
|
539
539
|
}
|
|
540
540
|
destroy() {
|
|
541
541
|
super.destroy(), this._finished.destroy(), this._positioned.destroy();
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
const
|
|
544
|
+
const V = {
|
|
545
545
|
ABSOLUTE: "absolute",
|
|
546
546
|
RELATIVE: "relative"
|
|
547
547
|
}, m = {
|
|
@@ -550,15 +550,15 @@ const y = {
|
|
|
550
550
|
EDIT: "edit",
|
|
551
551
|
MOVE: "move",
|
|
552
552
|
MULTI_SELECT: "multiSelect"
|
|
553
|
-
},
|
|
554
|
-
function
|
|
555
|
-
const e = new
|
|
556
|
-
projection:
|
|
557
|
-
zIndex:
|
|
553
|
+
}, ae = 1.8;
|
|
554
|
+
function wt(s) {
|
|
555
|
+
const e = new be({
|
|
556
|
+
projection: Me.toJSON(),
|
|
557
|
+
zIndex: Te - 1
|
|
558
558
|
});
|
|
559
|
-
|
|
560
|
-
const i = new
|
|
561
|
-
return i.setStyle(new
|
|
559
|
+
Oe(e), e.activate();
|
|
560
|
+
const i = new Ge(new He(s));
|
|
561
|
+
return i.setStyle(new Ue({})), e.addFeatures([i]), e.vectorProperties.altitudeMode = Fe.NONE, {
|
|
562
562
|
layer: e,
|
|
563
563
|
feature: i,
|
|
564
564
|
destroy() {
|
|
@@ -566,119 +566,119 @@ function pt(s) {
|
|
|
566
566
|
}
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
const i = e ===
|
|
569
|
+
function K(s, e) {
|
|
570
|
+
const i = e === V.ABSOLUTE ? L.CLICKMOVE : L.NONE;
|
|
571
571
|
s.setActive(i), s.pickPosition = i, s.pullPickedPosition = 1.8;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
const t =
|
|
573
|
+
function mt(s, e, i) {
|
|
574
|
+
const t = X(null), o = R(null), n = R(null), l = R(V.ABSOLUTE);
|
|
575
575
|
let c = () => {
|
|
576
576
|
};
|
|
577
|
-
const r =
|
|
577
|
+
const r = X(null);
|
|
578
578
|
let f = () => {
|
|
579
579
|
};
|
|
580
580
|
function h() {
|
|
581
|
-
var
|
|
582
|
-
o.value && t.value ? (t.value.deactivate(), i.setVisibility(t.value.name, !1)) : (
|
|
581
|
+
var a;
|
|
582
|
+
o.value && t.value ? (t.value.deactivate(), i.setVisibility(t.value.name, !1)) : (a = t.value) == null || a.destroy();
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
f(), c(), h(), t.value = null,
|
|
584
|
+
function u(a = !0) {
|
|
585
|
+
f(), c(), h(), t.value = null, a && i.clearSelection(), o.value = null, n.value = null;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
f(), h(), s.maps.activeMap instanceof
|
|
587
|
+
function v(a) {
|
|
588
|
+
f(), h(), s.maps.activeMap instanceof N && (t.value = a, a.activate(s.maps.activeMap), f = s.maps.activeMap.shadowMapChanged.addEventListener((d) => {
|
|
589
589
|
var p;
|
|
590
|
-
d !== ((p = t.value) == null ? void 0 : p.shadowMap) &&
|
|
590
|
+
d !== ((p = t.value) == null ? void 0 : p.shadowMap) && u(!1);
|
|
591
591
|
}));
|
|
592
592
|
}
|
|
593
|
-
async function _(
|
|
594
|
-
|
|
595
|
-
const { eventHandler: d } = s.maps, { featureInteraction: p } = d, g = new
|
|
596
|
-
viewshedType:
|
|
593
|
+
async function _(a) {
|
|
594
|
+
u(), await ke();
|
|
595
|
+
const { eventHandler: d } = s.maps, { featureInteraction: p } = d, g = new T({
|
|
596
|
+
viewshedType: a,
|
|
597
597
|
colorOptions: {
|
|
598
598
|
visibleColor: e.visibleColor,
|
|
599
599
|
shadowColor: e.shadowColor
|
|
600
600
|
},
|
|
601
|
-
heightOffset:
|
|
601
|
+
heightOffset: l.value === V.ABSOLUTE ? 0 : ae
|
|
602
602
|
});
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
c(), t.value ? (t.value.showPrimitive = !0, n.value = m.EDIT) :
|
|
603
|
+
v(g);
|
|
604
|
+
const E = new pt(t.value);
|
|
605
|
+
E.finished.addEventListener(() => {
|
|
606
|
+
c(), t.value ? (t.value.showPrimitive = !0, n.value = m.EDIT) : u();
|
|
607
607
|
});
|
|
608
|
-
const
|
|
609
|
-
|
|
608
|
+
const k = d.addExclusiveInteraction(
|
|
609
|
+
E,
|
|
610
610
|
() => {
|
|
611
|
-
|
|
611
|
+
E.destroy();
|
|
612
612
|
}
|
|
613
613
|
);
|
|
614
|
-
|
|
615
|
-
|
|
614
|
+
K(p, l.value), E.positioned.addEventListener(() => {
|
|
615
|
+
K(p, V.ABSOLUTE);
|
|
616
616
|
}), c = () => {
|
|
617
|
-
|
|
617
|
+
k(), E.destroy(), p.setActive(), c = () => {
|
|
618
618
|
};
|
|
619
619
|
}, n.value = m.CREATE;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function C(a) {
|
|
622
622
|
var d;
|
|
623
|
-
if (t.value &&
|
|
623
|
+
if (t.value && a) {
|
|
624
624
|
c();
|
|
625
625
|
const {
|
|
626
626
|
layer: p,
|
|
627
627
|
feature: g,
|
|
628
|
-
destroy:
|
|
629
|
-
} =
|
|
630
|
-
s.layers.add(p),
|
|
628
|
+
destroy: E
|
|
629
|
+
} = wt(t.value.position);
|
|
630
|
+
s.layers.add(p), l.value === V.ABSOLUTE ? (r.value = ye(s, p), r.value.setFeatures([g])) : (r.value = Ve(s, p), r.value.setFeature(g)), r.value.stopped.addEventListener(() => {
|
|
631
631
|
c();
|
|
632
632
|
});
|
|
633
|
-
const
|
|
634
|
-
t.value ? t.value.position =
|
|
633
|
+
const k = (d = g.getGeometry()) == null ? void 0 : d.on("change", () => {
|
|
634
|
+
t.value ? t.value.position = A.mercatorToWgs84(
|
|
635
635
|
/** @type {import("ol/geom").Point} */
|
|
636
636
|
g.getGeometry().getCoordinates()
|
|
637
|
-
) :
|
|
637
|
+
) : u();
|
|
638
638
|
});
|
|
639
639
|
n.value = m.MOVE, c = () => {
|
|
640
|
-
var
|
|
640
|
+
var Q;
|
|
641
641
|
c = () => {
|
|
642
|
-
},
|
|
642
|
+
}, k && ze(k), (Q = r.value) == null || Q.stop(), r.value = null, s.layers.remove(p), E(), n.value = m.EDIT;
|
|
643
643
|
};
|
|
644
644
|
} else
|
|
645
645
|
c();
|
|
646
646
|
}
|
|
647
|
-
function P(
|
|
648
|
-
c(), t.value !== d && (
|
|
647
|
+
function P(a, d) {
|
|
648
|
+
c(), t.value !== d && (v(d), l.value = d.heightOffset ? V.RELATIVE : V.ABSOLUTE), o.value = !!d.properties.title, n.value = a, o.value && i.setVisibility(d.name, !0);
|
|
649
649
|
}
|
|
650
|
-
const
|
|
650
|
+
const b = [
|
|
651
651
|
i.collectionComponent.collection.removed.addEventListener(
|
|
652
|
-
(
|
|
652
|
+
(a) => {
|
|
653
653
|
var d;
|
|
654
|
-
i.remove(
|
|
654
|
+
i.remove(a.name), ((d = t.value) == null ? void 0 : d.name) === a.name && u();
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
i.renamed.addEventListener(({ item:
|
|
657
|
+
i.renamed.addEventListener(({ item: a, title: d }) => {
|
|
658
658
|
var g;
|
|
659
659
|
const p = s.windowManager.get(
|
|
660
660
|
`${i.collectionComponent.id}-editor`
|
|
661
661
|
);
|
|
662
|
-
p && ((g = t.value) == null ? void 0 : g.name) ===
|
|
662
|
+
p && ((g = t.value) == null ? void 0 : g.name) === a.name && (p.state.headerTitle = d);
|
|
663
663
|
}),
|
|
664
|
-
i.visibilityChanged.addEventListener((
|
|
664
|
+
i.visibilityChanged.addEventListener((a) => {
|
|
665
665
|
var p;
|
|
666
|
-
const d = ((p = t.value) == null ? void 0 : p.name) ===
|
|
667
|
-
d ?
|
|
666
|
+
const d = ((p = t.value) == null ? void 0 : p.name) === a.name;
|
|
667
|
+
d ? u() : (P(m.VIEW, a), i.clearSelection()), i.setVisibility(a.name, !d);
|
|
668
668
|
})
|
|
669
669
|
];
|
|
670
|
-
function
|
|
671
|
-
if (!(
|
|
672
|
-
if (
|
|
673
|
-
|
|
670
|
+
function x(a) {
|
|
671
|
+
if (!(a === l.value || !t.value)) {
|
|
672
|
+
if (l.value = a, n.value === m.MOVE && c(), n.value === m.CREATE)
|
|
673
|
+
K(
|
|
674
674
|
s.maps.eventHandler.featureInteraction,
|
|
675
|
-
|
|
676
|
-
), t.value.heightOffset =
|
|
675
|
+
a
|
|
676
|
+
), t.value.heightOffset = a === V.ABSOLUTE ? 0 : ae;
|
|
677
677
|
else if (n.value === m.EDIT) {
|
|
678
678
|
const { position: d, heightOffset: p } = t.value;
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
t.value && (t.value.heightOffset = d[2] -
|
|
679
|
+
a === V.RELATIVE ? s.maps.activeMap.getHeightFromTerrain([A.wgs84ToMercator(d)]).then((g) => {
|
|
680
|
+
const E = A.mercatorToWgs84(g[0]);
|
|
681
|
+
t.value && (t.value.heightOffset = d[2] - E[2], t.value.position = E);
|
|
682
682
|
}) : (t.value.position = [
|
|
683
683
|
d[0],
|
|
684
684
|
d[1],
|
|
@@ -692,45 +692,45 @@ function wt(s, e, i) {
|
|
|
692
692
|
currentIsPersisted: o,
|
|
693
693
|
currentEditSession: r,
|
|
694
694
|
createViewshed: _,
|
|
695
|
-
viewViewshed(
|
|
696
|
-
P(m.VIEW,
|
|
695
|
+
viewViewshed(a) {
|
|
696
|
+
P(m.VIEW, a);
|
|
697
697
|
},
|
|
698
|
-
editViewshed(
|
|
699
|
-
P(m.EDIT,
|
|
698
|
+
editViewshed(a) {
|
|
699
|
+
P(m.EDIT, a), o.value && (i.setSelection(a.name), i.collectionComponent.openEditorWindow(a));
|
|
700
700
|
},
|
|
701
701
|
persistCurrent() {
|
|
702
702
|
t.value && (i.add(t.value), o.value = !0, i.setSelection(t.value.name), i.setVisibility(t.value.name, !0));
|
|
703
703
|
},
|
|
704
|
-
moveCurrentViewshed:
|
|
704
|
+
moveCurrentViewshed: C,
|
|
705
705
|
setupMultiSelect() {
|
|
706
706
|
c(), n.value = m.MULTI_SELECT, h(), t.value = null;
|
|
707
707
|
},
|
|
708
708
|
mode: n,
|
|
709
|
-
heightMode:
|
|
710
|
-
changeHeightMode:
|
|
709
|
+
heightMode: l,
|
|
710
|
+
changeHeightMode: x,
|
|
711
711
|
async placeCurrentFeaturesOnTerrain() {
|
|
712
|
-
var
|
|
713
|
-
if (t.value && ((
|
|
712
|
+
var a, d;
|
|
713
|
+
if (t.value && ((a = r.value) == null ? void 0 : a.type) === Ee.EDIT_FEATURES && s.maps.activeMap instanceof N) {
|
|
714
714
|
const g = (await s.maps.activeMap.getHeightFromTerrain([
|
|
715
|
-
|
|
715
|
+
A.wgs84ToMercator((d = t.value) == null ? void 0 : d.position)
|
|
716
716
|
]))[0][2] - t.value.position[2];
|
|
717
717
|
r.value.translate(0, 0, g);
|
|
718
718
|
}
|
|
719
719
|
},
|
|
720
|
-
stop:
|
|
720
|
+
stop: u,
|
|
721
721
|
destroy() {
|
|
722
|
-
|
|
722
|
+
u(), b.forEach((a) => a());
|
|
723
723
|
}
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function pe(s, e, i, t, o, n, l, c) {
|
|
727
727
|
var r = typeof s == "function" ? s.options : s;
|
|
728
728
|
e && (r.render = e, r.staticRenderFns = i, r._compiled = !0), t && (r.functional = !0), n && (r._scopeId = "data-v-" + n);
|
|
729
729
|
var f;
|
|
730
|
-
if (
|
|
731
|
-
|
|
730
|
+
if (l ? (f = function(v) {
|
|
731
|
+
v = v || // cached call
|
|
732
732
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
733
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
733
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !v && typeof __VUE_SSR_CONTEXT__ < "u" && (v = __VUE_SSR_CONTEXT__), o && o.call(this, v), v && v._registeredComponents && v._registeredComponents.add(l);
|
|
734
734
|
}, r._ssrRegister = f) : o && (f = c ? function() {
|
|
735
735
|
o.call(
|
|
736
736
|
this,
|
|
@@ -740,36 +740,36 @@ function ve(s, e, i, t, o, n, a, c) {
|
|
|
740
740
|
if (r.functional) {
|
|
741
741
|
r._injectStyles = f;
|
|
742
742
|
var h = r.render;
|
|
743
|
-
r.render = function(_,
|
|
744
|
-
return f.call(
|
|
743
|
+
r.render = function(_, C) {
|
|
744
|
+
return f.call(C), h(_, C);
|
|
745
745
|
};
|
|
746
746
|
} else {
|
|
747
|
-
var
|
|
748
|
-
r.beforeCreate =
|
|
747
|
+
var u = r.beforeCreate;
|
|
748
|
+
r.beforeCreate = u ? [].concat(u, f) : [f];
|
|
749
749
|
}
|
|
750
750
|
return {
|
|
751
751
|
exports: s,
|
|
752
752
|
options: r
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
const
|
|
756
|
-
distance: [
|
|
755
|
+
const gt = {
|
|
756
|
+
distance: [T.MIN_DISTANCE, 2e3],
|
|
757
757
|
fov: [25, 85],
|
|
758
758
|
heading: [0, 360],
|
|
759
759
|
pitch: [-90, 90]
|
|
760
|
-
},
|
|
760
|
+
}, _t = {
|
|
761
761
|
components: {
|
|
762
|
-
VcsTextField:
|
|
763
|
-
VContainer:
|
|
764
|
-
VRow:
|
|
765
|
-
VCol:
|
|
766
|
-
VcsSlider:
|
|
767
|
-
VcsLabel:
|
|
768
|
-
VcsFormSection:
|
|
769
|
-
VDivider:
|
|
770
|
-
VcsSelect:
|
|
771
|
-
VcsFormButton:
|
|
772
|
-
VcsFeatureTransforms:
|
|
762
|
+
VcsTextField: Ke,
|
|
763
|
+
VContainer: he,
|
|
764
|
+
VRow: ue,
|
|
765
|
+
VCol: fe,
|
|
766
|
+
VcsSlider: Xe,
|
|
767
|
+
VcsLabel: le,
|
|
768
|
+
VcsFormSection: ce,
|
|
769
|
+
VDivider: nt,
|
|
770
|
+
VcsSelect: de,
|
|
771
|
+
VcsFormButton: Ye,
|
|
772
|
+
VcsFeatureTransforms: Je
|
|
773
773
|
},
|
|
774
774
|
name: "ViewshedWindow",
|
|
775
775
|
props: {
|
|
@@ -787,40 +787,40 @@ const mt = {
|
|
|
787
787
|
setup(s) {
|
|
788
788
|
const e = (
|
|
789
789
|
/** @type {import("./viewshedManager.js").ViewshedManager} */
|
|
790
|
-
|
|
790
|
+
ne("manager")
|
|
791
791
|
), i = (
|
|
792
792
|
/** @type {import("@vcmap/ui").VcsUiApp} */
|
|
793
|
-
|
|
793
|
+
ne("vcsApp")
|
|
794
794
|
), {
|
|
795
795
|
currentViewshed: t,
|
|
796
796
|
mode: o,
|
|
797
797
|
currentIsPersisted: n
|
|
798
|
-
} = e,
|
|
798
|
+
} = e, l = re(() => s.selection);
|
|
799
799
|
let c = () => {
|
|
800
800
|
};
|
|
801
|
-
const r =
|
|
801
|
+
const r = z({
|
|
802
802
|
X: void 0,
|
|
803
803
|
Y: void 0,
|
|
804
804
|
Z: void 0
|
|
805
|
-
}), f =
|
|
805
|
+
}), f = X();
|
|
806
806
|
let h = () => {
|
|
807
807
|
};
|
|
808
|
-
const
|
|
808
|
+
const u = z({
|
|
809
809
|
showPrimitive: !1,
|
|
810
810
|
distance: void 0,
|
|
811
811
|
fov: void 0,
|
|
812
812
|
heading: void 0,
|
|
813
813
|
pitch: void 0
|
|
814
|
-
}),
|
|
814
|
+
}), v = R();
|
|
815
815
|
function _() {
|
|
816
|
-
t.value && (r.X = t.value.position[0], r.Y = t.value.position[1], r.Z = e.heightMode.value ===
|
|
816
|
+
t.value && (r.X = t.value.position[0], r.Y = t.value.position[1], r.Z = e.heightMode.value === V.ABSOLUTE ? t.value.position[2] : t.value.heightOffset);
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
_(), t.value && (
|
|
818
|
+
function C() {
|
|
819
|
+
_(), t.value && (u.distance = t.value.distance, u.fov = t.value.fov, u.heading = t.value.heading, u.pitch = t.value.pitch, u.showPrimitive = t.value.showPrimitive, v.value = t.value.type);
|
|
820
820
|
}
|
|
821
|
-
|
|
822
|
-
t.value && o.value !== m.CREATE &&
|
|
823
|
-
}),
|
|
821
|
+
je(() => {
|
|
822
|
+
t.value && o.value !== m.CREATE && C();
|
|
823
|
+
}), $(
|
|
824
824
|
t,
|
|
825
825
|
() => {
|
|
826
826
|
t.value && (c(), c = t.value.positionChanged.addEventListener(() => {
|
|
@@ -832,34 +832,34 @@ const mt = {
|
|
|
832
832
|
async function P() {
|
|
833
833
|
var p, g;
|
|
834
834
|
(p = t.value) == null || p.deactivate();
|
|
835
|
-
const
|
|
835
|
+
const a = (
|
|
836
836
|
/** @type {import("@vcmap/core").CesiumMap} */
|
|
837
837
|
(g = i.maps.activeMap.getScene()) == null ? void 0 : g.camera
|
|
838
|
-
), d =
|
|
838
|
+
), d = a == null ? void 0 : a.changed.addEventListener(() => {
|
|
839
839
|
h();
|
|
840
840
|
});
|
|
841
841
|
h = () => {
|
|
842
|
-
var
|
|
843
|
-
d == null || d(), f.value = null, (
|
|
842
|
+
var E;
|
|
843
|
+
d == null || d(), f.value = null, (E = t.value) == null || E.activate(i.maps.activeMap), h = () => {
|
|
844
844
|
};
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
|
-
|
|
847
|
+
We(() => {
|
|
848
848
|
var d;
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
}),
|
|
852
|
-
c(), h(), n.value || ((o.value === m.EDIT || o.value === m.MOVE) && t.value ? e.viewViewshed(t.value) : o.value === m.CREATE && e.stop()),
|
|
849
|
+
const a = (d = s.getViewshed) == null ? void 0 : d.call(s);
|
|
850
|
+
a && e.editViewshed(a);
|
|
851
|
+
}), Be(() => {
|
|
852
|
+
c(), h(), n.value || ((o.value === m.EDIT || o.value === m.MOVE) && t.value ? e.viewViewshed(t.value) : o.value === m.CREATE && e.stop()), l.value && (l.value.length > 1 ? e.setupMultiSelect() : l.value.length === 1 && t.value ? e.viewViewshed(t.value) : (
|
|
853
853
|
// when a persited viewshed is deselected, stops plugin
|
|
854
|
-
!
|
|
854
|
+
!l.value.length && o.value === m.EDIT && e.stop(!1)
|
|
855
855
|
));
|
|
856
|
-
}),
|
|
857
|
-
function
|
|
858
|
-
h(), t.value && (
|
|
856
|
+
}), C();
|
|
857
|
+
function b(a, d) {
|
|
858
|
+
h(), t.value && (u[a] = d, t.value[a] = d);
|
|
859
859
|
}
|
|
860
|
-
const
|
|
861
|
-
const
|
|
862
|
-
return
|
|
860
|
+
const x = re(() => {
|
|
861
|
+
const a = [];
|
|
862
|
+
return v.value === w.CONE && a.push({
|
|
863
863
|
name: "jumpToViewpoint",
|
|
864
864
|
title: f.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
|
|
865
865
|
icon: "mdi-human-male",
|
|
@@ -867,7 +867,7 @@ const mt = {
|
|
|
867
867
|
async callback() {
|
|
868
868
|
var d, p, g;
|
|
869
869
|
e.moveCurrentViewshed(!1), t.value && !f.value ? (f.value = await ((d = i.maps.activeMap) == null ? void 0 : d.getViewpoint()), await ((p = i.maps.activeMap) == null ? void 0 : p.gotoViewpoint(
|
|
870
|
-
new
|
|
870
|
+
new Se({
|
|
871
871
|
groundPosition: [
|
|
872
872
|
t.value.position[0],
|
|
873
873
|
t.value.position[1],
|
|
@@ -881,64 +881,64 @@ const mt = {
|
|
|
881
881
|
})
|
|
882
882
|
)), P()) : f.value && ((g = i.maps.activeMap) == null || g.gotoViewpoint(f.value), h());
|
|
883
883
|
}
|
|
884
|
-
}),
|
|
884
|
+
}), a.push({
|
|
885
885
|
name: "moveViewshed",
|
|
886
886
|
title: "viewshed.move",
|
|
887
|
-
icon: e.heightMode.value ===
|
|
887
|
+
icon: e.heightMode.value === V.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
|
|
888
888
|
active: o.value === m.MOVE,
|
|
889
889
|
callback() {
|
|
890
890
|
e.moveCurrentViewshed(
|
|
891
891
|
o.value !== m.MOVE
|
|
892
892
|
);
|
|
893
893
|
}
|
|
894
|
-
}),
|
|
894
|
+
}), a.unshift({
|
|
895
895
|
name: "showPrimitive",
|
|
896
896
|
title: "viewshed.showPrimitive",
|
|
897
897
|
icon: "mdi-eye",
|
|
898
|
-
active:
|
|
898
|
+
active: u.showPrimitive,
|
|
899
899
|
callback() {
|
|
900
|
-
this.active = !this.active,
|
|
900
|
+
this.active = !this.active, b("showPrimitive", this.active);
|
|
901
901
|
}
|
|
902
|
-
}),
|
|
902
|
+
}), a;
|
|
903
903
|
});
|
|
904
904
|
return {
|
|
905
905
|
position: r,
|
|
906
|
-
setPosition(
|
|
906
|
+
setPosition(a, d, p) {
|
|
907
907
|
if (h(), !!t.value) {
|
|
908
|
-
if (p === 2 && e.heightMode.value ===
|
|
909
|
-
t.value.heightOffset = Number(
|
|
908
|
+
if (p === 2 && e.heightMode.value === V.RELATIVE)
|
|
909
|
+
t.value.heightOffset = Number(a);
|
|
910
910
|
else {
|
|
911
911
|
const g = [...t.value.position];
|
|
912
|
-
g[p] = Number(
|
|
912
|
+
g[p] = Number(a), t.value.position = g;
|
|
913
913
|
}
|
|
914
|
-
r[d] = Number(
|
|
914
|
+
r[d] = Number(a);
|
|
915
915
|
}
|
|
916
916
|
},
|
|
917
|
-
parameters:
|
|
918
|
-
setParameter:
|
|
919
|
-
parameterRanges:
|
|
917
|
+
parameters: u,
|
|
918
|
+
setParameter: b,
|
|
919
|
+
parameterRanges: gt,
|
|
920
920
|
ViewshedPluginModes: m,
|
|
921
921
|
viewshedMode: o,
|
|
922
922
|
currentIsPersisted: n,
|
|
923
|
-
viewshedType:
|
|
923
|
+
viewshedType: v,
|
|
924
924
|
ViewshedTypes: w,
|
|
925
|
-
HeightModes:
|
|
925
|
+
HeightModes: V,
|
|
926
926
|
heightMode: e.heightMode,
|
|
927
|
-
TransformationMode:
|
|
927
|
+
TransformationMode: Pe,
|
|
928
928
|
changeHeightMode: e.changeHeightMode,
|
|
929
929
|
async createNewViewshed() {
|
|
930
|
-
await e.createViewshed(
|
|
930
|
+
await e.createViewshed(v.value);
|
|
931
931
|
},
|
|
932
932
|
addToMyWorkspace: () => e.persistCurrent(),
|
|
933
933
|
cancel: () => e.stop(),
|
|
934
|
-
headerActions:
|
|
934
|
+
headerActions: x
|
|
935
935
|
};
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
|
-
var
|
|
938
|
+
var Ct = function() {
|
|
939
939
|
var e = this, i = e._self._c;
|
|
940
940
|
return i("div", [e.viewshedMode === e.ViewshedPluginModes.CREATE ? i("div", { staticClass: "px-2 py-1" }, [e.viewshedType === e.ViewshedTypes.CONE ? [e._v(" " + e._s(e.$t("viewshed.createDescription")) + " ")] : e.viewshedType === e.ViewshedTypes.THREESIXTY ? [e._v(" " + e._s(e.$t("viewshed.createThreeSixtyDescription")) + " ")] : e._e()], 2) : e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? i("VcsFormSection", { attrs: { "header-actions": e.headerActions, heading: "viewshed.viewpoint", "action-button-list-overflow-count": 3 } }, [i("v-container", { staticClass: "px-1 py-0" }, [i("v-row", { attrs: { "no-gutters": "" } }, [i("span", { staticClass: "px-1 py-0" }, [e._v(e._s(e.$t("viewshed.position")))])]), e.viewshedMode === e.ViewshedPluginModes.MOVE && e.heightMode === e.HeightModes.ABSOLUTE ? i("v-row", { attrs: { "no-gutters": "" } }, [i("VcsFeatureTransforms", { attrs: { "transformation-mode": e.TransformationMode.TRANSLATE, "feature-properties": { altitudeMode: "absolute" }, "allow-z-input": !0 } })], 1) : i("v-row", { attrs: { "no-gutters": "" } }, e._l(e.position, function(t, o, n) {
|
|
941
|
-
return i("v-col", { key: n, staticClass: "pb-1" }, [i("VcsTextField", { attrs: { value: t, type: "number", prefix: o, "show-spin-buttons": !0, step: o === "Z" ? 1 : 1e-4, unit: o === "Z" ? "m" : "°", decimals: o === "Z" ? 2 : 8, disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(o === "Z" && e.heightMode === e.HeightModes.RELATIVE) }, on: { input: (
|
|
941
|
+
return i("v-col", { key: n, staticClass: "pb-1" }, [i("VcsTextField", { attrs: { value: t, type: "number", prefix: o, "show-spin-buttons": !0, step: o === "Z" ? 1 : 1e-4, unit: o === "Z" ? "m" : "°", decimals: o === "Z" ? 2 : 8, disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(o === "Z" && e.heightMode === e.HeightModes.RELATIVE) }, on: { input: (l) => e.setPosition(l, o, n) } })], 1);
|
|
942
942
|
}), 1)], 1)], 1) : e._e(), i("v-divider"), i("v-container", { staticClass: "px-1 py-0" }, [i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", [e._v(" " + e._s(e.$t("viewshed.heightMode")) + " ")])], 1), i("v-col", [i("VcsSelect", { attrs: { items: Object.values(e.HeightModes).map((t) => ({
|
|
943
943
|
value: t,
|
|
944
944
|
text: `viewshed.${t}`
|
|
@@ -951,23 +951,23 @@ var _t = function() {
|
|
|
951
951
|
} } }, [e._v(" " + e._s(e.$t("viewshed.new")) + " ")])], 1) : e.viewshedMode === e.ViewshedPluginModes.CREATE ? i("div", { staticClass: "d-flex w-full justify-end px-2 pt-2 pb-1" }, [i("VcsFormButton", { attrs: { variant: "filled" }, on: { click: function(t) {
|
|
952
952
|
return e.cancel();
|
|
953
953
|
} } }, [e._v(" " + e._s(e.$t("viewshed.cancel")) + " ")])], 1) : e._e()], 1);
|
|
954
|
-
},
|
|
955
|
-
gt,
|
|
954
|
+
}, Et = [], yt = /* @__PURE__ */ pe(
|
|
956
955
|
_t,
|
|
957
956
|
Ct,
|
|
957
|
+
Et,
|
|
958
958
|
!1,
|
|
959
959
|
null,
|
|
960
960
|
null,
|
|
961
961
|
null,
|
|
962
962
|
null
|
|
963
963
|
);
|
|
964
|
-
const
|
|
964
|
+
const Vt = yt.exports, S = "@vcmap/viewshed", bt = "2.0.9", Mt = "^5.1", Z = {
|
|
965
965
|
[w.CONE]: "$vcsViewshed",
|
|
966
966
|
[w.THREESIXTY]: "$vcsViewshedCone"
|
|
967
967
|
};
|
|
968
|
-
function
|
|
969
|
-
const t =
|
|
970
|
-
component:
|
|
968
|
+
function Tt(s, e, i) {
|
|
969
|
+
const t = R(), o = R(), n = `${i.id}-editor`, l = {
|
|
970
|
+
component: Vt,
|
|
971
971
|
provides: {
|
|
972
972
|
manager: s
|
|
973
973
|
},
|
|
@@ -978,17 +978,17 @@ function Mt(s, e, i) {
|
|
|
978
978
|
infoUrlCallback: e.getHelpUrlCallback("tools/viewshedTool.html")
|
|
979
979
|
}
|
|
980
980
|
};
|
|
981
|
-
|
|
982
|
-
editor: (
|
|
983
|
-
...
|
|
981
|
+
Ze(e, i, {
|
|
982
|
+
editor: (v) => ({
|
|
983
|
+
...l,
|
|
984
984
|
props: {
|
|
985
985
|
selection: i.selection,
|
|
986
|
-
getViewshed: () => i.collection.getByKey(
|
|
986
|
+
getViewshed: () => i.collection.getByKey(v.name)
|
|
987
987
|
}
|
|
988
988
|
})
|
|
989
989
|
});
|
|
990
990
|
function c() {
|
|
991
|
-
s.currentViewshed.value && (o.value =
|
|
991
|
+
s.currentViewshed.value && (o.value = Z[s.currentViewshed.value.type], s.currentIsPersisted.value ? t.value = s.currentViewshed.value.properties.title : s.mode.value === m.CREATE ? t.value = [
|
|
992
992
|
"viewshed.create",
|
|
993
993
|
`viewshed.${s.currentViewshed.value.type}`
|
|
994
994
|
] : t.value = [
|
|
@@ -999,31 +999,31 @@ function Mt(s, e, i) {
|
|
|
999
999
|
function r() {
|
|
1000
1000
|
c(), s.currentViewshed.value && !s.currentIsPersisted.value && (s.mode.value === m.EDIT || s.mode.value === m.MOVE || s.mode.value === m.CREATE) && (e.windowManager.has(n) || e.windowManager.add(
|
|
1001
1001
|
{
|
|
1002
|
-
...
|
|
1002
|
+
...l,
|
|
1003
1003
|
id: n,
|
|
1004
1004
|
parentId: "category-manager",
|
|
1005
|
-
slot:
|
|
1005
|
+
slot: qe.DYNAMIC_CHILD
|
|
1006
1006
|
},
|
|
1007
|
-
|
|
1007
|
+
S
|
|
1008
1008
|
));
|
|
1009
1009
|
}
|
|
1010
|
-
const f =
|
|
1011
|
-
|
|
1012
|
-
}), h =
|
|
1013
|
-
|
|
1014
|
-
}),
|
|
1010
|
+
const f = $(s.currentViewshed, (v) => {
|
|
1011
|
+
v && r();
|
|
1012
|
+
}), h = $(s.currentIsPersisted, (v) => {
|
|
1013
|
+
v && c();
|
|
1014
|
+
}), u = $(s.mode, () => {
|
|
1015
1015
|
s.mode.value ? r() : e.windowManager.remove(n);
|
|
1016
1016
|
});
|
|
1017
1017
|
return {
|
|
1018
1018
|
destroy() {
|
|
1019
|
-
e.windowManager.remove(n), f(),
|
|
1019
|
+
e.windowManager.remove(n), f(), u(), h();
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function Ot(s, e, i, t) {
|
|
1024
1024
|
const o = {
|
|
1025
|
-
type:
|
|
1026
|
-
action:
|
|
1025
|
+
type: Qe.SELECT,
|
|
1026
|
+
action: z({
|
|
1027
1027
|
name: i,
|
|
1028
1028
|
currentIndex: 0,
|
|
1029
1029
|
active: !1,
|
|
@@ -1046,17 +1046,17 @@ function Tt(s, e, i, t) {
|
|
|
1046
1046
|
},
|
|
1047
1047
|
tools: t.flatMap((r) => r === w.CONE ? {
|
|
1048
1048
|
name: w.CONE,
|
|
1049
|
-
icon:
|
|
1049
|
+
icon: Z[w.CONE],
|
|
1050
1050
|
title: `viewshed.${w.CONE}`
|
|
1051
1051
|
} : r === w.THREESIXTY ? {
|
|
1052
1052
|
name: w.THREESIXTY,
|
|
1053
|
-
icon:
|
|
1053
|
+
icon: Z[w.THREESIXTY],
|
|
1054
1054
|
title: `viewshed.${w.THREESIXTY}`
|
|
1055
1055
|
} : [])
|
|
1056
1056
|
})
|
|
1057
|
-
}, n =
|
|
1057
|
+
}, n = $(e.mode, (r) => {
|
|
1058
1058
|
r === m.VIEW ? (o.action.background = !0, o.action.active = !0) : r ? (o.action.background = !1, o.action.active = !0) : (o.action.background = !1, o.action.active = !1);
|
|
1059
|
-
}),
|
|
1059
|
+
}), l = $(
|
|
1060
1060
|
e.currentViewshed,
|
|
1061
1061
|
(r) => {
|
|
1062
1062
|
r && (o.action.currentIndex = o.action.tools.findIndex(
|
|
@@ -1064,23 +1064,23 @@ function Tt(s, e, i, t) {
|
|
|
1064
1064
|
));
|
|
1065
1065
|
}
|
|
1066
1066
|
), c = s.maps.mapActivated.addEventListener((r) => {
|
|
1067
|
-
r instanceof
|
|
1067
|
+
r instanceof N ? o.action.disabled = !1 : o.action.disabled = !0;
|
|
1068
1068
|
});
|
|
1069
1069
|
return {
|
|
1070
1070
|
destroy() {
|
|
1071
|
-
n(),
|
|
1071
|
+
n(), l(), c();
|
|
1072
1072
|
},
|
|
1073
1073
|
toolbox: o
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1077
|
-
|
|
1078
|
-
const { toolbox: o, destroy: n } =
|
|
1076
|
+
function St(s, e, i, t) {
|
|
1077
|
+
H(t, [Object.values(w)]);
|
|
1078
|
+
const { toolbox: o, destroy: n } = Ot(s, e, i, t), l = s.toolboxManager.add(o, i).id;
|
|
1079
1079
|
return () => {
|
|
1080
|
-
s.toolboxManager.remove(
|
|
1080
|
+
s.toolboxManager.remove(l), n();
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
|
-
class
|
|
1083
|
+
class q extends Ie {
|
|
1084
1084
|
static get className() {
|
|
1085
1085
|
return "ViewshedCategory";
|
|
1086
1086
|
}
|
|
@@ -1088,14 +1088,14 @@ class Z extends Pe {
|
|
|
1088
1088
|
var t;
|
|
1089
1089
|
const i = (
|
|
1090
1090
|
/** @type {import("@vcmap/core").CesiumMap | undefined} */
|
|
1091
|
-
(t = this._app) == null ? void 0 : t.maps.getByType(
|
|
1091
|
+
(t = this._app) == null ? void 0 : t.maps.getByType(N.className)[0]
|
|
1092
1092
|
);
|
|
1093
1093
|
if (i)
|
|
1094
|
-
return new
|
|
1094
|
+
return new T(e, i);
|
|
1095
1095
|
throw new Error("No CesiumMap available");
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function Pt(s, e) {
|
|
1099
1099
|
let i, t = 0;
|
|
1100
1100
|
const o = new Set(
|
|
1101
1101
|
e.filter((n) => n.type === s).map((n) => n.properties.title)
|
|
@@ -1105,14 +1105,14 @@ function St(s, e) {
|
|
|
1105
1105
|
while (!i);
|
|
1106
1106
|
return i;
|
|
1107
1107
|
}
|
|
1108
|
-
async function
|
|
1109
|
-
const e = new
|
|
1108
|
+
async function It(s) {
|
|
1109
|
+
const e = new F(), i = new F(), { collectionComponent: t, category: o } = await s.categoryManager.requestCategory(
|
|
1110
1110
|
{
|
|
1111
|
-
type:
|
|
1111
|
+
type: q.className,
|
|
1112
1112
|
name: "Viewsheds",
|
|
1113
1113
|
title: "Viewsheds"
|
|
1114
1114
|
},
|
|
1115
|
-
|
|
1115
|
+
S,
|
|
1116
1116
|
{
|
|
1117
1117
|
selectable: !0,
|
|
1118
1118
|
renamable: !0,
|
|
@@ -1120,17 +1120,17 @@ async function Pt(s) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
);
|
|
1122
1122
|
t.addItemMapping({
|
|
1123
|
-
mappingFunction:
|
|
1124
|
-
[
|
|
1123
|
+
mappingFunction: et(
|
|
1124
|
+
[N.className],
|
|
1125
1125
|
s.maps
|
|
1126
1126
|
),
|
|
1127
|
-
owner:
|
|
1127
|
+
owner: S
|
|
1128
1128
|
});
|
|
1129
|
-
const n = (h,
|
|
1130
|
-
|
|
1131
|
-
h.properties.title = _,
|
|
1132
|
-
},
|
|
1133
|
-
|
|
1129
|
+
const n = (h, u, v) => {
|
|
1130
|
+
v.title = h.properties.title, v.titleChanged = (_) => {
|
|
1131
|
+
h.properties.title = _, v.title = _, e.raiseEvent({ item: h, title: _ });
|
|
1132
|
+
}, v.actions.push(
|
|
1133
|
+
z({
|
|
1134
1134
|
name: "visibilityAction",
|
|
1135
1135
|
icon: "$vcsCheckbox",
|
|
1136
1136
|
callback() {
|
|
@@ -1142,56 +1142,81 @@ async function Pt(s) {
|
|
|
1142
1142
|
s.categoryManager.addMappingFunction(
|
|
1143
1143
|
() => !0,
|
|
1144
1144
|
n,
|
|
1145
|
-
|
|
1145
|
+
S,
|
|
1146
1146
|
[t.id]
|
|
1147
1147
|
);
|
|
1148
|
-
const { action:
|
|
1148
|
+
const { action: l, destroy: c } = tt(
|
|
1149
1149
|
t.selection,
|
|
1150
1150
|
() => {
|
|
1151
1151
|
const h = t.selection.value.map(
|
|
1152
|
-
(
|
|
1152
|
+
(u) => t.collection.getByKey(u.name)
|
|
1153
1153
|
);
|
|
1154
|
-
|
|
1154
|
+
it(JSON.stringify(h), "viewsheds.json");
|
|
1155
1155
|
},
|
|
1156
|
-
|
|
1157
|
-
), { action: r, destroy: f } =
|
|
1156
|
+
S
|
|
1157
|
+
), { action: r, destroy: f } = st(
|
|
1158
1158
|
async (h) => {
|
|
1159
|
-
await Promise.all(
|
|
1160
|
-
h.map(async (
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1159
|
+
const { vueI18n: u } = s, _ = (await Promise.all(
|
|
1160
|
+
h.map(async (b) => {
|
|
1161
|
+
const x = await b.text();
|
|
1162
|
+
try {
|
|
1163
|
+
return JSON.parse(x).map((d) => new T(d));
|
|
1164
|
+
} catch {
|
|
1165
|
+
s.notifier.add({
|
|
1166
|
+
type: j.ERROR,
|
|
1167
|
+
message: u.t("components.import.failure", {
|
|
1168
|
+
fileName: b.name
|
|
1169
|
+
})
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
return [];
|
|
1166
1173
|
})
|
|
1167
|
-
);
|
|
1174
|
+
)).flat(), C = _.map((b) => o.collection.add(b)).filter((b) => b != null), P = _.length - C.length;
|
|
1175
|
+
if (P > 0)
|
|
1176
|
+
return s.notifier.add({
|
|
1177
|
+
type: j.WARNING,
|
|
1178
|
+
message: u.t("components.import.addFailure", [P])
|
|
1179
|
+
}), !1;
|
|
1180
|
+
if (C.length > 0)
|
|
1181
|
+
s.notifier.add({
|
|
1182
|
+
type: j.SUCCESS,
|
|
1183
|
+
message: u.t("components.import.featuresAdded", [
|
|
1184
|
+
C.length
|
|
1185
|
+
])
|
|
1186
|
+
});
|
|
1187
|
+
else
|
|
1188
|
+
return s.notifier.add({
|
|
1189
|
+
type: j.ERROR,
|
|
1190
|
+
message: u.t("components.import.nothingAdded")
|
|
1191
|
+
}), !1;
|
|
1192
|
+
return !0;
|
|
1168
1193
|
},
|
|
1169
1194
|
s.windowManager,
|
|
1170
|
-
|
|
1195
|
+
S,
|
|
1171
1196
|
"category-manager"
|
|
1172
1197
|
);
|
|
1173
|
-
return t.addActions([
|
|
1198
|
+
return t.addActions([l, r]), {
|
|
1174
1199
|
renamed: e,
|
|
1175
1200
|
visibilityChanged: i,
|
|
1176
1201
|
setSelection(h) {
|
|
1177
|
-
h && (t.selection.value = t.items.value.filter((
|
|
1202
|
+
h && (t.selection.value = t.items.value.filter((u) => h === u.name));
|
|
1178
1203
|
},
|
|
1179
1204
|
clearSelection() {
|
|
1180
1205
|
t.selection.value.length && (t.selection.value = []);
|
|
1181
1206
|
},
|
|
1182
|
-
setVisibility(h,
|
|
1183
|
-
const
|
|
1207
|
+
setVisibility(h, u) {
|
|
1208
|
+
const v = t.items.value.find(
|
|
1184
1209
|
(_) => h === _.name
|
|
1185
1210
|
);
|
|
1186
|
-
if (
|
|
1187
|
-
const _ =
|
|
1188
|
-
(
|
|
1211
|
+
if (v) {
|
|
1212
|
+
const _ = v.actions.find(
|
|
1213
|
+
(C) => C.name === "visibilityAction"
|
|
1189
1214
|
);
|
|
1190
|
-
_ && (_.icon =
|
|
1215
|
+
_ && (_.icon = u ? "$vcsCheckboxChecked" : "$vcsCheckbox");
|
|
1191
1216
|
}
|
|
1192
1217
|
},
|
|
1193
1218
|
add(h) {
|
|
1194
|
-
h.properties.title =
|
|
1219
|
+
h.properties.title = Pt(
|
|
1195
1220
|
h.type,
|
|
1196
1221
|
/** @type {import("./viewshed.js").default[]} */
|
|
1197
1222
|
[
|
|
@@ -1200,34 +1225,34 @@ async function Pt(s) {
|
|
|
1200
1225
|
), o.collection.add(h);
|
|
1201
1226
|
},
|
|
1202
1227
|
remove(h) {
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1228
|
+
const u = o.collection.getByKey(h);
|
|
1229
|
+
u && o.collection.remove(u);
|
|
1205
1230
|
},
|
|
1206
1231
|
collectionComponent: t,
|
|
1207
1232
|
destroy() {
|
|
1208
|
-
s.categoryManager.removeOwner(
|
|
1233
|
+
s.categoryManager.removeOwner(S), e.destroy(), i.destroy(), c(), f();
|
|
1209
1234
|
}
|
|
1210
1235
|
};
|
|
1211
1236
|
}
|
|
1212
|
-
function
|
|
1237
|
+
function W() {
|
|
1213
1238
|
return {
|
|
1214
|
-
visibleColor:
|
|
1215
|
-
shadowColor:
|
|
1239
|
+
visibleColor: T.getDefaultOptions().visibleColor,
|
|
1240
|
+
shadowColor: T.getDefaultOptions().shadowColor,
|
|
1216
1241
|
tools: [...Object.values(w)]
|
|
1217
1242
|
};
|
|
1218
1243
|
}
|
|
1219
|
-
const
|
|
1244
|
+
const Rt = {
|
|
1220
1245
|
name: "ViewshedConfigEditor",
|
|
1221
1246
|
title: "Viewshed Editor",
|
|
1222
1247
|
components: {
|
|
1223
|
-
AbstractConfigEditor:
|
|
1224
|
-
VcsFormSection:
|
|
1225
|
-
VContainer:
|
|
1226
|
-
VRow:
|
|
1227
|
-
VCol:
|
|
1228
|
-
VcsLabel:
|
|
1229
|
-
VcsSelect:
|
|
1230
|
-
VColorPicker:
|
|
1248
|
+
AbstractConfigEditor: ot,
|
|
1249
|
+
VcsFormSection: ce,
|
|
1250
|
+
VContainer: he,
|
|
1251
|
+
VRow: ue,
|
|
1252
|
+
VCol: fe,
|
|
1253
|
+
VcsLabel: le,
|
|
1254
|
+
VcsSelect: de,
|
|
1255
|
+
VColorPicker: rt
|
|
1231
1256
|
},
|
|
1232
1257
|
props: {
|
|
1233
1258
|
getConfig: {
|
|
@@ -1240,9 +1265,9 @@ const At = {
|
|
|
1240
1265
|
}
|
|
1241
1266
|
},
|
|
1242
1267
|
setup(s) {
|
|
1243
|
-
const e =
|
|
1268
|
+
const e = R({});
|
|
1244
1269
|
s.getConfig().then((t) => {
|
|
1245
|
-
e.value = Object.assign(
|
|
1270
|
+
e.value = Object.assign(W(), t);
|
|
1246
1271
|
});
|
|
1247
1272
|
async function i() {
|
|
1248
1273
|
await s.setConfig(e.value);
|
|
@@ -1258,7 +1283,7 @@ const At = {
|
|
|
1258
1283
|
};
|
|
1259
1284
|
}
|
|
1260
1285
|
};
|
|
1261
|
-
var
|
|
1286
|
+
var At = function() {
|
|
1262
1287
|
var e = this, i = e._self._c;
|
|
1263
1288
|
return i("AbstractConfigEditor", e._b({ on: { submit: e.apply } }, "AbstractConfigEditor", { ...e.$attrs, ...e.$props }, !1), [e.localConfig ? i("VcsFormSection", { attrs: { heading: "viewshed.editor.general" } }, [i("v-container", { staticClass: "px-1 py-0" }, [i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", { attrs: { "html-for": "viewshed-editor-tools" } }, [e._v(e._s(e.$t("viewshed.editor.tools")))])], 1), i("v-col", [i("VcsSelect", { attrs: { id: "viewshed-tools", items: e.toolItems, multiple: !0 }, model: { value: e.localConfig.tools, callback: function(t) {
|
|
1264
1289
|
e.$set(e.localConfig, "tools", t);
|
|
@@ -1267,29 +1292,29 @@ var It = function() {
|
|
|
1267
1292
|
}, expression: "localConfig.visibleColor" } })], 1)], 1), i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", { attrs: { "html-for": "viewshed-editor-shadow-color" } }, [e._v(e._s(e.$t("viewshed.editor.shadowColor")))])], 1), i("v-col", [i("VColorPicker", { attrs: { mode: "rgba" }, model: { value: e.localConfig.shadowColor, callback: function(t) {
|
|
1268
1293
|
e.$set(e.localConfig, "shadowColor", t);
|
|
1269
1294
|
}, expression: "localConfig.shadowColor" } })], 1)], 1)], 1)], 1) : e._e()], 1);
|
|
1270
|
-
},
|
|
1271
|
-
At,
|
|
1272
|
-
It,
|
|
1295
|
+
}, $t = [], Nt = /* @__PURE__ */ pe(
|
|
1273
1296
|
Rt,
|
|
1297
|
+
At,
|
|
1298
|
+
$t,
|
|
1274
1299
|
!1,
|
|
1275
1300
|
null,
|
|
1276
1301
|
null,
|
|
1277
1302
|
null,
|
|
1278
1303
|
null
|
|
1279
1304
|
);
|
|
1280
|
-
const
|
|
1281
|
-
function
|
|
1305
|
+
const xt = Nt.exports;
|
|
1306
|
+
function zt(s) {
|
|
1282
1307
|
let e, i = () => {
|
|
1283
1308
|
};
|
|
1284
1309
|
return {
|
|
1285
1310
|
get name() {
|
|
1286
|
-
return
|
|
1311
|
+
return S;
|
|
1287
1312
|
},
|
|
1288
1313
|
get version() {
|
|
1289
|
-
return
|
|
1314
|
+
return bt;
|
|
1290
1315
|
},
|
|
1291
1316
|
get mapVersion() {
|
|
1292
|
-
return
|
|
1317
|
+
return Mt;
|
|
1293
1318
|
},
|
|
1294
1319
|
/**
|
|
1295
1320
|
* @param {import("@vcmap/ui").VcsUiApp} vcsUiApp
|
|
@@ -1298,55 +1323,55 @@ function Bt(s) {
|
|
|
1298
1323
|
*/
|
|
1299
1324
|
async initialize(t, o) {
|
|
1300
1325
|
t.categoryClassRegistry.registerClass(
|
|
1301
|
-
this[
|
|
1302
|
-
|
|
1303
|
-
|
|
1326
|
+
this[Re],
|
|
1327
|
+
q.className,
|
|
1328
|
+
q
|
|
1304
1329
|
);
|
|
1305
|
-
const n = await
|
|
1306
|
-
e =
|
|
1330
|
+
const n = await It(t);
|
|
1331
|
+
e = mt(
|
|
1307
1332
|
t,
|
|
1308
1333
|
s,
|
|
1309
1334
|
n
|
|
1310
1335
|
);
|
|
1311
|
-
const
|
|
1336
|
+
const l = St(
|
|
1312
1337
|
t,
|
|
1313
1338
|
e,
|
|
1314
|
-
|
|
1315
|
-
s.tools ||
|
|
1316
|
-
), { destroy: c } =
|
|
1339
|
+
S,
|
|
1340
|
+
s.tools || W().tools
|
|
1341
|
+
), { destroy: c } = Tt(
|
|
1317
1342
|
e,
|
|
1318
1343
|
t,
|
|
1319
1344
|
n.collectionComponent
|
|
1320
1345
|
), { activeMap: r } = t.maps;
|
|
1321
|
-
function f(
|
|
1322
|
-
if (o != null && o.mode && o.currentViewshed &&
|
|
1323
|
-
const _ = new
|
|
1346
|
+
function f(v) {
|
|
1347
|
+
if (o != null && o.mode && o.currentViewshed && v instanceof N) {
|
|
1348
|
+
const _ = new T(o.currentViewshed, r);
|
|
1324
1349
|
o.mode === m.VIEW ? e.viewViewshed(_) : e.editViewshed(_);
|
|
1325
1350
|
}
|
|
1326
1351
|
}
|
|
1327
1352
|
let h = !1;
|
|
1328
1353
|
r && (h = !0, f(r));
|
|
1329
|
-
const
|
|
1330
|
-
(
|
|
1331
|
-
e.stop(), h || (f(
|
|
1354
|
+
const u = t.maps.mapActivated.addEventListener(
|
|
1355
|
+
(v) => {
|
|
1356
|
+
e.stop(), h || (f(v), h = !0);
|
|
1332
1357
|
}
|
|
1333
1358
|
);
|
|
1334
1359
|
i = () => {
|
|
1335
|
-
|
|
1360
|
+
u(), l(), c(), n.destroy(), e.destroy();
|
|
1336
1361
|
};
|
|
1337
1362
|
},
|
|
1338
1363
|
/**
|
|
1339
1364
|
* should return all default values of the configuration
|
|
1340
1365
|
* @returns {ViewshedPluginOptions}
|
|
1341
1366
|
*/
|
|
1342
|
-
getDefaultOptions:
|
|
1367
|
+
getDefaultOptions: W,
|
|
1343
1368
|
/**
|
|
1344
1369
|
* should return the plugin's serialization excluding all default values
|
|
1345
1370
|
* @returns {ViewshedPluginOptions}
|
|
1346
1371
|
*/
|
|
1347
1372
|
toJSON() {
|
|
1348
1373
|
const t = {};
|
|
1349
|
-
return s.tools &&
|
|
1374
|
+
return s.tools && W().tools.length !== s.tools.length && (t.tools = [...s.tools]), s.shadowColor && s.shadowColor !== T.getDefaultOptions().shadowColor && (t.shadowColor = s.shadowColor), s.visibleColor && s.visibleColor !== T.getDefaultOptions().visibleColor && (t.visibleColor = s.visibleColor), t;
|
|
1350
1375
|
},
|
|
1351
1376
|
/**
|
|
1352
1377
|
* should return the plugins state
|
|
@@ -1364,7 +1389,7 @@ function Bt(s) {
|
|
|
1364
1389
|
* @returns {Array<import("@vcmap/ui").PluginConfigEditor>}
|
|
1365
1390
|
*/
|
|
1366
1391
|
getConfigEditors() {
|
|
1367
|
-
return [{ component:
|
|
1392
|
+
return [{ component: xt }];
|
|
1368
1393
|
},
|
|
1369
1394
|
destroy: i,
|
|
1370
1395
|
i18n: {
|
|
@@ -1440,5 +1465,5 @@ function Bt(s) {
|
|
|
1440
1465
|
};
|
|
1441
1466
|
}
|
|
1442
1467
|
export {
|
|
1443
|
-
|
|
1468
|
+
zt as default
|
|
1444
1469
|
};
|