@vcmap/viewshed 3.0.2 → 3.0.5
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 +9 -0
- package/dist/index.js +708 -687
- package/package.json +5 -5
- package/src/index.js +9 -4
- package/src/util/toolboxHelper.js +84 -52
- package/src/viewshedManager.js +10 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var de = (i,
|
|
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 Ie = Object.defineProperty;
|
|
2
|
+
var Pe = (i, e, o) => e in i ? Ie(i, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[e] = o;
|
|
3
|
+
var de = (i, e, o) => Pe(i, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { VcsCameraPrimitive as Ae, VcsObject as Re, VcsEvent as X, AbstractInteraction as Ne, EventType as Y, Projection as z, SessionType as De, CesiumMap as U, startEditFeaturesSession as ke, startEditGeometrySession as xe, VectorLayer as Le, wgs84Projection as Fe, maxZIndex as je, markVolatile as We, Viewpoint as Be, TransformationMode as Ue, Category as $e, moduleIdSymbol as He } from "../../../assets/core.js";
|
|
5
|
+
import { Color as ee, Matrix4 as ze, Transforms as Ge, Primitive as ce, GeometryInstance as ue, SphereGeometry as Ke, ColorGeometryInstanceAttribute as he, PerInstanceColorAppearance as fe, SphereOutlineGeometry as Ye, Math as k, Cartesian3 as W, ShadowMap as Xe, Camera as Je, HeightReference as Ze } from "../../../assets/cesium.js";
|
|
6
|
+
import { shallowRef as q, ref as $, nextTick as qe, inject as me, computed as ve, reactive as J, watchEffect as Qe, watch as G, onMounted as et, onUnmounted as tt, resolveComponent as b, openBlock as M, createElementBlock as B, createBlock as N, withCtx as h, createTextVNode as F, toDisplayString as A, createCommentVNode as H, createVNode as p, createElementVNode as it, Fragment as pe, renderList as we, mergeProps as ot } from "../../../assets/vue.js";
|
|
7
|
+
import { ol$Observable$unByKey as st, Feature as nt, ol$geom$Point as at, ol$style$Style as rt } from "../../../assets/ol.js";
|
|
8
|
+
import { VcsTextField as lt, VcsSlider as dt, VcsLabel as Ce, VcsFormSection as Ee, VcsSelect as ye, VcsFormButton as ct, VcsFeatureTransforms as ut, VcsHelp as ht, makeEditorCollectionComponentClass as ft, WindowSlot as mt, ToolboxType as ge, createSupportedMapMappingFunction as vt, createListExportAction as pt, downloadText as wt, createListImportAction as gt, NotificationType as Z, AbstractConfigEditor as _t } from "../../../assets/ui.js";
|
|
9
|
+
import { VContainer as Ve, VRow as be, VCol as Me, VDivider as Ct, VColorPicker as Et } from "../../../assets/vuetify.js";
|
|
10
|
+
const Te = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyString"), re = /* @__PURE__ */ new Map();
|
|
11
11
|
[
|
|
12
12
|
[String, "string"],
|
|
13
13
|
[Number, "number"],
|
|
@@ -15,31 +15,31 @@ const Me = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyStr
|
|
|
15
15
|
[Function, "function"],
|
|
16
16
|
[void 0, "undefined"],
|
|
17
17
|
[Symbol, "symbol"]
|
|
18
|
-
].forEach(([i,
|
|
19
|
-
|
|
18
|
+
].forEach(([i, e]) => {
|
|
19
|
+
re.set(i, e);
|
|
20
20
|
});
|
|
21
21
|
function bt(i) {
|
|
22
|
-
return i == null ? void 0 : i[
|
|
22
|
+
return i == null ? void 0 : i[Te];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function oe(i) {
|
|
25
25
|
if (!i || String(i) !== "[object Object]")
|
|
26
26
|
return !1;
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
27
|
+
const e = Object.getPrototypeOf(i);
|
|
28
|
+
if (!e)
|
|
29
29
|
return !0;
|
|
30
|
-
const
|
|
31
|
-
return typeof
|
|
30
|
+
const t = {}.hasOwnProperty.call(e, "constructor") && e.constructor;
|
|
31
|
+
return typeof t == "function" && String(t) === String(Object);
|
|
32
32
|
}
|
|
33
|
-
function R(i,
|
|
33
|
+
function R(i, e) {
|
|
34
34
|
if (i === null)
|
|
35
35
|
return "null";
|
|
36
36
|
if (typeof i > "u")
|
|
37
37
|
return "undefined";
|
|
38
|
-
if (
|
|
38
|
+
if (e)
|
|
39
39
|
return typeof i;
|
|
40
40
|
let o;
|
|
41
41
|
if (Array.isArray(i))
|
|
42
|
-
o = `[${i.map((s) => R(s,
|
|
42
|
+
o = `[${i.map((s) => R(s, e)).join(",")}]`;
|
|
43
43
|
else
|
|
44
44
|
try {
|
|
45
45
|
o = JSON.stringify(i);
|
|
@@ -48,162 +48,162 @@ function R(i, t) {
|
|
|
48
48
|
}
|
|
49
49
|
return o = o || typeof i, o.length > 20 ? `${o.substring(0, 20)}...` : o;
|
|
50
50
|
}
|
|
51
|
-
function Mt(i,
|
|
52
|
-
return typeof
|
|
51
|
+
function Mt(i, e) {
|
|
52
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? i === e ? !1 : `Expected ${R(i)} to equal ${e.toString()}` : null;
|
|
53
53
|
}
|
|
54
|
-
function Tt(i,
|
|
55
|
-
if (Array.isArray(
|
|
56
|
-
if (
|
|
54
|
+
function Tt(i, e, o) {
|
|
55
|
+
if (Array.isArray(e)) {
|
|
56
|
+
if (e.length !== 1)
|
|
57
57
|
throw new Error("Array patterns may only have one type");
|
|
58
58
|
if (Array.isArray(i)) {
|
|
59
|
-
let
|
|
60
|
-
return i.findIndex((n) => (
|
|
59
|
+
let t = !1;
|
|
60
|
+
return i.findIndex((n) => (t = o(n, e[0]), t)) > -1 ? `${String(t)} in ${R(i)}` : !1;
|
|
61
61
|
}
|
|
62
62
|
return `Expected ${R(i)} to be an Array`;
|
|
63
63
|
}
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const s =
|
|
68
|
-
if (!
|
|
66
|
+
function se(i, e, o, t) {
|
|
67
|
+
const s = t ? `${t}.` : "";
|
|
68
|
+
if (!oe(i))
|
|
69
69
|
return `Expected ${R(i)} to be a plain Object`;
|
|
70
|
-
let
|
|
71
|
-
const l = Object.keys(
|
|
72
|
-
const
|
|
73
|
-
return
|
|
70
|
+
let r = !1;
|
|
71
|
+
const l = Object.keys(e).find((w) => {
|
|
72
|
+
const c = i[w];
|
|
73
|
+
return oe(e[w]) ? r = se(c, e[w], o, s + w) : r = o(c, e[w]), r;
|
|
74
74
|
});
|
|
75
|
-
return l ? `${String(
|
|
75
|
+
return l ? `${String(r)} in object.${s}${l}` : !1;
|
|
76
76
|
}
|
|
77
|
-
function St(i,
|
|
78
|
-
if (
|
|
77
|
+
function St(i, e) {
|
|
78
|
+
if (e === Number)
|
|
79
79
|
return Number.isFinite(i) ? !1 : `expected ${R(i)} to be a number, excluding NaN`;
|
|
80
|
-
if (
|
|
80
|
+
if (e === yt)
|
|
81
81
|
return Number.isInteger(i) ? !1 : `expected ${R(i)} to be an integer number`;
|
|
82
|
-
if (
|
|
82
|
+
if (e === Vt)
|
|
83
83
|
return typeof i == "string" && i.length > 0 ? !1 : `expected ${R(i)} to be a non-empty string`;
|
|
84
|
-
const o =
|
|
84
|
+
const o = re.get(e);
|
|
85
85
|
return o ? typeof i === o ? !1 : `expected ${R(i)} to be a ${String(o)}` : null;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Se(i) {
|
|
88
88
|
if (i === null)
|
|
89
89
|
return "null";
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
90
|
+
const e = re.get(i);
|
|
91
|
+
if (e)
|
|
92
|
+
return e;
|
|
93
93
|
const o = i == null ? void 0 : i.className;
|
|
94
94
|
if (o)
|
|
95
95
|
return o;
|
|
96
|
-
let
|
|
97
|
-
const s =
|
|
96
|
+
let t = String(i);
|
|
97
|
+
const s = t.match(/function (.*)\(/);
|
|
98
98
|
if (s && s.length > 1) {
|
|
99
99
|
const n = i == null ? void 0 : i.name;
|
|
100
100
|
return n || s[1].substring(0, 20);
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
102
|
+
if (oe(i)) {
|
|
103
103
|
const n = {};
|
|
104
|
-
Object.keys(i).forEach((
|
|
105
|
-
n[
|
|
104
|
+
Object.keys(i).forEach((r) => {
|
|
105
|
+
n[r] = Se(i[r]);
|
|
106
106
|
});
|
|
107
107
|
try {
|
|
108
|
-
|
|
108
|
+
t = `Object of ${JSON.stringify(n)}`;
|
|
109
109
|
} catch {
|
|
110
|
-
|
|
110
|
+
t = "Object";
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return t;
|
|
114
114
|
}
|
|
115
|
-
function Ot(i,
|
|
116
|
-
const o = (
|
|
115
|
+
function Ot(i, e) {
|
|
116
|
+
const o = (t, s) => {
|
|
117
117
|
if (bt(s))
|
|
118
|
-
return s(
|
|
118
|
+
return s(t);
|
|
119
119
|
if (s == null)
|
|
120
|
-
return
|
|
121
|
-
const n = St(
|
|
120
|
+
return t === s ? !1 : `Expected ${R(t)} to be ${String(s)}`;
|
|
121
|
+
const n = St(t, s);
|
|
122
122
|
if (n !== null)
|
|
123
123
|
return n;
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
return
|
|
124
|
+
const r = Mt(t, s);
|
|
125
|
+
if (r !== null)
|
|
126
|
+
return r;
|
|
127
127
|
if (Array.isArray(s))
|
|
128
|
-
return Tt(
|
|
128
|
+
return Tt(t, s, o);
|
|
129
129
|
if (s === Object)
|
|
130
|
-
return
|
|
130
|
+
return se(t, {}, o);
|
|
131
131
|
if (s instanceof Function)
|
|
132
|
-
return
|
|
132
|
+
return t instanceof s ? !1 : `Expected ${R(t, !0)} to be of Type ${Se(s)}`;
|
|
133
133
|
if (typeof s == "object") {
|
|
134
|
-
const l =
|
|
134
|
+
const l = se(t, s, o);
|
|
135
135
|
return l || !1;
|
|
136
136
|
}
|
|
137
137
|
throw new Error(`Cannot handle pattern ${String(s)}`);
|
|
138
138
|
};
|
|
139
|
-
return o(i,
|
|
139
|
+
return o(i, e);
|
|
140
140
|
}
|
|
141
141
|
let It = Error;
|
|
142
|
-
function
|
|
143
|
-
const o = Ot(i,
|
|
142
|
+
function le(i, e) {
|
|
143
|
+
const o = Ot(i, e);
|
|
144
144
|
if (o)
|
|
145
145
|
throw new It(`Match failed: ${o}`);
|
|
146
146
|
}
|
|
147
147
|
function Pt(i) {
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
return o[
|
|
148
|
+
le(i, Object);
|
|
149
|
+
const e = Object.values(i), o = (t) => e.includes(t) ? !1 : `expected ${R(t)} to be of enum: ${e.join(", ")}`;
|
|
150
|
+
return o[Te] = !0, o;
|
|
151
151
|
}
|
|
152
|
-
function At(i,
|
|
152
|
+
function At(i, e, o) {
|
|
153
153
|
if (i != null) {
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
154
|
+
const t = Object.values(e).find((s) => s == i);
|
|
155
|
+
if (t != null)
|
|
156
|
+
return t;
|
|
157
157
|
}
|
|
158
158
|
return o;
|
|
159
159
|
}
|
|
160
|
-
const Rt = new
|
|
161
|
-
class Nt extends
|
|
162
|
-
constructor(
|
|
163
|
-
super(
|
|
160
|
+
const Rt = new ee(), te = new ze();
|
|
161
|
+
class Nt extends Ae {
|
|
162
|
+
constructor(e) {
|
|
163
|
+
super(e), this.spot = e.spot;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Updates the camera primitive.
|
|
167
167
|
* @param {unknown} frameState
|
|
168
168
|
*/
|
|
169
|
-
update(
|
|
169
|
+
update(e) {
|
|
170
170
|
if (this.show)
|
|
171
171
|
if (this.spot)
|
|
172
|
-
super.update(
|
|
172
|
+
super.update(e);
|
|
173
173
|
else {
|
|
174
|
-
const o = this._planesPrimitives,
|
|
175
|
-
o.length === 0 && (
|
|
174
|
+
const o = this._planesPrimitives, t = this._outlinePrimitives;
|
|
175
|
+
o.length === 0 && (Ge.eastNorthUpToFixedFrame(
|
|
176
176
|
this._camera.positionWC,
|
|
177
177
|
void 0,
|
|
178
|
-
|
|
178
|
+
te
|
|
179
179
|
), o[0] = new ce({
|
|
180
180
|
allowPicking: this.allowPicking,
|
|
181
181
|
geometryInstances: new ue({
|
|
182
|
-
geometry: new
|
|
182
|
+
geometry: new Ke({
|
|
183
183
|
radius: 2
|
|
184
184
|
}),
|
|
185
185
|
attributes: {
|
|
186
186
|
color: he.fromColor(
|
|
187
|
-
|
|
187
|
+
ee.fromAlpha(this._color, 0.1, Rt)
|
|
188
188
|
)
|
|
189
189
|
},
|
|
190
|
-
modelMatrix:
|
|
190
|
+
modelMatrix: te
|
|
191
191
|
}),
|
|
192
192
|
appearance: new fe({
|
|
193
193
|
translucent: !0,
|
|
194
194
|
flat: !0
|
|
195
195
|
}),
|
|
196
196
|
asynchronous: !1
|
|
197
|
-
}),
|
|
197
|
+
}), t[0] = new ce({
|
|
198
198
|
allowPicking: this.allowPicking,
|
|
199
199
|
geometryInstances: new ue({
|
|
200
|
-
geometry: new
|
|
200
|
+
geometry: new Ye({
|
|
201
201
|
radius: 2
|
|
202
202
|
}),
|
|
203
203
|
attributes: {
|
|
204
204
|
color: he.fromColor(this._color)
|
|
205
205
|
},
|
|
206
|
-
modelMatrix:
|
|
206
|
+
modelMatrix: te
|
|
207
207
|
}),
|
|
208
208
|
appearance: new fe({
|
|
209
209
|
translucent: !1,
|
|
@@ -213,22 +213,22 @@ class Nt extends Pe {
|
|
|
213
213
|
}));
|
|
214
214
|
const { length: s } = o;
|
|
215
215
|
for (let n = 0; n < s; ++n)
|
|
216
|
-
|
|
216
|
+
t[n].update(e), o[n].update(e);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const g = {
|
|
221
221
|
CONE: "cone",
|
|
222
222
|
THREESIXTY: "360"
|
|
223
223
|
};
|
|
224
|
-
function Dt(i,
|
|
225
|
-
const o = new
|
|
224
|
+
function Dt(i, e) {
|
|
225
|
+
const o = new Je(i), t = (
|
|
226
226
|
/** @type {import("@vcmap-cesium/engine").PerspectiveFrustum} */
|
|
227
227
|
o.frustum
|
|
228
228
|
);
|
|
229
|
-
return
|
|
229
|
+
return t.fov = e.fov, t.near = e.near, t.aspectRatio = e.aspectRatio, t.far = e.far, o;
|
|
230
230
|
}
|
|
231
|
-
const I = class I extends
|
|
231
|
+
const I = class I extends Re {
|
|
232
232
|
static get className() {
|
|
233
233
|
return "Viewshed";
|
|
234
234
|
}
|
|
@@ -257,34 +257,34 @@ const I = class I extends Ae {
|
|
|
257
257
|
/**
|
|
258
258
|
* @param {ViewshedOptions} options The options for the viewshed.
|
|
259
259
|
*/
|
|
260
|
-
constructor(
|
|
261
|
-
var o,
|
|
262
|
-
super(
|
|
263
|
-
fov: ((o =
|
|
264
|
-
far: ((
|
|
265
|
-
near: ((s =
|
|
266
|
-
aspectRatio: ((n =
|
|
267
|
-
}, this._headingPitchRollValues =
|
|
260
|
+
constructor(e) {
|
|
261
|
+
var o, t, s, n, r, l;
|
|
262
|
+
super(e), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
|
|
263
|
+
fov: ((o = e.frustumOptions) == null ? void 0 : o.fov) || I.getDefaultOptions().frustum.fov,
|
|
264
|
+
far: ((t = e.frustumOptions) == null ? void 0 : t.far) || I.getDefaultOptions().frustum.far,
|
|
265
|
+
near: ((s = e.frustumOptions) == null ? void 0 : s.near) || I.getDefaultOptions().frustum.near,
|
|
266
|
+
aspectRatio: ((n = e.frustumOptions) == null ? void 0 : n.aspectRatio) || I.getDefaultOptions().frustum.aspectRatio
|
|
267
|
+
}, this._headingPitchRollValues = e.orientation || {
|
|
268
268
|
...I.getDefaultOptions().orientation
|
|
269
|
-
}, this._position =
|
|
270
|
-
visibleColor:
|
|
271
|
-
((
|
|
269
|
+
}, this._position = e.position || I.getDefaultOptions().position, this._viewshedType = At(e.viewshedType, g), this._colors = {
|
|
270
|
+
visibleColor: ee.fromCssColorString(
|
|
271
|
+
((r = e.colorOptions) == null ? void 0 : r.visibleColor) || I.getDefaultOptions().visibleColor
|
|
272
272
|
),
|
|
273
|
-
shadowColor:
|
|
274
|
-
((l =
|
|
273
|
+
shadowColor: ee.fromCssColorString(
|
|
274
|
+
((l = e.colorOptions) == null ? void 0 : l.shadowColor) || I.getDefaultOptions().shadowColor
|
|
275
275
|
)
|
|
276
|
-
}, this._heightOffset =
|
|
276
|
+
}, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this._positionChanged = new X(), this._active = !1;
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
279
|
* 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.
|
|
280
280
|
* @param {import("ol/coordinate").Coordinate} coords The new positions coordinates in degrees
|
|
281
281
|
*/
|
|
282
|
-
set position(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
), this._shadowCamera.setView({ orientation: this._headingPitchRollValues }), this._updatePrimitive()), this._positionChanged.raiseEvent(
|
|
282
|
+
set position(e) {
|
|
283
|
+
le(e, [Number]), this._position = e, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
|
|
284
|
+
e[0],
|
|
285
|
+
e[1],
|
|
286
|
+
e[2] + this._heightOffset
|
|
287
|
+
), this._shadowCamera.setView({ orientation: this._headingPitchRollValues }), this._updatePrimitive()), this._positionChanged.raiseEvent(e);
|
|
288
288
|
}
|
|
289
289
|
/**
|
|
290
290
|
* @returns {import("ol/coordinate").Coordinate} The current position of the viewshed source.
|
|
@@ -303,11 +303,11 @@ const I = class I extends Ae {
|
|
|
303
303
|
* Sets the height offset of the viewshed.
|
|
304
304
|
* @param {number} value the offset that is added to the position height.
|
|
305
305
|
*/
|
|
306
|
-
set heightOffset(
|
|
307
|
-
this._heightOffset =
|
|
306
|
+
set heightOffset(e) {
|
|
307
|
+
this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
|
|
308
308
|
this.position[0],
|
|
309
309
|
this.position[1],
|
|
310
|
-
this.position[2] +
|
|
310
|
+
this.position[2] + e
|
|
311
311
|
), this._updatePrimitive());
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
@@ -321,8 +321,8 @@ const I = class I extends Ae {
|
|
|
321
321
|
* Sets the reach of the viewshed.
|
|
322
322
|
* @param {number} value The distance in meters.
|
|
323
323
|
*/
|
|
324
|
-
set distance(
|
|
325
|
-
this._frustumOptions.far =
|
|
324
|
+
set distance(e) {
|
|
325
|
+
this._frustumOptions.far = e > I.MIN_DISTANCE ? e : I.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === g.THREESIXTY && this._updateShadowMap(), this._viewshedType === g.CONE && this._updatePrimitive());
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
328
328
|
* Returns the reach of the viewshed.
|
|
@@ -335,8 +335,8 @@ const I = class I extends Ae {
|
|
|
335
335
|
* Sets the field of view of a cone viewshed. Does not have a impact on 360 viewshed.
|
|
336
336
|
* @param {number} value The field of view in degrees.
|
|
337
337
|
*/
|
|
338
|
-
set fov(
|
|
339
|
-
this._frustumOptions.fov =
|
|
338
|
+
set fov(e) {
|
|
339
|
+
this._frustumOptions.fov = e * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = e * k.RADIANS_PER_DEGREE, this._viewshedType === g.CONE && (this._updateShadowMap(), this._updatePrimitive()));
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
342
342
|
* Returns the field of view.
|
|
@@ -349,14 +349,14 @@ const I = class I extends Ae {
|
|
|
349
349
|
* Sets the heading of a cone viewshed. Does not have impact on 360 viewshed.
|
|
350
350
|
* @param {number} value Heading in degrees.
|
|
351
351
|
*/
|
|
352
|
-
set heading(
|
|
353
|
-
this._headingPitchRollValues.heading =
|
|
352
|
+
set heading(e) {
|
|
353
|
+
this._headingPitchRollValues.heading = e * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
|
|
354
354
|
orientation: {
|
|
355
|
-
heading:
|
|
355
|
+
heading: e * k.RADIANS_PER_DEGREE,
|
|
356
356
|
pitch: this._shadowCamera.pitch,
|
|
357
357
|
roll: 0
|
|
358
358
|
}
|
|
359
|
-
}), this._viewshedType ===
|
|
359
|
+
}), this._viewshedType === g.CONE && this._updatePrimitive());
|
|
360
360
|
}
|
|
361
361
|
/**
|
|
362
362
|
* Getter for the heading of a cone viewshed.
|
|
@@ -369,10 +369,10 @@ const I = class I extends Ae {
|
|
|
369
369
|
* Sets the pitch of a cone viewshed. 0 is horizontal. Does not have impact on 360 viewshed.
|
|
370
370
|
* @param {number} value The pitch in degrees.
|
|
371
371
|
*/
|
|
372
|
-
set pitch(
|
|
373
|
-
if (this._headingPitchRollValues.pitch =
|
|
374
|
-
const o =
|
|
375
|
-
this._shadowCamera.lookUp(o), this._viewshedType ===
|
|
372
|
+
set pitch(e) {
|
|
373
|
+
if (this._headingPitchRollValues.pitch = e * k.RADIANS_PER_DEGREE, this._shadowCamera) {
|
|
374
|
+
const o = e * k.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
|
|
375
|
+
this._shadowCamera.lookUp(o), this._viewshedType === g.CONE && this._updatePrimitive();
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
/**
|
|
@@ -386,8 +386,8 @@ const I = class I extends Ae {
|
|
|
386
386
|
* Sets whether the primitive of the viewshed should be shown or not.
|
|
387
387
|
* @param {boolean} value
|
|
388
388
|
*/
|
|
389
|
-
set showPrimitive(
|
|
390
|
-
this._showPrimitive =
|
|
389
|
+
set showPrimitive(e) {
|
|
390
|
+
this._showPrimitive = e, this._updatePrimitive();
|
|
391
391
|
}
|
|
392
392
|
/**
|
|
393
393
|
* Gets if the primitive of the viewshed is shown or not.
|
|
@@ -413,17 +413,17 @@ const I = class I extends Ae {
|
|
|
413
413
|
* Deactivates the viewshed by removing primitive and removing shadowMap.
|
|
414
414
|
*/
|
|
415
415
|
deactivate() {
|
|
416
|
-
var
|
|
417
|
-
this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (
|
|
416
|
+
var e;
|
|
417
|
+
this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (e = this._shadowMap) == null || e.destroy(), this._shadowCamera = null, this._scene = null, this._cesiumMap = null, this._shadowMap = null, this._active = !1);
|
|
418
418
|
}
|
|
419
419
|
/**
|
|
420
420
|
* Activates viewshed.
|
|
421
421
|
* @param {import("@vcmap/core").CesiumMap} cesiumMap The cesium map to which the shadow map of the viewshed is applied to.
|
|
422
422
|
*/
|
|
423
|
-
activate(
|
|
424
|
-
if (this._active || (this._active = !0),
|
|
425
|
-
this._cesiumMap =
|
|
426
|
-
const o =
|
|
423
|
+
activate(e) {
|
|
424
|
+
if (this._active || (this._active = !0), e !== this._cesiumMap) {
|
|
425
|
+
this._cesiumMap = e;
|
|
426
|
+
const o = e.getScene();
|
|
427
427
|
if (o)
|
|
428
428
|
this._shadowCamera = Dt(o, this._frustumOptions), this._position && (this.position = this._position), this._scene = o;
|
|
429
429
|
else
|
|
@@ -435,13 +435,13 @@ const I = class I extends Ae {
|
|
|
435
435
|
* Updates the shadow map by creating a new one and applying all the current parameters.
|
|
436
436
|
*/
|
|
437
437
|
_updateShadowMap() {
|
|
438
|
-
var
|
|
439
|
-
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((
|
|
438
|
+
var e;
|
|
439
|
+
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((e = this._shadowMap) == null || e.destroy(), this._shadowMap = new Xe({
|
|
440
440
|
// @ts-ignore
|
|
441
441
|
context: this._scene.context,
|
|
442
442
|
lightCamera: this._shadowCamera,
|
|
443
443
|
enabled: !0,
|
|
444
|
-
isPointLight: this._viewshedType ===
|
|
444
|
+
isPointLight: this._viewshedType === g.THREESIXTY,
|
|
445
445
|
softShadows: !0,
|
|
446
446
|
fromLightSource: !0,
|
|
447
447
|
cascadesEnabled: !1,
|
|
@@ -451,30 +451,30 @@ const I = class I extends Ae {
|
|
|
451
451
|
}), this._shadowMap.viewshed = this._colors, this._cesiumMap.setShadowMap(this._shadowMap));
|
|
452
452
|
}
|
|
453
453
|
_removePrimitive() {
|
|
454
|
-
var
|
|
455
|
-
this._primitive && !this._primitive.isDestroyed() && ((
|
|
454
|
+
var e;
|
|
455
|
+
this._primitive && !this._primitive.isDestroyed() && ((e = this._scene) == null || e.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
|
|
456
456
|
}
|
|
457
457
|
_updatePrimitive() {
|
|
458
458
|
this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new Nt({
|
|
459
459
|
camera: this._shadowCamera,
|
|
460
460
|
allowPicking: !1,
|
|
461
|
-
spot: this._viewshedType ===
|
|
461
|
+
spot: this._viewshedType === g.CONE
|
|
462
462
|
}), this._scene.primitives.add(this._primitive)) : this._removePrimitive();
|
|
463
463
|
}
|
|
464
464
|
/**
|
|
465
465
|
* Sets distance and, in case of cone viewsheds, also heading and pitch. Only works when viewshed is **active**.
|
|
466
466
|
* @param {number[]} target Point to calculate distance, heading and pitch from.
|
|
467
467
|
*/
|
|
468
|
-
lookAt(
|
|
468
|
+
lookAt(e) {
|
|
469
469
|
if (!this._shadowCamera)
|
|
470
470
|
return;
|
|
471
|
-
const o = W.fromDegrees(
|
|
472
|
-
if (this.distance = W.distance(this._shadowCamera.position, o), this.type ===
|
|
473
|
-
const
|
|
474
|
-
W.subtract(o, this._shadowCamera.position, o), W.normalize(o, o), W.normalize(this._shadowCamera.position,
|
|
471
|
+
const o = W.fromDegrees(e[0], e[1], e[2]);
|
|
472
|
+
if (this.distance = W.distance(this._shadowCamera.position, o), this.type === g.CONE && !o.equals(this._shadowCamera.position)) {
|
|
473
|
+
const t = new W();
|
|
474
|
+
W.subtract(o, this._shadowCamera.position, o), W.normalize(o, o), W.normalize(this._shadowCamera.position, t), this._shadowCamera.setView({
|
|
475
475
|
orientation: {
|
|
476
476
|
direction: o,
|
|
477
|
-
up:
|
|
477
|
+
up: t
|
|
478
478
|
}
|
|
479
479
|
}), this._headingPitchRollValues.heading = this._shadowCamera.heading, this._headingPitchRollValues.pitch = this._shadowCamera.pitch;
|
|
480
480
|
}
|
|
@@ -503,20 +503,20 @@ const I = class I extends Ae {
|
|
|
503
503
|
* Destroys the viewshed.
|
|
504
504
|
*/
|
|
505
505
|
destroy() {
|
|
506
|
-
var
|
|
507
|
-
const
|
|
508
|
-
this.deactivate(), ((
|
|
506
|
+
var t;
|
|
507
|
+
const e = this._cesiumMap, o = this._shadowMap;
|
|
508
|
+
this.deactivate(), ((t = e == null ? void 0 : e.getScene()) == null ? void 0 : t.shadowMap) === o && e.setDefaultShadowMap();
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
511
|
de(I, "MIN_DISTANCE", 10);
|
|
512
|
-
let
|
|
513
|
-
class
|
|
512
|
+
let D = I;
|
|
513
|
+
class kt extends Ne {
|
|
514
514
|
/**
|
|
515
515
|
*
|
|
516
516
|
* @param {import("./viewshed").default} viewshed
|
|
517
517
|
*/
|
|
518
|
-
constructor(
|
|
519
|
-
super(
|
|
518
|
+
constructor(e) {
|
|
519
|
+
super(Y.CLICKMOVE), this._viewshed = e, this._positioned = new X(), this._finished = new X(), this._position = !1, this.setActive();
|
|
520
520
|
}
|
|
521
521
|
get finished() {
|
|
522
522
|
return this._finished;
|
|
@@ -524,8 +524,8 @@ class xt extends Re {
|
|
|
524
524
|
get positioned() {
|
|
525
525
|
return this._positioned;
|
|
526
526
|
}
|
|
527
|
-
async pipe(
|
|
528
|
-
return
|
|
527
|
+
async pipe(e) {
|
|
528
|
+
return e.position && (this._position ? (this._viewshed.lookAt(z.mercatorToWgs84(e.position)), e.type & Y.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = z.mercatorToWgs84(e.position), e.type & Y.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
|
|
529
529
|
}
|
|
530
530
|
destroy() {
|
|
531
531
|
super.destroy(), this._finished.destroy(), this._positioned.destroy();
|
|
@@ -534,209 +534,210 @@ class xt extends Re {
|
|
|
534
534
|
const P = {
|
|
535
535
|
ABSOLUTE: "absolute",
|
|
536
536
|
RELATIVE: "relative"
|
|
537
|
-
},
|
|
537
|
+
}, E = {
|
|
538
538
|
CREATE: "create",
|
|
539
539
|
VIEW: "view",
|
|
540
540
|
EDIT: "edit",
|
|
541
541
|
MOVE: "move",
|
|
542
542
|
MULTI_SELECT: "multiSelect"
|
|
543
|
-
},
|
|
544
|
-
function
|
|
545
|
-
const
|
|
546
|
-
projection:
|
|
547
|
-
zIndex:
|
|
543
|
+
}, _e = 1.8;
|
|
544
|
+
function xt(i) {
|
|
545
|
+
const e = new Le({
|
|
546
|
+
projection: Fe.toJSON(),
|
|
547
|
+
zIndex: je - 1
|
|
548
548
|
});
|
|
549
|
-
|
|
550
|
-
const o = new
|
|
551
|
-
return o.setStyle(new
|
|
552
|
-
layer:
|
|
549
|
+
We(e), e.activate();
|
|
550
|
+
const o = new nt(new at(i));
|
|
551
|
+
return o.setStyle(new rt({})), e.addFeatures([o]), e.vectorProperties.altitudeMode = Ze.NONE, {
|
|
552
|
+
layer: e,
|
|
553
553
|
feature: o,
|
|
554
554
|
destroy() {
|
|
555
|
-
o.dispose(),
|
|
555
|
+
o.dispose(), e.destroy();
|
|
556
556
|
}
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
const o =
|
|
559
|
+
function ie(i, e) {
|
|
560
|
+
const o = e === P.ABSOLUTE ? Y.CLICKMOVE : Y.NONE;
|
|
561
561
|
i.setActive(o), i.pickPosition = o, i.pullPickedPosition = 1.8;
|
|
562
562
|
}
|
|
563
|
-
function Lt(i,
|
|
564
|
-
const
|
|
563
|
+
function Lt(i, e, o) {
|
|
564
|
+
const t = q(null), s = $(null), n = $(null), r = $(P.ABSOLUTE);
|
|
565
565
|
let l = () => {
|
|
566
566
|
};
|
|
567
|
-
const
|
|
568
|
-
let
|
|
567
|
+
const w = q(null), c = q([]);
|
|
568
|
+
let d = () => {
|
|
569
569
|
};
|
|
570
|
-
function
|
|
570
|
+
function f() {
|
|
571
571
|
var a;
|
|
572
|
-
s.value &&
|
|
572
|
+
s.value && t.value ? (t.value.deactivate(), o.setVisibility(t.value.name, !1)) : (a = t.value) == null || a.destroy();
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
|
|
574
|
+
function m(a = !0) {
|
|
575
|
+
d(), l(), f(), t.value = null, a && o.clearSelection(), s.value = null, n.value = null;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
579
|
-
var
|
|
580
|
-
|
|
577
|
+
function _(a) {
|
|
578
|
+
d(), f(), i.maps.activeMap instanceof U && (t.value = a, a.activate(i.maps.activeMap), d = i.maps.activeMap.shadowMapChanged.addEventListener((v) => {
|
|
579
|
+
var u;
|
|
580
|
+
v !== ((u = t.value) == null ? void 0 : u.shadowMap) && m(!1);
|
|
581
581
|
}));
|
|
582
582
|
}
|
|
583
|
-
async function
|
|
584
|
-
|
|
585
|
-
const { eventHandler:
|
|
583
|
+
async function y(a) {
|
|
584
|
+
m(), await qe();
|
|
585
|
+
const { eventHandler: v } = i.maps, { featureInteraction: u } = v, C = new D({
|
|
586
586
|
viewshedType: a,
|
|
587
587
|
colorOptions: {
|
|
588
|
-
visibleColor:
|
|
589
|
-
shadowColor:
|
|
588
|
+
visibleColor: e.visibleColor,
|
|
589
|
+
shadowColor: e.shadowColor
|
|
590
590
|
},
|
|
591
|
-
heightOffset:
|
|
591
|
+
heightOffset: r.value === P.ABSOLUTE ? 0 : _e
|
|
592
592
|
});
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
l(),
|
|
593
|
+
_(C);
|
|
594
|
+
const V = new kt(t.value);
|
|
595
|
+
V.finished.addEventListener(() => {
|
|
596
|
+
l(), t.value ? (t.value.showPrimitive = !0, n.value = E.EDIT) : m();
|
|
597
597
|
});
|
|
598
|
-
const
|
|
599
|
-
|
|
598
|
+
const O = v.addExclusiveInteraction(
|
|
599
|
+
V,
|
|
600
600
|
() => {
|
|
601
|
-
|
|
601
|
+
V.destroy();
|
|
602
602
|
}
|
|
603
603
|
);
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
ie(u, r.value), V.positioned.addEventListener(() => {
|
|
605
|
+
ie(u, P.ABSOLUTE);
|
|
606
606
|
}), l = () => {
|
|
607
|
-
|
|
607
|
+
O(), V.destroy(), u.setActive(), l = () => {
|
|
608
608
|
};
|
|
609
|
-
}, n.value =
|
|
609
|
+
}, n.value = E.CREATE;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
var
|
|
613
|
-
if (
|
|
611
|
+
function x(a) {
|
|
612
|
+
var v;
|
|
613
|
+
if (t.value && a) {
|
|
614
614
|
l();
|
|
615
615
|
const {
|
|
616
|
-
layer:
|
|
617
|
-
feature:
|
|
618
|
-
destroy:
|
|
619
|
-
} =
|
|
620
|
-
i.layers.add(
|
|
616
|
+
layer: u,
|
|
617
|
+
feature: C,
|
|
618
|
+
destroy: V
|
|
619
|
+
} = xt(t.value.position);
|
|
620
|
+
i.layers.add(u), c.value = [C], r.value === P.ABSOLUTE ? (w.value = ke(i, u), w.value.setFeatures([C])) : (w.value = xe(i, u), w.value.setFeature(C)), w.value.stopped.addEventListener(() => {
|
|
621
621
|
l();
|
|
622
622
|
});
|
|
623
|
-
const
|
|
624
|
-
|
|
623
|
+
const O = (v = C.getGeometry()) == null ? void 0 : v.on("change", () => {
|
|
624
|
+
t.value ? t.value.position = z.mercatorToWgs84(
|
|
625
625
|
/** @type {import("ol/geom").Point} */
|
|
626
|
-
|
|
627
|
-
) :
|
|
626
|
+
C.getGeometry().getCoordinates()
|
|
627
|
+
) : m();
|
|
628
628
|
});
|
|
629
|
-
n.value =
|
|
630
|
-
var
|
|
629
|
+
n.value = E.MOVE, l = () => {
|
|
630
|
+
var K;
|
|
631
631
|
l = () => {
|
|
632
|
-
},
|
|
632
|
+
}, O && st(O), (K = w.value) == null || K.stop(), w.value = null, c.value = [], i.layers.remove(u), V(), n.value = E.EDIT;
|
|
633
633
|
};
|
|
634
634
|
} else
|
|
635
635
|
l();
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
l(),
|
|
637
|
+
function S(a, v) {
|
|
638
|
+
l(), t.value !== v && (_(v), r.value = v.heightOffset ? P.RELATIVE : P.ABSOLUTE), s.value = !!v.properties.title, n.value = a, s.value && o.setVisibility(v.name, !0);
|
|
639
639
|
}
|
|
640
|
-
const
|
|
640
|
+
const L = [
|
|
641
641
|
o.collectionComponent.collection.removed.addEventListener(
|
|
642
642
|
(a) => {
|
|
643
|
-
var
|
|
644
|
-
o.remove(a.name), ((
|
|
643
|
+
var v;
|
|
644
|
+
o.remove(a.name), ((v = t.value) == null ? void 0 : v.name) === a.name && m();
|
|
645
645
|
}
|
|
646
646
|
),
|
|
647
|
-
o.renamed.addEventListener(({ item: a, title:
|
|
648
|
-
var
|
|
649
|
-
const
|
|
647
|
+
o.renamed.addEventListener(({ item: a, title: v }) => {
|
|
648
|
+
var C;
|
|
649
|
+
const u = i.windowManager.get(
|
|
650
650
|
`${o.collectionComponent.id}-editor`
|
|
651
651
|
);
|
|
652
|
-
|
|
652
|
+
u && ((C = t.value) == null ? void 0 : C.name) === a.name && (u.state.headerTitle = v);
|
|
653
653
|
}),
|
|
654
654
|
o.visibilityChanged.addEventListener((a) => {
|
|
655
|
-
var
|
|
656
|
-
const
|
|
657
|
-
|
|
655
|
+
var u;
|
|
656
|
+
const v = ((u = t.value) == null ? void 0 : u.name) === a.name;
|
|
657
|
+
v ? m() : (S(E.VIEW, a), o.clearSelection()), o.setVisibility(a.name, !v);
|
|
658
658
|
})
|
|
659
659
|
];
|
|
660
|
-
function
|
|
661
|
-
if (!(a ===
|
|
662
|
-
if (
|
|
663
|
-
|
|
660
|
+
function T(a) {
|
|
661
|
+
if (!(a === r.value || !t.value)) {
|
|
662
|
+
if (r.value = a, n.value === E.MOVE && l(), n.value === E.CREATE)
|
|
663
|
+
ie(
|
|
664
664
|
i.maps.eventHandler.featureInteraction,
|
|
665
665
|
a
|
|
666
|
-
),
|
|
667
|
-
else if (n.value ===
|
|
668
|
-
const { position:
|
|
669
|
-
a === P.RELATIVE ? i.maps.activeMap.getHeightFromTerrain([z.wgs84ToMercator(
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
}) : (
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
],
|
|
666
|
+
), t.value.heightOffset = a === P.ABSOLUTE ? 0 : _e;
|
|
667
|
+
else if (n.value === E.EDIT) {
|
|
668
|
+
const { position: v, heightOffset: u } = t.value;
|
|
669
|
+
a === P.RELATIVE ? i.maps.activeMap.getHeightFromTerrain([z.wgs84ToMercator(v)]).then((C) => {
|
|
670
|
+
const V = z.mercatorToWgs84(C[0]);
|
|
671
|
+
t.value && (t.value.heightOffset = v[2] - V[2], t.value.position = V);
|
|
672
|
+
}) : (t.value.position = [
|
|
673
|
+
v[0],
|
|
674
|
+
v[1],
|
|
675
|
+
v[2] + u
|
|
676
|
+
], t.value.heightOffset = 0);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
return {
|
|
681
|
-
currentViewshed:
|
|
681
|
+
currentViewshed: t,
|
|
682
682
|
currentIsPersisted: s,
|
|
683
|
-
currentEditSession:
|
|
684
|
-
|
|
683
|
+
currentEditSession: w,
|
|
684
|
+
currentFeatures: c,
|
|
685
|
+
createViewshed: y,
|
|
685
686
|
viewViewshed(a) {
|
|
686
|
-
|
|
687
|
+
S(E.VIEW, a);
|
|
687
688
|
},
|
|
688
689
|
editViewshed(a) {
|
|
689
|
-
|
|
690
|
+
S(E.EDIT, a), s.value && (o.setSelection(a.name), o.collectionComponent.openEditorWindow(a));
|
|
690
691
|
},
|
|
691
692
|
persistCurrent() {
|
|
692
|
-
|
|
693
|
+
t.value && (o.add(t.value), s.value = !0, o.setSelection(t.value.name), o.setVisibility(t.value.name, !0));
|
|
693
694
|
},
|
|
694
|
-
moveCurrentViewshed:
|
|
695
|
+
moveCurrentViewshed: x,
|
|
695
696
|
setupMultiSelect() {
|
|
696
|
-
l(), n.value =
|
|
697
|
+
l(), n.value = E.MULTI_SELECT, f(), t.value = null;
|
|
697
698
|
},
|
|
698
699
|
mode: n,
|
|
699
|
-
heightMode:
|
|
700
|
-
changeHeightMode:
|
|
700
|
+
heightMode: r,
|
|
701
|
+
changeHeightMode: T,
|
|
701
702
|
async placeCurrentFeaturesOnTerrain() {
|
|
702
|
-
var a,
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
z.wgs84ToMercator((
|
|
706
|
-
]))[0][2] -
|
|
707
|
-
|
|
703
|
+
var a, v;
|
|
704
|
+
if (t.value && ((a = w.value) == null ? void 0 : a.type) === De.EDIT_FEATURES && i.maps.activeMap instanceof U) {
|
|
705
|
+
const C = (await i.maps.activeMap.getHeightFromTerrain([
|
|
706
|
+
z.wgs84ToMercator((v = t.value) == null ? void 0 : v.position)
|
|
707
|
+
]))[0][2] - t.value.position[2];
|
|
708
|
+
w.value.translate(0, 0, C);
|
|
708
709
|
}
|
|
709
710
|
},
|
|
710
|
-
stop:
|
|
711
|
+
stop: m,
|
|
711
712
|
destroy() {
|
|
712
|
-
|
|
713
|
+
m(), L.forEach((a) => a());
|
|
713
714
|
}
|
|
714
715
|
};
|
|
715
716
|
}
|
|
716
|
-
const
|
|
717
|
+
const Oe = (i, e) => {
|
|
717
718
|
const o = i.__vccOpts || i;
|
|
718
|
-
for (const [
|
|
719
|
-
o[
|
|
719
|
+
for (const [t, s] of e)
|
|
720
|
+
o[t] = s;
|
|
720
721
|
return o;
|
|
721
722
|
}, Ft = {
|
|
722
|
-
distance: [
|
|
723
|
+
distance: [D.MIN_DISTANCE, 2e3],
|
|
723
724
|
fov: [25, 85],
|
|
724
725
|
heading: [0, 360],
|
|
725
726
|
pitch: [-90, 90]
|
|
726
727
|
}, jt = {
|
|
727
728
|
components: {
|
|
728
|
-
VcsTextField:
|
|
729
|
-
VContainer:
|
|
730
|
-
VRow:
|
|
731
|
-
VCol:
|
|
732
|
-
VcsSlider:
|
|
733
|
-
VcsLabel:
|
|
734
|
-
VcsFormSection:
|
|
729
|
+
VcsTextField: lt,
|
|
730
|
+
VContainer: Ve,
|
|
731
|
+
VRow: be,
|
|
732
|
+
VCol: Me,
|
|
733
|
+
VcsSlider: dt,
|
|
734
|
+
VcsLabel: Ce,
|
|
735
|
+
VcsFormSection: Ee,
|
|
735
736
|
VDivider: Ct,
|
|
736
|
-
VcsSelect:
|
|
737
|
-
VcsFormButton:
|
|
738
|
-
VcsFeatureTransforms:
|
|
739
|
-
VcsHelp:
|
|
737
|
+
VcsSelect: ye,
|
|
738
|
+
VcsFormButton: ct,
|
|
739
|
+
VcsFeatureTransforms: ut,
|
|
740
|
+
VcsHelp: ht
|
|
740
741
|
},
|
|
741
742
|
name: "ViewshedWindow",
|
|
742
743
|
props: {
|
|
@@ -752,164 +753,164 @@ const Se = (i, t) => {
|
|
|
752
753
|
}
|
|
753
754
|
},
|
|
754
755
|
setup(i) {
|
|
755
|
-
var
|
|
756
|
-
const
|
|
756
|
+
var v;
|
|
757
|
+
const e = (
|
|
757
758
|
/** @type {import("./viewshedManager.js").ViewshedManager} */
|
|
758
759
|
me("manager")
|
|
759
760
|
), o = (
|
|
760
761
|
/** @type {import("@vcmap/ui").VcsUiApp} */
|
|
761
762
|
me("vcsApp")
|
|
762
763
|
), {
|
|
763
|
-
currentViewshed:
|
|
764
|
+
currentViewshed: t,
|
|
764
765
|
mode: s,
|
|
765
766
|
currentIsPersisted: n
|
|
766
|
-
} =
|
|
767
|
-
((
|
|
767
|
+
} = e, r = $(
|
|
768
|
+
((v = o.maps.activeMap) == null ? void 0 : v.movementApiCallsDisabled) ?? !1
|
|
768
769
|
);
|
|
769
770
|
let l = () => {
|
|
770
771
|
};
|
|
771
|
-
const
|
|
772
|
-
let
|
|
772
|
+
const w = ve(() => i.selection);
|
|
773
|
+
let c = () => {
|
|
773
774
|
};
|
|
774
|
-
const
|
|
775
|
+
const d = J({
|
|
775
776
|
X: void 0,
|
|
776
777
|
Y: void 0,
|
|
777
778
|
Z: void 0
|
|
778
|
-
}),
|
|
779
|
-
let
|
|
779
|
+
}), f = q();
|
|
780
|
+
let m = () => {
|
|
780
781
|
};
|
|
781
|
-
const
|
|
782
|
+
const _ = J({
|
|
782
783
|
showPrimitive: !1,
|
|
783
784
|
distance: void 0,
|
|
784
785
|
fov: void 0,
|
|
785
786
|
heading: void 0,
|
|
786
787
|
pitch: void 0
|
|
787
|
-
}),
|
|
788
|
-
function
|
|
789
|
-
|
|
788
|
+
}), y = $();
|
|
789
|
+
function x() {
|
|
790
|
+
t.value && (d.X = t.value.position[0], d.Y = t.value.position[1], d.Z = e.heightMode.value === P.ABSOLUTE ? t.value.position[2] : t.value.heightOffset);
|
|
790
791
|
}
|
|
791
792
|
function S() {
|
|
792
|
-
|
|
793
|
+
x(), t.value && (_.distance = t.value.distance, _.fov = t.value.fov, _.heading = t.value.heading, _.pitch = t.value.pitch, _.showPrimitive = t.value.showPrimitive, y.value = t.value.type);
|
|
793
794
|
}
|
|
794
|
-
|
|
795
|
-
|
|
795
|
+
Qe(() => {
|
|
796
|
+
t.value && s.value !== E.CREATE && S();
|
|
796
797
|
}), G(
|
|
797
|
-
|
|
798
|
+
t,
|
|
798
799
|
() => {
|
|
799
|
-
|
|
800
|
-
|
|
800
|
+
t.value && (c(), c = t.value.positionChanged.addEventListener(() => {
|
|
801
|
+
x(), m();
|
|
801
802
|
}));
|
|
802
803
|
},
|
|
803
804
|
{ immediate: !0 }
|
|
804
805
|
);
|
|
805
806
|
async function L() {
|
|
806
|
-
var
|
|
807
|
-
(
|
|
808
|
-
const
|
|
807
|
+
var V, O;
|
|
808
|
+
(V = t.value) == null || V.deactivate();
|
|
809
|
+
const u = (
|
|
809
810
|
/** @type {import("@vcmap/core").CesiumMap} */
|
|
810
811
|
(O = o.maps.activeMap.getScene()) == null ? void 0 : O.camera
|
|
811
|
-
),
|
|
812
|
-
|
|
812
|
+
), C = u == null ? void 0 : u.changed.addEventListener(() => {
|
|
813
|
+
m();
|
|
813
814
|
});
|
|
814
|
-
|
|
815
|
-
var
|
|
816
|
-
|
|
815
|
+
m = () => {
|
|
816
|
+
var K;
|
|
817
|
+
C == null || C(), f.value = null, (K = t.value) == null || K.activate(o.maps.activeMap), m = () => {
|
|
817
818
|
};
|
|
818
819
|
};
|
|
819
820
|
}
|
|
820
|
-
|
|
821
|
-
var
|
|
822
|
-
const
|
|
823
|
-
|
|
821
|
+
et(() => {
|
|
822
|
+
var C, V;
|
|
823
|
+
const u = (C = i.getViewshed) == null ? void 0 : C.call(i);
|
|
824
|
+
u && e.editViewshed(u), l = (V = o.maps.activeMap) == null ? void 0 : V.movementDisabledChanged.addEventListener(
|
|
824
825
|
(O) => {
|
|
825
|
-
|
|
826
|
+
r.value = O.apiCalls;
|
|
826
827
|
}
|
|
827
828
|
);
|
|
828
|
-
}),
|
|
829
|
-
|
|
829
|
+
}), tt(() => {
|
|
830
|
+
c(), m(), l(), n.value || ((s.value === E.EDIT || s.value === E.MOVE) && t.value ? e.viewViewshed(t.value) : s.value === E.CREATE && e.stop()), w.value && (w.value.length > 1 ? e.setupMultiSelect() : w.value.length === 1 && t.value ? e.viewViewshed(t.value) : (
|
|
830
831
|
// when a persited viewshed is deselected, stops plugin
|
|
831
|
-
!
|
|
832
|
+
!w.value.length && s.value === E.EDIT && e.stop(!1)
|
|
832
833
|
));
|
|
833
834
|
}), S();
|
|
834
|
-
function
|
|
835
|
-
|
|
835
|
+
function T(u, C) {
|
|
836
|
+
m(), t.value && (_[u] = C, t.value[u] = C);
|
|
836
837
|
}
|
|
837
|
-
const
|
|
838
|
-
const
|
|
839
|
-
return
|
|
838
|
+
const a = ve(() => {
|
|
839
|
+
const u = [];
|
|
840
|
+
return y.value === g.CONE && u.push({
|
|
840
841
|
name: "jumpToViewpoint",
|
|
841
|
-
title:
|
|
842
|
+
title: f.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
|
|
842
843
|
icon: "mdi-human-male",
|
|
843
|
-
active: !!
|
|
844
|
-
disabled:
|
|
844
|
+
active: !!f.value,
|
|
845
|
+
disabled: r.value,
|
|
845
846
|
async callback() {
|
|
846
|
-
var
|
|
847
|
-
|
|
848
|
-
new
|
|
847
|
+
var C, V, O;
|
|
848
|
+
e.moveCurrentViewshed(!1), t.value && !f.value ? (f.value = await ((C = o.maps.activeMap) == null ? void 0 : C.getViewpoint()), await ((V = o.maps.activeMap) == null ? void 0 : V.gotoViewpoint(
|
|
849
|
+
new Be({
|
|
849
850
|
groundPosition: [
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
851
|
+
t.value.position[0],
|
|
852
|
+
t.value.position[1],
|
|
853
|
+
t.value.position[2] + t.value.heightOffset
|
|
853
854
|
],
|
|
854
|
-
heading:
|
|
855
|
-
pitch:
|
|
855
|
+
heading: t.value.heading,
|
|
856
|
+
pitch: t.value.pitch,
|
|
856
857
|
distance: 0,
|
|
857
858
|
animate: !0
|
|
858
859
|
// if not animate, async does not work and the cameraChanged listener is triggered immediately. alternatively set timeout
|
|
859
860
|
})
|
|
860
|
-
)), L()) :
|
|
861
|
+
)), L()) : f.value && ((O = o.maps.activeMap) == null || O.gotoViewpoint(f.value), m());
|
|
861
862
|
}
|
|
862
|
-
}),
|
|
863
|
+
}), u.push({
|
|
863
864
|
name: "moveViewshed",
|
|
864
865
|
title: "viewshed.move",
|
|
865
|
-
icon:
|
|
866
|
-
active: s.value ===
|
|
866
|
+
icon: e.heightMode.value === P.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
|
|
867
|
+
active: s.value === E.MOVE,
|
|
867
868
|
callback() {
|
|
868
|
-
|
|
869
|
-
s.value !==
|
|
869
|
+
e.moveCurrentViewshed(
|
|
870
|
+
s.value !== E.MOVE
|
|
870
871
|
);
|
|
871
872
|
}
|
|
872
|
-
}),
|
|
873
|
+
}), u.unshift({
|
|
873
874
|
name: "showPrimitive",
|
|
874
875
|
title: "viewshed.showPrimitive",
|
|
875
876
|
icon: "mdi-eye",
|
|
876
|
-
active:
|
|
877
|
+
active: _.showPrimitive,
|
|
877
878
|
callback() {
|
|
878
|
-
this.active = !this.active,
|
|
879
|
+
this.active = !this.active, T("showPrimitive", this.active);
|
|
879
880
|
}
|
|
880
|
-
}),
|
|
881
|
+
}), u;
|
|
881
882
|
});
|
|
882
883
|
return {
|
|
883
|
-
position:
|
|
884
|
-
setPosition(
|
|
885
|
-
if (
|
|
886
|
-
if (
|
|
887
|
-
|
|
884
|
+
position: d,
|
|
885
|
+
setPosition(u, C, V) {
|
|
886
|
+
if (m(), !!t.value) {
|
|
887
|
+
if (V === 2 && e.heightMode.value === P.RELATIVE)
|
|
888
|
+
t.value.heightOffset = Number(u);
|
|
888
889
|
else {
|
|
889
|
-
const O = [...
|
|
890
|
-
O[
|
|
890
|
+
const O = [...t.value.position];
|
|
891
|
+
O[V] = Number(u), t.value.position = O;
|
|
891
892
|
}
|
|
892
|
-
|
|
893
|
+
d[C] = Number(u);
|
|
893
894
|
}
|
|
894
895
|
},
|
|
895
|
-
parameters:
|
|
896
|
-
setParameter:
|
|
896
|
+
parameters: _,
|
|
897
|
+
setParameter: T,
|
|
897
898
|
parameterRanges: Ft,
|
|
898
|
-
ViewshedPluginModes:
|
|
899
|
+
ViewshedPluginModes: E,
|
|
899
900
|
viewshedMode: s,
|
|
900
901
|
currentIsPersisted: n,
|
|
901
|
-
viewshedType:
|
|
902
|
-
ViewshedTypes:
|
|
902
|
+
viewshedType: y,
|
|
903
|
+
ViewshedTypes: g,
|
|
903
904
|
HeightModes: P,
|
|
904
|
-
heightMode:
|
|
905
|
-
TransformationMode:
|
|
906
|
-
changeHeightMode:
|
|
905
|
+
heightMode: e.heightMode,
|
|
906
|
+
TransformationMode: Ue,
|
|
907
|
+
changeHeightMode: e.changeHeightMode,
|
|
907
908
|
async createNewViewshed() {
|
|
908
|
-
await
|
|
909
|
+
await e.createViewshed(y.value);
|
|
909
910
|
},
|
|
910
|
-
addToMyWorkspace: () =>
|
|
911
|
-
cancel: () =>
|
|
912
|
-
headerActions:
|
|
911
|
+
addToMyWorkspace: () => e.persistCurrent(),
|
|
912
|
+
cancel: () => e.stop(),
|
|
913
|
+
headerActions: a
|
|
913
914
|
};
|
|
914
915
|
}
|
|
915
916
|
}, Wt = { key: 0 }, Bt = { class: "px-1 py-0" }, Ut = { key: 0 }, $t = { key: 1 }, Ht = {
|
|
@@ -919,12 +920,12 @@ const Se = (i, t) => {
|
|
|
919
920
|
key: 4,
|
|
920
921
|
class: "d-flex w-full justify-end px-2 pt-2 pb-1"
|
|
921
922
|
};
|
|
922
|
-
function Gt(i,
|
|
923
|
-
const
|
|
923
|
+
function Gt(i, e, o, t, s, n) {
|
|
924
|
+
const r = b("VcsHelp"), l = b("v-row"), w = b("VcsFeatureTransforms"), c = b("VcsTextField"), d = b("v-col"), f = b("v-container"), m = b("VcsFormSection"), _ = b("v-divider"), y = b("VcsLabel"), x = b("VcsSelect"), S = b("VcsSlider"), L = b("VcsFormButton");
|
|
924
925
|
return M(), B("div", null, [
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
default:
|
|
926
|
+
t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", Wt, [
|
|
927
|
+
t.viewshedType === t.ViewshedTypes.CONE ? (M(), N(r, { key: 0 }, {
|
|
928
|
+
default: h(() => [
|
|
928
929
|
F(
|
|
929
930
|
A(i.$t("viewshed.createDescription")),
|
|
930
931
|
1
|
|
@@ -933,8 +934,8 @@ function Gt(i, t, o, e, s, n) {
|
|
|
933
934
|
]),
|
|
934
935
|
_: 1
|
|
935
936
|
/* STABLE */
|
|
936
|
-
})) :
|
|
937
|
-
default:
|
|
937
|
+
})) : t.viewshedType === t.ViewshedTypes.THREESIXTY ? (M(), N(r, { key: 1 }, {
|
|
938
|
+
default: h(() => [
|
|
938
939
|
F(
|
|
939
940
|
A(i.$t("viewshed.createThreeSixtyDescription")),
|
|
940
941
|
1
|
|
@@ -944,18 +945,18 @@ function Gt(i, t, o, e, s, n) {
|
|
|
944
945
|
_: 1
|
|
945
946
|
/* STABLE */
|
|
946
947
|
})) : H("v-if", !0)
|
|
947
|
-
])) :
|
|
948
|
+
])) : t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(m, {
|
|
948
949
|
key: 1,
|
|
949
|
-
"header-actions":
|
|
950
|
+
"header-actions": t.headerActions,
|
|
950
951
|
heading: "viewshed.viewpoint",
|
|
951
952
|
"action-button-list-overflow-count": 3
|
|
952
953
|
}, {
|
|
953
|
-
default:
|
|
954
|
-
|
|
955
|
-
default:
|
|
956
|
-
|
|
957
|
-
default:
|
|
958
|
-
|
|
954
|
+
default: h(() => [
|
|
955
|
+
p(f, { class: "px-1 py-0" }, {
|
|
956
|
+
default: h(() => [
|
|
957
|
+
p(l, { "no-gutters": "" }, {
|
|
958
|
+
default: h(() => [
|
|
959
|
+
it(
|
|
959
960
|
"span",
|
|
960
961
|
Bt,
|
|
961
962
|
A(i.$t("viewshed.position")),
|
|
@@ -966,13 +967,13 @@ function Gt(i, t, o, e, s, n) {
|
|
|
966
967
|
_: 1
|
|
967
968
|
/* STABLE */
|
|
968
969
|
}),
|
|
969
|
-
|
|
970
|
+
t.viewshedMode === t.ViewshedPluginModes.MOVE && t.heightMode === t.HeightModes.ABSOLUTE ? (M(), N(l, {
|
|
970
971
|
key: 0,
|
|
971
972
|
"no-gutters": ""
|
|
972
973
|
}, {
|
|
973
|
-
default:
|
|
974
|
-
|
|
975
|
-
"transformation-mode":
|
|
974
|
+
default: h(() => [
|
|
975
|
+
p(w, {
|
|
976
|
+
"transformation-mode": t.TransformationMode.TRANSLATE,
|
|
976
977
|
"feature-properties": { altitudeMode: "absolute" },
|
|
977
978
|
"allow-z-input": !0,
|
|
978
979
|
class: "w-100"
|
|
@@ -980,31 +981,31 @@ function Gt(i, t, o, e, s, n) {
|
|
|
980
981
|
]),
|
|
981
982
|
_: 1
|
|
982
983
|
/* STABLE */
|
|
983
|
-
})) : (M(),
|
|
984
|
+
})) : (M(), N(l, {
|
|
984
985
|
key: 1,
|
|
985
986
|
"no-gutters": ""
|
|
986
987
|
}, {
|
|
987
|
-
default:
|
|
988
|
+
default: h(() => [
|
|
988
989
|
(M(!0), B(
|
|
989
990
|
pe,
|
|
990
991
|
null,
|
|
991
|
-
we(
|
|
992
|
-
|
|
992
|
+
we(t.position, (T, a, v) => (M(), N(
|
|
993
|
+
d,
|
|
993
994
|
{
|
|
994
|
-
key:
|
|
995
|
+
key: v,
|
|
995
996
|
class: "pb-1"
|
|
996
997
|
},
|
|
997
998
|
{
|
|
998
|
-
default:
|
|
999
|
-
|
|
1000
|
-
"model-value":
|
|
1001
|
-
"onUpdate:modelValue": (
|
|
999
|
+
default: h(() => [
|
|
1000
|
+
p(c, {
|
|
1001
|
+
"model-value": T,
|
|
1002
|
+
"onUpdate:modelValue": (u) => t.setPosition(u, a, v),
|
|
1002
1003
|
type: "number",
|
|
1003
|
-
prefix:
|
|
1004
|
-
step:
|
|
1005
|
-
unit:
|
|
1006
|
-
decimals:
|
|
1007
|
-
disabled:
|
|
1004
|
+
prefix: a,
|
|
1005
|
+
step: a === "Z" ? 1 : 1e-4,
|
|
1006
|
+
unit: a === "Z" ? "m" : "°",
|
|
1007
|
+
decimals: a === "Z" ? 2 : 8,
|
|
1008
|
+
disabled: t.viewshedMode === t.ViewshedPluginModes.MOVE && !(a === "Z" && t.heightMode === t.HeightModes.RELATIVE),
|
|
1008
1009
|
"hide-spin-buttons": !0
|
|
1009
1010
|
}, null, 8, ["model-value", "onUpdate:modelValue", "prefix", "step", "unit", "decimals", "disabled"])
|
|
1010
1011
|
]),
|
|
@@ -1029,15 +1030,15 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1029
1030
|
_: 1
|
|
1030
1031
|
/* STABLE */
|
|
1031
1032
|
}, 8, ["header-actions"])) : H("v-if", !0),
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
default:
|
|
1035
|
-
|
|
1036
|
-
default:
|
|
1037
|
-
|
|
1038
|
-
default:
|
|
1039
|
-
|
|
1040
|
-
default:
|
|
1033
|
+
p(_),
|
|
1034
|
+
p(f, { class: "px-1 py-0" }, {
|
|
1035
|
+
default: h(() => [
|
|
1036
|
+
p(l, { "no-gutters": "" }, {
|
|
1037
|
+
default: h(() => [
|
|
1038
|
+
p(d, null, {
|
|
1039
|
+
default: h(() => [
|
|
1040
|
+
p(y, { "html-for": "heightMode" }, {
|
|
1041
|
+
default: h(() => [
|
|
1041
1042
|
F(
|
|
1042
1043
|
A(i.$t("viewshed.heightMode")),
|
|
1043
1044
|
1
|
|
@@ -1051,16 +1052,16 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1051
1052
|
_: 1
|
|
1052
1053
|
/* STABLE */
|
|
1053
1054
|
}),
|
|
1054
|
-
|
|
1055
|
-
default:
|
|
1056
|
-
|
|
1055
|
+
p(d, null, {
|
|
1056
|
+
default: h(() => [
|
|
1057
|
+
p(x, {
|
|
1057
1058
|
id: "heightMode",
|
|
1058
|
-
items: Object.values(
|
|
1059
|
-
value:
|
|
1060
|
-
title: `viewshed.${
|
|
1059
|
+
items: Object.values(t.HeightModes).map((T) => ({
|
|
1060
|
+
value: T,
|
|
1061
|
+
title: `viewshed.${T}`
|
|
1061
1062
|
})),
|
|
1062
|
-
"model-value":
|
|
1063
|
-
"onUpdate:modelValue":
|
|
1063
|
+
"model-value": t.heightMode,
|
|
1064
|
+
"onUpdate:modelValue": t.changeHeightMode
|
|
1064
1065
|
}, null, 8, ["items", "model-value", "onUpdate:modelValue"])
|
|
1065
1066
|
]),
|
|
1066
1067
|
_: 1
|
|
@@ -1074,47 +1075,47 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1074
1075
|
_: 1
|
|
1075
1076
|
/* STABLE */
|
|
1076
1077
|
}),
|
|
1077
|
-
|
|
1078
|
+
t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(f, {
|
|
1078
1079
|
key: 2,
|
|
1079
1080
|
class: "px-1 pt-0 pb-2"
|
|
1080
1081
|
}, {
|
|
1081
|
-
default:
|
|
1082
|
+
default: h(() => [
|
|
1082
1083
|
(M(!0), B(
|
|
1083
1084
|
pe,
|
|
1084
1085
|
null,
|
|
1085
|
-
we(
|
|
1086
|
+
we(t.parameters, (T, a) => (M(), N(
|
|
1086
1087
|
l,
|
|
1087
1088
|
{
|
|
1088
1089
|
"no-gutters": "",
|
|
1089
|
-
key:
|
|
1090
|
+
key: a
|
|
1090
1091
|
},
|
|
1091
1092
|
{
|
|
1092
|
-
default:
|
|
1093
|
-
|
|
1094
|
-
|
|
1093
|
+
default: h(() => [
|
|
1094
|
+
a === "distance" || t.viewshedType === t.ViewshedTypes.CONE && a !== "showPrimitive" ? (M(), N(
|
|
1095
|
+
d,
|
|
1095
1096
|
{ key: 0 },
|
|
1096
1097
|
{
|
|
1097
|
-
default:
|
|
1098
|
-
|
|
1098
|
+
default: h(() => [
|
|
1099
|
+
p(
|
|
1099
1100
|
l,
|
|
1100
1101
|
{
|
|
1101
1102
|
"no-gutters": "",
|
|
1102
1103
|
class: "px-1"
|
|
1103
1104
|
},
|
|
1104
1105
|
{
|
|
1105
|
-
default:
|
|
1106
|
-
|
|
1107
|
-
|
|
1106
|
+
default: h(() => [
|
|
1107
|
+
p(
|
|
1108
|
+
d,
|
|
1108
1109
|
null,
|
|
1109
1110
|
{
|
|
1110
|
-
default:
|
|
1111
|
-
|
|
1112
|
-
"html-for":
|
|
1111
|
+
default: h(() => [
|
|
1112
|
+
p(y, {
|
|
1113
|
+
"html-for": a,
|
|
1113
1114
|
class: "py-0"
|
|
1114
1115
|
}, {
|
|
1115
|
-
default:
|
|
1116
|
+
default: h(() => [
|
|
1116
1117
|
F(
|
|
1117
|
-
A(i.$t(`viewshed.${
|
|
1118
|
+
A(i.$t(`viewshed.${a}`)),
|
|
1118
1119
|
1
|
|
1119
1120
|
/* TEXT */
|
|
1120
1121
|
)
|
|
@@ -1129,21 +1130,21 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1129
1130
|
1024
|
|
1130
1131
|
/* DYNAMIC_SLOTS */
|
|
1131
1132
|
),
|
|
1132
|
-
|
|
1133
|
-
|
|
1133
|
+
p(
|
|
1134
|
+
d,
|
|
1134
1135
|
{ class: "d-flex justify-end align-center" },
|
|
1135
1136
|
{
|
|
1136
|
-
default:
|
|
1137
|
-
|
|
1137
|
+
default: h(() => [
|
|
1138
|
+
a === "distance" ? (M(), B(
|
|
1138
1139
|
"span",
|
|
1139
1140
|
Ut,
|
|
1140
|
-
A(`${Math.round(
|
|
1141
|
+
A(`${Math.round(T)} m`),
|
|
1141
1142
|
1
|
|
1142
1143
|
/* TEXT */
|
|
1143
1144
|
)) : (M(), B(
|
|
1144
1145
|
"span",
|
|
1145
1146
|
$t,
|
|
1146
|
-
A(`${Math.round(
|
|
1147
|
+
A(`${Math.round(T)} °`),
|
|
1147
1148
|
1
|
|
1148
1149
|
/* TEXT */
|
|
1149
1150
|
))
|
|
@@ -1161,25 +1162,25 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1161
1162
|
1024
|
|
1162
1163
|
/* DYNAMIC_SLOTS */
|
|
1163
1164
|
),
|
|
1164
|
-
|
|
1165
|
+
p(
|
|
1165
1166
|
l,
|
|
1166
1167
|
{ "no-gutters": "" },
|
|
1167
1168
|
{
|
|
1168
|
-
default:
|
|
1169
|
-
|
|
1170
|
-
|
|
1169
|
+
default: h(() => [
|
|
1170
|
+
p(
|
|
1171
|
+
d,
|
|
1171
1172
|
null,
|
|
1172
1173
|
{
|
|
1173
|
-
default:
|
|
1174
|
-
|
|
1175
|
-
id:
|
|
1174
|
+
default: h(() => [
|
|
1175
|
+
p(S, {
|
|
1176
|
+
id: a,
|
|
1176
1177
|
class: "pa-0",
|
|
1177
|
-
"model-value":
|
|
1178
|
-
"onUpdate:modelValue": (
|
|
1178
|
+
"model-value": T,
|
|
1179
|
+
"onUpdate:modelValue": (v) => t.setParameter(a, v),
|
|
1179
1180
|
type: "number",
|
|
1180
1181
|
step: "1",
|
|
1181
|
-
min:
|
|
1182
|
-
max:
|
|
1182
|
+
min: t.parameterRanges[a][0],
|
|
1183
|
+
max: t.parameterRanges[a][1]
|
|
1183
1184
|
}, null, 8, ["id", "model-value", "onUpdate:modelValue", "min", "max"])
|
|
1184
1185
|
]),
|
|
1185
1186
|
_: 2
|
|
@@ -1216,19 +1217,19 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1216
1217
|
_: 1
|
|
1217
1218
|
/* STABLE */
|
|
1218
1219
|
})) : H("v-if", !0),
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
onClick:
|
|
1220
|
+
p(_),
|
|
1221
|
+
t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), B("div", Ht, [
|
|
1222
|
+
p(L, {
|
|
1223
|
+
onClick: e[0] || (e[0] = (T) => t.addToMyWorkspace()),
|
|
1223
1224
|
tooltip: "viewshed.addToMyWorkspace",
|
|
1224
1225
|
icon: "$vcsComponentsPlus",
|
|
1225
|
-
disabled:
|
|
1226
|
+
disabled: t.currentIsPersisted || void 0
|
|
1226
1227
|
}, null, 8, ["disabled"]),
|
|
1227
|
-
|
|
1228
|
-
onClick:
|
|
1228
|
+
p(L, {
|
|
1229
|
+
onClick: e[1] || (e[1] = (T) => t.createNewViewshed()),
|
|
1229
1230
|
variant: "filled"
|
|
1230
1231
|
}, {
|
|
1231
|
-
default:
|
|
1232
|
+
default: h(() => [
|
|
1232
1233
|
F(
|
|
1233
1234
|
A(i.$t("viewshed.new")),
|
|
1234
1235
|
1
|
|
@@ -1238,12 +1239,12 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1238
1239
|
_: 1
|
|
1239
1240
|
/* STABLE */
|
|
1240
1241
|
})
|
|
1241
|
-
])) :
|
|
1242
|
-
|
|
1243
|
-
onClick:
|
|
1242
|
+
])) : t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", zt, [
|
|
1243
|
+
p(L, {
|
|
1244
|
+
onClick: e[2] || (e[2] = (T) => t.cancel()),
|
|
1244
1245
|
variant: "outlined"
|
|
1245
1246
|
}, {
|
|
1246
|
-
default:
|
|
1247
|
+
default: h(() => [
|
|
1247
1248
|
F(
|
|
1248
1249
|
A(i.$t("viewshed.cancel")),
|
|
1249
1250
|
1
|
|
@@ -1256,148 +1257,168 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1256
1257
|
])) : H("v-if", !0)
|
|
1257
1258
|
]);
|
|
1258
1259
|
}
|
|
1259
|
-
const Kt = /* @__PURE__ */
|
|
1260
|
-
[
|
|
1261
|
-
[
|
|
1260
|
+
const Kt = /* @__PURE__ */ Oe(jt, [["render", Gt]]), j = "@vcmap/viewshed", Yt = "3.0.5", Xt = "^6.0", ne = {
|
|
1261
|
+
[g.CONE]: "$vcsViewshed",
|
|
1262
|
+
[g.THREESIXTY]: "$vcsViewshedCone"
|
|
1262
1263
|
};
|
|
1263
|
-
function Jt(i,
|
|
1264
|
-
const
|
|
1264
|
+
function Jt(i, e, o) {
|
|
1265
|
+
const t = $(), s = $(), n = `${o.id}-editor`, r = {
|
|
1265
1266
|
component: Kt,
|
|
1266
1267
|
provides: {
|
|
1267
1268
|
manager: i
|
|
1268
1269
|
},
|
|
1269
1270
|
state: {
|
|
1270
|
-
headerTitle:
|
|
1271
|
+
headerTitle: t,
|
|
1271
1272
|
headerIcon: s,
|
|
1272
1273
|
styles: { width: "280px", height: "auto" },
|
|
1273
|
-
infoUrlCallback:
|
|
1274
|
+
infoUrlCallback: e.getHelpUrlCallback("tools/viewshed.html")
|
|
1274
1275
|
}
|
|
1275
1276
|
};
|
|
1276
|
-
|
|
1277
|
-
editor: (
|
|
1278
|
-
...
|
|
1277
|
+
ft(e, o, {
|
|
1278
|
+
editor: (m) => ({
|
|
1279
|
+
...r,
|
|
1279
1280
|
props: {
|
|
1280
1281
|
selection: o.selection,
|
|
1281
|
-
getViewshed: () => o.collection.getByKey(
|
|
1282
|
+
getViewshed: () => o.collection.getByKey(m.name)
|
|
1282
1283
|
}
|
|
1283
1284
|
})
|
|
1284
1285
|
});
|
|
1285
1286
|
function l() {
|
|
1286
|
-
i.currentViewshed.value && (s.value =
|
|
1287
|
+
i.currentViewshed.value && (s.value = ne[i.currentViewshed.value.type], i.currentIsPersisted.value ? t.value = i.currentViewshed.value.properties.title : i.mode.value === E.CREATE ? t.value = `viewshed.create.${i.currentViewshed.value.type}` : t.value = [
|
|
1287
1288
|
"viewshed.temporary",
|
|
1288
1289
|
`viewshed.${i.currentViewshed.value.type}`
|
|
1289
1290
|
]);
|
|
1290
1291
|
}
|
|
1291
|
-
function
|
|
1292
|
-
l(), i.currentViewshed.value && !i.currentIsPersisted.value && (i.mode.value ===
|
|
1292
|
+
function w() {
|
|
1293
|
+
l(), i.currentViewshed.value && !i.currentIsPersisted.value && (i.mode.value === E.EDIT || i.mode.value === E.MOVE || i.mode.value === E.CREATE) && (e.windowManager.has(n) || e.windowManager.add(
|
|
1293
1294
|
{
|
|
1294
|
-
...
|
|
1295
|
+
...r,
|
|
1295
1296
|
id: n,
|
|
1296
1297
|
parentId: "category-manager",
|
|
1297
|
-
slot:
|
|
1298
|
+
slot: mt.DYNAMIC_CHILD
|
|
1298
1299
|
},
|
|
1299
1300
|
j
|
|
1300
1301
|
));
|
|
1301
1302
|
}
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
}),
|
|
1305
|
-
|
|
1306
|
-
}),
|
|
1307
|
-
i.mode.value ?
|
|
1303
|
+
const c = G(i.currentViewshed, (m) => {
|
|
1304
|
+
m && w();
|
|
1305
|
+
}), d = G(i.currentIsPersisted, (m) => {
|
|
1306
|
+
m && l();
|
|
1307
|
+
}), f = G(i.mode, () => {
|
|
1308
|
+
i.mode.value ? w() : e.windowManager.remove(n);
|
|
1308
1309
|
});
|
|
1309
1310
|
return {
|
|
1310
1311
|
destroy() {
|
|
1311
|
-
|
|
1312
|
+
e.windowManager.remove(n), c(), f(), d();
|
|
1312
1313
|
}
|
|
1313
1314
|
};
|
|
1314
1315
|
}
|
|
1315
|
-
function Zt(i,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1316
|
+
function Zt(i, e, o, t) {
|
|
1317
|
+
function s(c) {
|
|
1318
|
+
return c === g.CONE ? {
|
|
1319
|
+
name: g.CONE,
|
|
1320
|
+
icon: ne[g.CONE],
|
|
1321
|
+
title: `viewshed.create.${g.CONE}`
|
|
1322
|
+
} : c === g.THREESIXTY ? {
|
|
1323
|
+
name: g.THREESIXTY,
|
|
1324
|
+
icon: ne[g.THREESIXTY],
|
|
1325
|
+
title: `viewshed.create.${g.THREESIXTY}`
|
|
1326
|
+
} : void 0;
|
|
1327
|
+
}
|
|
1328
|
+
let n, r;
|
|
1329
|
+
if (t.length === 1) {
|
|
1330
|
+
const c = s(t[0]);
|
|
1331
|
+
n = {
|
|
1332
|
+
type: ge.SINGLE,
|
|
1333
|
+
action: J({
|
|
1334
|
+
...c,
|
|
1335
|
+
active: !1,
|
|
1336
|
+
background: !1,
|
|
1337
|
+
disabled: !(i.maps.activeMap instanceof U),
|
|
1338
|
+
callback() {
|
|
1339
|
+
this.active ? this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop() : e.createViewshed(c.name);
|
|
1330
1340
|
}
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1341
|
+
})
|
|
1342
|
+
};
|
|
1343
|
+
} else
|
|
1344
|
+
n = {
|
|
1345
|
+
type: ge.SELECT,
|
|
1346
|
+
action: J({
|
|
1347
|
+
name: o,
|
|
1348
|
+
currentIndex: 0,
|
|
1349
|
+
active: !1,
|
|
1350
|
+
background: !1,
|
|
1351
|
+
disabled: !(i.maps.activeMap instanceof U),
|
|
1352
|
+
callback() {
|
|
1353
|
+
if (this.active)
|
|
1354
|
+
this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop();
|
|
1355
|
+
else {
|
|
1356
|
+
const c = this.tools[this.currentIndex].name;
|
|
1357
|
+
e.createViewshed(c);
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
selected(c) {
|
|
1361
|
+
c !== this.currentIndex && (this.currentIndex = c);
|
|
1362
|
+
const d = this.tools[this.currentIndex].name;
|
|
1363
|
+
e.createViewshed(d);
|
|
1364
|
+
},
|
|
1365
|
+
tools: t.flatMap(s)
|
|
1366
|
+
})
|
|
1367
|
+
}, r = G(
|
|
1368
|
+
e.currentViewshed,
|
|
1369
|
+
(c) => {
|
|
1370
|
+
c && (n.action.currentIndex = n.action.tools.findIndex(
|
|
1371
|
+
(d) => d.name === c.type
|
|
1372
|
+
));
|
|
1373
|
+
}
|
|
1374
|
+
);
|
|
1375
|
+
const l = G(e.mode, (c) => {
|
|
1376
|
+
c === E.VIEW ? (n.action.background = !0, n.action.active = !0) : c ? (n.action.background = !1, n.action.active = !0) : (n.action.background = !1, n.action.active = !1);
|
|
1377
|
+
}), w = i.maps.mapActivated.addEventListener((c) => {
|
|
1378
|
+
c instanceof U ? n.action.disabled = !1 : n.action.disabled = !0;
|
|
1358
1379
|
});
|
|
1359
1380
|
return {
|
|
1360
1381
|
destroy() {
|
|
1361
|
-
|
|
1382
|
+
l(), r == null || r(), w();
|
|
1362
1383
|
},
|
|
1363
|
-
toolbox:
|
|
1384
|
+
toolbox: n
|
|
1364
1385
|
};
|
|
1365
1386
|
}
|
|
1366
|
-
function qt(i,
|
|
1367
|
-
|
|
1368
|
-
const { toolbox: s, destroy: n } = Zt(i,
|
|
1387
|
+
function qt(i, e, o, t) {
|
|
1388
|
+
le(t, [Pt(g)]);
|
|
1389
|
+
const { toolbox: s, destroy: n } = Zt(i, e, o, t), r = i.toolboxManager.add(s, o).id;
|
|
1369
1390
|
return () => {
|
|
1370
|
-
i.toolboxManager.remove(
|
|
1391
|
+
i.toolboxManager.remove(r), n();
|
|
1371
1392
|
};
|
|
1372
1393
|
}
|
|
1373
|
-
class
|
|
1394
|
+
class ae extends $e {
|
|
1374
1395
|
static get className() {
|
|
1375
1396
|
return "ViewshedCategory";
|
|
1376
1397
|
}
|
|
1377
|
-
async _deserializeItem(
|
|
1378
|
-
var
|
|
1398
|
+
async _deserializeItem(e) {
|
|
1399
|
+
var t;
|
|
1379
1400
|
if (
|
|
1380
1401
|
/** @type {import("@vcmap/core").CesiumMap | undefined} */
|
|
1381
|
-
(
|
|
1402
|
+
(t = this._app) == null ? void 0 : t.maps.getByType(U.className)[0]
|
|
1382
1403
|
)
|
|
1383
|
-
return new
|
|
1404
|
+
return new D(e);
|
|
1384
1405
|
throw new Error("No CesiumMap available");
|
|
1385
1406
|
}
|
|
1386
1407
|
}
|
|
1387
|
-
function Qt(i,
|
|
1388
|
-
let o,
|
|
1408
|
+
function Qt(i, e) {
|
|
1409
|
+
let o, t = 0;
|
|
1389
1410
|
const s = new Set(
|
|
1390
|
-
|
|
1411
|
+
e.filter((n) => n.type === i).map((n) => n.properties.title)
|
|
1391
1412
|
);
|
|
1392
1413
|
do
|
|
1393
|
-
|
|
1414
|
+
t += 1, s.has(`${i}-${t}`) || (o = `${i}-${t}`);
|
|
1394
1415
|
while (!o);
|
|
1395
1416
|
return o;
|
|
1396
1417
|
}
|
|
1397
1418
|
async function ei(i) {
|
|
1398
|
-
const
|
|
1419
|
+
const e = new X(), o = new X(), { collectionComponent: t, category: s } = await i.categoryManager.requestCategory(
|
|
1399
1420
|
{
|
|
1400
|
-
type:
|
|
1421
|
+
type: ae.className,
|
|
1401
1422
|
name: "Viewsheds",
|
|
1402
1423
|
title: "viewshed.viewshedCategory"
|
|
1403
1424
|
},
|
|
@@ -1408,22 +1429,22 @@ async function ei(i) {
|
|
|
1408
1429
|
removable: !0
|
|
1409
1430
|
}
|
|
1410
1431
|
);
|
|
1411
|
-
|
|
1432
|
+
t.addItemMapping({
|
|
1412
1433
|
mappingFunction: vt(
|
|
1413
|
-
[
|
|
1434
|
+
[U.className],
|
|
1414
1435
|
i.maps
|
|
1415
1436
|
),
|
|
1416
1437
|
owner: j
|
|
1417
1438
|
});
|
|
1418
|
-
const n = (
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
},
|
|
1422
|
-
|
|
1439
|
+
const n = (d, f, m) => {
|
|
1440
|
+
m.title = d.properties.title, m.titleChanged = (_) => {
|
|
1441
|
+
d.properties.title = _, m.title = _, e.raiseEvent({ item: d, title: _ });
|
|
1442
|
+
}, m.actions.push(
|
|
1443
|
+
J({
|
|
1423
1444
|
name: "visibilityAction",
|
|
1424
1445
|
icon: "$vcsCheckbox",
|
|
1425
1446
|
callback() {
|
|
1426
|
-
o.raiseEvent(
|
|
1447
|
+
o.raiseEvent(d);
|
|
1427
1448
|
}
|
|
1428
1449
|
})
|
|
1429
1450
|
);
|
|
@@ -1432,51 +1453,51 @@ async function ei(i) {
|
|
|
1432
1453
|
() => !0,
|
|
1433
1454
|
n,
|
|
1434
1455
|
j,
|
|
1435
|
-
[
|
|
1456
|
+
[t.id]
|
|
1436
1457
|
);
|
|
1437
|
-
const { action:
|
|
1438
|
-
|
|
1458
|
+
const { action: r, destroy: l } = pt(
|
|
1459
|
+
t.selection,
|
|
1439
1460
|
() => {
|
|
1440
|
-
const
|
|
1441
|
-
(
|
|
1461
|
+
const d = t.selection.value.map(
|
|
1462
|
+
(f) => t.collection.getByKey(f.name)
|
|
1442
1463
|
);
|
|
1443
|
-
wt(JSON.stringify(
|
|
1464
|
+
wt(JSON.stringify(d), "viewsheds.json");
|
|
1444
1465
|
},
|
|
1445
1466
|
j
|
|
1446
|
-
), { action:
|
|
1447
|
-
async (
|
|
1448
|
-
const { vueI18n:
|
|
1449
|
-
|
|
1467
|
+
), { action: w, destroy: c } = gt(
|
|
1468
|
+
async (d) => {
|
|
1469
|
+
const { vueI18n: f } = i, _ = (await Promise.all(
|
|
1470
|
+
d.map(async (S) => {
|
|
1450
1471
|
const L = await S.text();
|
|
1451
1472
|
try {
|
|
1452
|
-
return JSON.parse(L).map((
|
|
1473
|
+
return JSON.parse(L).map((a) => new D(a));
|
|
1453
1474
|
} catch {
|
|
1454
1475
|
i.notifier.add({
|
|
1455
|
-
type:
|
|
1456
|
-
message:
|
|
1476
|
+
type: Z.ERROR,
|
|
1477
|
+
message: f.t("components.import.failure", {
|
|
1457
1478
|
fileName: S.name
|
|
1458
1479
|
})
|
|
1459
1480
|
});
|
|
1460
1481
|
}
|
|
1461
1482
|
return [];
|
|
1462
1483
|
})
|
|
1463
|
-
)).flat(),
|
|
1464
|
-
if (
|
|
1484
|
+
)).flat(), y = _.map((S) => s.collection.add(S)).filter((S) => S != null), x = _.length - y.length;
|
|
1485
|
+
if (x > 0)
|
|
1465
1486
|
return i.notifier.add({
|
|
1466
|
-
type:
|
|
1467
|
-
message:
|
|
1487
|
+
type: Z.WARNING,
|
|
1488
|
+
message: f.t("components.import.addFailure", [x])
|
|
1468
1489
|
}), !1;
|
|
1469
|
-
if (
|
|
1490
|
+
if (y.length > 0)
|
|
1470
1491
|
i.notifier.add({
|
|
1471
|
-
type:
|
|
1472
|
-
message:
|
|
1473
|
-
|
|
1492
|
+
type: Z.SUCCESS,
|
|
1493
|
+
message: f.t("components.import.featuresAdded", [
|
|
1494
|
+
y.length
|
|
1474
1495
|
])
|
|
1475
1496
|
});
|
|
1476
1497
|
else
|
|
1477
1498
|
return i.notifier.add({
|
|
1478
|
-
type:
|
|
1479
|
-
message:
|
|
1499
|
+
type: Z.ERROR,
|
|
1500
|
+
message: f.t("components.import.nothingAdded")
|
|
1480
1501
|
}), !1;
|
|
1481
1502
|
return !0;
|
|
1482
1503
|
},
|
|
@@ -1484,62 +1505,62 @@ async function ei(i) {
|
|
|
1484
1505
|
j,
|
|
1485
1506
|
"category-manager"
|
|
1486
1507
|
);
|
|
1487
|
-
return
|
|
1488
|
-
renamed:
|
|
1508
|
+
return t.addActions([r, w]), {
|
|
1509
|
+
renamed: e,
|
|
1489
1510
|
visibilityChanged: o,
|
|
1490
|
-
setSelection(
|
|
1491
|
-
|
|
1511
|
+
setSelection(d) {
|
|
1512
|
+
d && (t.selection.value = t.items.value.filter((f) => d === f.name));
|
|
1492
1513
|
},
|
|
1493
1514
|
clearSelection() {
|
|
1494
|
-
|
|
1515
|
+
t.selection.value.length && (t.selection.value = []);
|
|
1495
1516
|
},
|
|
1496
|
-
setVisibility(
|
|
1497
|
-
const
|
|
1498
|
-
(
|
|
1517
|
+
setVisibility(d, f) {
|
|
1518
|
+
const m = t.items.value.find(
|
|
1519
|
+
(_) => d === _.name
|
|
1499
1520
|
);
|
|
1500
|
-
if (
|
|
1501
|
-
const
|
|
1502
|
-
(
|
|
1521
|
+
if (m) {
|
|
1522
|
+
const _ = m.actions.find(
|
|
1523
|
+
(y) => y.name === "visibilityAction"
|
|
1503
1524
|
);
|
|
1504
|
-
|
|
1525
|
+
_ && (_.icon = f ? "$vcsCheckboxChecked" : "$vcsCheckbox");
|
|
1505
1526
|
}
|
|
1506
1527
|
},
|
|
1507
|
-
add(
|
|
1508
|
-
|
|
1509
|
-
|
|
1528
|
+
add(d) {
|
|
1529
|
+
d.properties.title = Qt(
|
|
1530
|
+
d.type,
|
|
1510
1531
|
/** @type {import("./viewshed.js").default[]} */
|
|
1511
1532
|
[
|
|
1512
1533
|
...s.collection
|
|
1513
1534
|
]
|
|
1514
|
-
), s.collection.add(
|
|
1535
|
+
), s.collection.add(d);
|
|
1515
1536
|
},
|
|
1516
|
-
remove(
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1537
|
+
remove(d) {
|
|
1538
|
+
const f = s.collection.getByKey(d);
|
|
1539
|
+
f && s.collection.remove(f);
|
|
1519
1540
|
},
|
|
1520
|
-
collectionComponent:
|
|
1541
|
+
collectionComponent: t,
|
|
1521
1542
|
destroy() {
|
|
1522
|
-
i.categoryManager.removeOwner(j),
|
|
1543
|
+
i.categoryManager.removeOwner(j), e.destroy(), o.destroy(), l(), c();
|
|
1523
1544
|
}
|
|
1524
1545
|
};
|
|
1525
1546
|
}
|
|
1526
|
-
function
|
|
1547
|
+
function Q() {
|
|
1527
1548
|
return {
|
|
1528
|
-
visibleColor:
|
|
1529
|
-
shadowColor:
|
|
1530
|
-
tools: [...Object.values(
|
|
1549
|
+
visibleColor: D.getDefaultOptions().visibleColor,
|
|
1550
|
+
shadowColor: D.getDefaultOptions().shadowColor,
|
|
1551
|
+
tools: [...Object.values(g)]
|
|
1531
1552
|
};
|
|
1532
1553
|
}
|
|
1533
1554
|
const ti = {
|
|
1534
1555
|
name: "ViewshedConfigEditor",
|
|
1535
1556
|
components: {
|
|
1536
1557
|
AbstractConfigEditor: _t,
|
|
1537
|
-
VcsFormSection:
|
|
1538
|
-
VContainer:
|
|
1539
|
-
VRow:
|
|
1540
|
-
VCol:
|
|
1541
|
-
VcsLabel:
|
|
1542
|
-
VcsSelect:
|
|
1558
|
+
VcsFormSection: Ee,
|
|
1559
|
+
VContainer: Ve,
|
|
1560
|
+
VRow: be,
|
|
1561
|
+
VCol: Me,
|
|
1562
|
+
VcsLabel: Ce,
|
|
1563
|
+
VcsSelect: ye,
|
|
1543
1564
|
VColorPicker: Et
|
|
1544
1565
|
},
|
|
1545
1566
|
props: {
|
|
@@ -1553,38 +1574,38 @@ const ti = {
|
|
|
1553
1574
|
}
|
|
1554
1575
|
},
|
|
1555
1576
|
setup(i) {
|
|
1556
|
-
const
|
|
1557
|
-
function
|
|
1577
|
+
const e = i.getConfig(), o = $({ ...Q(), ...e });
|
|
1578
|
+
function t() {
|
|
1558
1579
|
i.setConfig(o.value);
|
|
1559
1580
|
}
|
|
1560
1581
|
return {
|
|
1561
1582
|
localConfig: o,
|
|
1562
|
-
ViewshedTypes:
|
|
1563
|
-
apply:
|
|
1564
|
-
toolItems: Object.values(
|
|
1583
|
+
ViewshedTypes: g,
|
|
1584
|
+
apply: t,
|
|
1585
|
+
toolItems: Object.values(g).map((s) => ({
|
|
1565
1586
|
value: s,
|
|
1566
1587
|
title: `viewshed.${s}`
|
|
1567
1588
|
}))
|
|
1568
1589
|
};
|
|
1569
1590
|
}
|
|
1570
1591
|
};
|
|
1571
|
-
function ii(i,
|
|
1572
|
-
const
|
|
1573
|
-
return M(),
|
|
1574
|
-
default:
|
|
1575
|
-
|
|
1592
|
+
function ii(i, e, o, t, s, n) {
|
|
1593
|
+
const r = b("VcsLabel"), l = b("v-col"), w = b("VcsSelect"), c = b("v-row"), d = b("VColorPicker"), f = b("v-container"), m = b("VcsFormSection"), _ = b("AbstractConfigEditor");
|
|
1594
|
+
return M(), N(_, ot({ onSubmit: t.apply }, { ...i.$attrs, ...i.$props }), {
|
|
1595
|
+
default: h(() => [
|
|
1596
|
+
t.localConfig ? (M(), N(m, {
|
|
1576
1597
|
key: 0,
|
|
1577
1598
|
heading: "viewshed.editor.general"
|
|
1578
1599
|
}, {
|
|
1579
|
-
default:
|
|
1580
|
-
|
|
1581
|
-
default:
|
|
1582
|
-
|
|
1583
|
-
default:
|
|
1584
|
-
|
|
1585
|
-
default:
|
|
1586
|
-
|
|
1587
|
-
default:
|
|
1600
|
+
default: h(() => [
|
|
1601
|
+
p(f, { class: "px-1 py-0" }, {
|
|
1602
|
+
default: h(() => [
|
|
1603
|
+
p(c, { "no-gutters": "" }, {
|
|
1604
|
+
default: h(() => [
|
|
1605
|
+
p(l, null, {
|
|
1606
|
+
default: h(() => [
|
|
1607
|
+
p(r, { "html-for": "viewshed-editor-tools" }, {
|
|
1608
|
+
default: h(() => [
|
|
1588
1609
|
F(
|
|
1589
1610
|
A(i.$t("viewshed.editor.tools")),
|
|
1590
1611
|
1
|
|
@@ -1598,13 +1619,13 @@ function ii(i, t, o, e, s, n) {
|
|
|
1598
1619
|
_: 1
|
|
1599
1620
|
/* STABLE */
|
|
1600
1621
|
}),
|
|
1601
|
-
|
|
1602
|
-
default:
|
|
1603
|
-
|
|
1622
|
+
p(l, null, {
|
|
1623
|
+
default: h(() => [
|
|
1624
|
+
p(w, {
|
|
1604
1625
|
id: "viewshed-tools",
|
|
1605
|
-
items:
|
|
1606
|
-
modelValue:
|
|
1607
|
-
"onUpdate:modelValue":
|
|
1626
|
+
items: t.toolItems,
|
|
1627
|
+
modelValue: t.localConfig.tools,
|
|
1628
|
+
"onUpdate:modelValue": e[0] || (e[0] = (y) => t.localConfig.tools = y),
|
|
1608
1629
|
multiple: !0
|
|
1609
1630
|
}, null, 8, ["items", "modelValue"])
|
|
1610
1631
|
]),
|
|
@@ -1615,12 +1636,12 @@ function ii(i, t, o, e, s, n) {
|
|
|
1615
1636
|
_: 1
|
|
1616
1637
|
/* STABLE */
|
|
1617
1638
|
}),
|
|
1618
|
-
|
|
1619
|
-
default:
|
|
1620
|
-
|
|
1621
|
-
default:
|
|
1622
|
-
|
|
1623
|
-
default:
|
|
1639
|
+
p(c, { "no-gutters": "" }, {
|
|
1640
|
+
default: h(() => [
|
|
1641
|
+
p(l, null, {
|
|
1642
|
+
default: h(() => [
|
|
1643
|
+
p(r, { "html-for": "viewshed-editor-visible-color" }, {
|
|
1644
|
+
default: h(() => [
|
|
1624
1645
|
F(
|
|
1625
1646
|
A(i.$t("viewshed.editor.visibleColor")),
|
|
1626
1647
|
1
|
|
@@ -1634,11 +1655,11 @@ function ii(i, t, o, e, s, n) {
|
|
|
1634
1655
|
_: 1
|
|
1635
1656
|
/* STABLE */
|
|
1636
1657
|
}),
|
|
1637
|
-
|
|
1638
|
-
default:
|
|
1639
|
-
|
|
1640
|
-
modelValue:
|
|
1641
|
-
"onUpdate:modelValue":
|
|
1658
|
+
p(l, null, {
|
|
1659
|
+
default: h(() => [
|
|
1660
|
+
p(d, {
|
|
1661
|
+
modelValue: t.localConfig.visibleColor,
|
|
1662
|
+
"onUpdate:modelValue": e[1] || (e[1] = (y) => t.localConfig.visibleColor = y),
|
|
1642
1663
|
mode: "rgba"
|
|
1643
1664
|
}, null, 8, ["modelValue"])
|
|
1644
1665
|
]),
|
|
@@ -1649,12 +1670,12 @@ function ii(i, t, o, e, s, n) {
|
|
|
1649
1670
|
_: 1
|
|
1650
1671
|
/* STABLE */
|
|
1651
1672
|
}),
|
|
1652
|
-
|
|
1653
|
-
default:
|
|
1654
|
-
|
|
1655
|
-
default:
|
|
1656
|
-
|
|
1657
|
-
default:
|
|
1673
|
+
p(c, { "no-gutters": "" }, {
|
|
1674
|
+
default: h(() => [
|
|
1675
|
+
p(l, null, {
|
|
1676
|
+
default: h(() => [
|
|
1677
|
+
p(r, { "html-for": "viewshed-editor-shadow-color" }, {
|
|
1678
|
+
default: h(() => [
|
|
1658
1679
|
F(
|
|
1659
1680
|
A(i.$t("viewshed.editor.shadowColor")),
|
|
1660
1681
|
1
|
|
@@ -1668,11 +1689,11 @@ function ii(i, t, o, e, s, n) {
|
|
|
1668
1689
|
_: 1
|
|
1669
1690
|
/* STABLE */
|
|
1670
1691
|
}),
|
|
1671
|
-
|
|
1672
|
-
default:
|
|
1673
|
-
|
|
1674
|
-
modelValue:
|
|
1675
|
-
"onUpdate:modelValue":
|
|
1692
|
+
p(l, null, {
|
|
1693
|
+
default: h(() => [
|
|
1694
|
+
p(d, {
|
|
1695
|
+
modelValue: t.localConfig.shadowColor,
|
|
1696
|
+
"onUpdate:modelValue": e[2] || (e[2] = (y) => t.localConfig.shadowColor = y),
|
|
1676
1697
|
mode: "rgba"
|
|
1677
1698
|
}, null, 8, ["modelValue"])
|
|
1678
1699
|
]),
|
|
@@ -1696,9 +1717,9 @@ function ii(i, t, o, e, s, n) {
|
|
|
1696
1717
|
/* STABLE */
|
|
1697
1718
|
}, 16, ["onSubmit"]);
|
|
1698
1719
|
}
|
|
1699
|
-
const oi = /* @__PURE__ */
|
|
1720
|
+
const oi = /* @__PURE__ */ Oe(ti, [["render", ii]]);
|
|
1700
1721
|
function ui(i) {
|
|
1701
|
-
let
|
|
1722
|
+
let e, o, t = () => {
|
|
1702
1723
|
};
|
|
1703
1724
|
return {
|
|
1704
1725
|
get name() {
|
|
@@ -1717,65 +1738,65 @@ function ui(i) {
|
|
|
1717
1738
|
*/
|
|
1718
1739
|
async initialize(s, n) {
|
|
1719
1740
|
o = s, s.categoryClassRegistry.registerClass(
|
|
1720
|
-
this[
|
|
1721
|
-
|
|
1722
|
-
|
|
1741
|
+
this[He],
|
|
1742
|
+
ae.className,
|
|
1743
|
+
ae
|
|
1723
1744
|
);
|
|
1724
|
-
const
|
|
1725
|
-
|
|
1745
|
+
const r = await ei(s);
|
|
1746
|
+
e = Lt(
|
|
1726
1747
|
s,
|
|
1727
1748
|
i,
|
|
1728
|
-
|
|
1749
|
+
r
|
|
1729
1750
|
);
|
|
1730
1751
|
const l = qt(
|
|
1731
1752
|
s,
|
|
1732
|
-
|
|
1753
|
+
e,
|
|
1733
1754
|
j,
|
|
1734
|
-
i.tools ||
|
|
1735
|
-
), { destroy:
|
|
1736
|
-
|
|
1755
|
+
i.tools || Q().tools
|
|
1756
|
+
), { destroy: w } = Jt(
|
|
1757
|
+
e,
|
|
1737
1758
|
s,
|
|
1738
|
-
|
|
1739
|
-
), { activeMap:
|
|
1740
|
-
function
|
|
1741
|
-
if (n != null && n.m && n.cv &&
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
n.m === y.VIEW ? t.viewViewshed(V) : t.editViewshed(V);
|
|
1759
|
+
r.collectionComponent
|
|
1760
|
+
), { activeMap: c } = s.maps;
|
|
1761
|
+
function d(_) {
|
|
1762
|
+
if (n != null && n.m && n.cv && _ instanceof U) {
|
|
1763
|
+
const y = new D(n.cv);
|
|
1764
|
+
n.m === E.VIEW ? e.viewViewshed(y) : e.editViewshed(y);
|
|
1745
1765
|
}
|
|
1746
1766
|
}
|
|
1747
|
-
let
|
|
1748
|
-
|
|
1749
|
-
const
|
|
1750
|
-
(
|
|
1751
|
-
|
|
1767
|
+
let f = !1;
|
|
1768
|
+
c && (f = !0, d(c));
|
|
1769
|
+
const m = s.maps.mapActivated.addEventListener(
|
|
1770
|
+
(_) => {
|
|
1771
|
+
e.stop(), f || (d(_), f = !0);
|
|
1752
1772
|
}
|
|
1753
1773
|
);
|
|
1754
|
-
|
|
1755
|
-
|
|
1774
|
+
t = () => {
|
|
1775
|
+
m(), l(), w(), r.destroy(), e.destroy();
|
|
1756
1776
|
};
|
|
1757
1777
|
},
|
|
1758
1778
|
/**
|
|
1759
1779
|
* should return all default values of the configuration
|
|
1760
1780
|
* @returns {ViewshedPluginOptions}
|
|
1761
1781
|
*/
|
|
1762
|
-
getDefaultOptions:
|
|
1782
|
+
getDefaultOptions: Q,
|
|
1763
1783
|
/**
|
|
1764
1784
|
* should return the plugin's serialization excluding all default values
|
|
1765
1785
|
* @returns {ViewshedPluginOptions}
|
|
1766
1786
|
*/
|
|
1767
1787
|
toJSON() {
|
|
1768
1788
|
const s = {};
|
|
1769
|
-
return i.tools &&
|
|
1789
|
+
return i.tools && Q().tools.length !== i.tools.length && (s.tools = [...i.tools]), i.shadowColor && i.shadowColor !== D.getDefaultOptions().shadowColor && (s.shadowColor = i.shadowColor), i.visibleColor && i.visibleColor !== D.getDefaultOptions().visibleColor && (s.visibleColor = i.visibleColor), s;
|
|
1770
1790
|
},
|
|
1771
1791
|
/**
|
|
1772
1792
|
* should return the plugins state
|
|
1793
|
+
* @param {boolean} forUrl
|
|
1773
1794
|
* @returns {ViewshedPluginState}
|
|
1774
1795
|
*/
|
|
1775
|
-
getState() {
|
|
1776
|
-
var
|
|
1777
|
-
const
|
|
1778
|
-
return
|
|
1796
|
+
getState(s) {
|
|
1797
|
+
var w, c;
|
|
1798
|
+
const n = {}, r = e.mode.value, l = (w = e.currentViewshed.value) == null ? void 0 : w.toJSON();
|
|
1799
|
+
return r !== null && r !== "create" && l && (n.m = r, n.cv = l, s && ((c = n.cv.properties) != null && c.title) && (Object.keys(n.properties).length === 1 ? delete n.cv.properties : delete n.cv.properties.title)), n;
|
|
1779
1800
|
},
|
|
1780
1801
|
/**
|
|
1781
1802
|
* components for configuring the plugin and/ or custom items defined by the plugin
|
|
@@ -1793,7 +1814,7 @@ function ui(i) {
|
|
|
1793
1814
|
}
|
|
1794
1815
|
];
|
|
1795
1816
|
},
|
|
1796
|
-
destroy: () =>
|
|
1817
|
+
destroy: () => t(),
|
|
1797
1818
|
i18n: {
|
|
1798
1819
|
en: {
|
|
1799
1820
|
viewshed: {
|
|
@@ -1810,11 +1831,11 @@ function ui(i) {
|
|
|
1810
1831
|
absolute: "Absolute",
|
|
1811
1832
|
new: "New",
|
|
1812
1833
|
cancel: "Cancel",
|
|
1813
|
-
[
|
|
1814
|
-
[
|
|
1834
|
+
[g.CONE]: "Cone viewshed analysis",
|
|
1835
|
+
[g.THREESIXTY]: "360° viewshed analysis",
|
|
1815
1836
|
create: {
|
|
1816
|
-
[
|
|
1817
|
-
[
|
|
1837
|
+
[g.CONE]: "Create cone viewshed analysis",
|
|
1838
|
+
[g.THREESIXTY]: "Create 360° viewshed analysis"
|
|
1818
1839
|
},
|
|
1819
1840
|
addToMyWorkspace: "Add to My Workspace",
|
|
1820
1841
|
temporary: "Temporary",
|
|
@@ -1848,11 +1869,11 @@ function ui(i) {
|
|
|
1848
1869
|
absolute: "Absolut",
|
|
1849
1870
|
new: "Neu",
|
|
1850
1871
|
cancel: "Abbrechen",
|
|
1851
|
-
[
|
|
1852
|
-
[
|
|
1872
|
+
[g.CONE]: "Sichtkegelanalyse",
|
|
1873
|
+
[g.THREESIXTY]: "360° Sichtsanalyse",
|
|
1853
1874
|
create: {
|
|
1854
|
-
[
|
|
1855
|
-
[
|
|
1875
|
+
[g.CONE]: "Sichtkegelanalyse erstellen",
|
|
1876
|
+
[g.THREESIXTY]: "360° Sichtanalyse erstellen"
|
|
1856
1877
|
},
|
|
1857
1878
|
addToMyWorkspace: "Zu Mein Arbeitsbereich hinzufügen",
|
|
1858
1879
|
temporary: "Temporäre",
|