@vcmap/viewshed 3.0.3 → 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 +4 -0
- package/dist/index.js +550 -530
- package/package.json +5 -5
- package/src/util/toolboxHelper.js +84 -52
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
|
-
re.set(i,
|
|
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
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,143 +48,143 @@ 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 se(i,
|
|
67
|
-
const s =
|
|
66
|
+
function se(i, e, o, t) {
|
|
67
|
+
const s = t ? `${t}.` : "";
|
|
68
68
|
if (!oe(i))
|
|
69
69
|
return `Expected ${R(i)} to be a plain Object`;
|
|
70
|
-
let
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
return oe(
|
|
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
|
|
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 = re.get(
|
|
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
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 se(
|
|
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
|
|
135
|
-
return
|
|
134
|
+
const l = se(t, s, o);
|
|
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 le(i,
|
|
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
148
|
le(i, Object);
|
|
149
|
-
const
|
|
150
|
-
return o[
|
|
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
190
|
modelMatrix: te
|
|
@@ -194,10 +194,10 @@ class Nt extends Pe {
|
|
|
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: {
|
|
@@ -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
|
}
|
|
@@ -239,7 +239,7 @@ const I = class I extends Ae {
|
|
|
239
239
|
static getDefaultOptions() {
|
|
240
240
|
return {
|
|
241
241
|
frustum: {
|
|
242
|
-
fov:
|
|
242
|
+
fov: k.PI / 3,
|
|
243
243
|
near: 1,
|
|
244
244
|
aspectRatio: 1,
|
|
245
245
|
far: 300
|
|
@@ -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
|
-
((
|
|
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
|
-
le(
|
|
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,44 +335,44 @@ 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.
|
|
343
343
|
* @returns {number} The field of view in degrees.
|
|
344
344
|
*/
|
|
345
345
|
get fov() {
|
|
346
|
-
return this._frustumOptions.fov *
|
|
346
|
+
return this._frustumOptions.fov * k.DEGREES_PER_RADIAN;
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
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.
|
|
363
363
|
* @returns {number} The heading in degress.
|
|
364
364
|
*/
|
|
365
365
|
get heading() {
|
|
366
|
-
return this._headingPitchRollValues.heading *
|
|
366
|
+
return this._headingPitchRollValues.heading * k.DEGREES_PER_RADIAN;
|
|
367
367
|
}
|
|
368
368
|
/**
|
|
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
|
/**
|
|
@@ -380,14 +380,14 @@ const I = class I extends Ae {
|
|
|
380
380
|
* @returns {number} The pitch in degrees.
|
|
381
381
|
*/
|
|
382
382
|
get pitch() {
|
|
383
|
-
return this._headingPitchRollValues.pitch *
|
|
383
|
+
return this._headingPitchRollValues.pitch * k.DEGREES_PER_RADIAN;
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
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
512
|
let D = I;
|
|
513
|
-
class
|
|
513
|
+
class kt extends Ne {
|
|
514
514
|
/**
|
|
515
515
|
*
|
|
516
516
|
* @param {import("./viewshed").default} viewshed
|
|
517
517
|
*/
|
|
518
|
-
constructor(
|
|
519
|
-
super(Y.CLICKMOVE), this._viewshed =
|
|
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();
|
|
@@ -540,60 +540,60 @@ const P = {
|
|
|
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 ie(i,
|
|
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
|
|
565
|
-
let
|
|
563
|
+
function Lt(i, e, o) {
|
|
564
|
+
const t = q(null), s = $(null), n = $(null), r = $(P.ABSOLUTE);
|
|
565
|
+
let l = () => {
|
|
566
566
|
};
|
|
567
|
-
const
|
|
568
|
-
let
|
|
567
|
+
const w = q(null), c = q([]);
|
|
568
|
+
let d = () => {
|
|
569
569
|
};
|
|
570
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
574
|
function m(a = !0) {
|
|
575
|
-
|
|
575
|
+
d(), l(), f(), t.value = null, a && o.clearSelection(), s.value = null, n.value = null;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
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
579
|
var u;
|
|
580
|
-
v !== ((u =
|
|
580
|
+
v !== ((u = t.value) == null ? void 0 : u.shadowMap) && m(!1);
|
|
581
581
|
}));
|
|
582
582
|
}
|
|
583
583
|
async function y(a) {
|
|
584
|
-
m(), await
|
|
584
|
+
m(), await qe();
|
|
585
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 V = new
|
|
593
|
+
_(C);
|
|
594
|
+
const V = new kt(t.value);
|
|
595
595
|
V.finished.addEventListener(() => {
|
|
596
|
-
|
|
596
|
+
l(), t.value ? (t.value.showPrimitive = !0, n.value = E.EDIT) : m();
|
|
597
597
|
});
|
|
598
598
|
const O = v.addExclusiveInteraction(
|
|
599
599
|
V,
|
|
@@ -601,47 +601,47 @@ function Lt(i, t, o) {
|
|
|
601
601
|
V.destroy();
|
|
602
602
|
}
|
|
603
603
|
);
|
|
604
|
-
ie(u,
|
|
604
|
+
ie(u, r.value), V.positioned.addEventListener(() => {
|
|
605
605
|
ie(u, P.ABSOLUTE);
|
|
606
|
-
}),
|
|
607
|
-
O(), V.destroy(), u.setActive(),
|
|
606
|
+
}), l = () => {
|
|
607
|
+
O(), V.destroy(), u.setActive(), l = () => {
|
|
608
608
|
};
|
|
609
609
|
}, n.value = E.CREATE;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function x(a) {
|
|
612
612
|
var v;
|
|
613
|
-
if (
|
|
614
|
-
|
|
613
|
+
if (t.value && a) {
|
|
614
|
+
l();
|
|
615
615
|
const {
|
|
616
616
|
layer: u,
|
|
617
617
|
feature: C,
|
|
618
618
|
destroy: V
|
|
619
|
-
} =
|
|
620
|
-
i.layers.add(u),
|
|
621
|
-
|
|
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
|
+
l();
|
|
622
622
|
});
|
|
623
623
|
const O = (v = C.getGeometry()) == null ? void 0 : v.on("change", () => {
|
|
624
|
-
|
|
624
|
+
t.value ? t.value.position = z.mercatorToWgs84(
|
|
625
625
|
/** @type {import("ol/geom").Point} */
|
|
626
626
|
C.getGeometry().getCoordinates()
|
|
627
627
|
) : m();
|
|
628
628
|
});
|
|
629
|
-
n.value = E.MOVE,
|
|
629
|
+
n.value = E.MOVE, l = () => {
|
|
630
630
|
var K;
|
|
631
|
-
|
|
632
|
-
}, O &&
|
|
631
|
+
l = () => {
|
|
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
637
|
function S(a, v) {
|
|
638
|
-
|
|
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
640
|
const L = [
|
|
641
641
|
o.collectionComponent.collection.removed.addEventListener(
|
|
642
642
|
(a) => {
|
|
643
643
|
var v;
|
|
644
|
-
o.remove(a.name), ((v =
|
|
644
|
+
o.remove(a.name), ((v = t.value) == null ? void 0 : v.name) === a.name && m();
|
|
645
645
|
}
|
|
646
646
|
),
|
|
647
647
|
o.renamed.addEventListener(({ item: a, title: v }) => {
|
|
@@ -649,39 +649,39 @@ function Lt(i, t, o) {
|
|
|
649
649
|
const u = i.windowManager.get(
|
|
650
650
|
`${o.collectionComponent.id}-editor`
|
|
651
651
|
);
|
|
652
|
-
u && ((C =
|
|
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
655
|
var u;
|
|
656
|
-
const v = ((u =
|
|
656
|
+
const v = ((u = t.value) == null ? void 0 : u.name) === a.name;
|
|
657
657
|
v ? m() : (S(E.VIEW, a), o.clearSelection()), o.setVisibility(a.name, !v);
|
|
658
658
|
})
|
|
659
659
|
];
|
|
660
660
|
function T(a) {
|
|
661
|
-
if (!(a ===
|
|
662
|
-
if (
|
|
661
|
+
if (!(a === r.value || !t.value)) {
|
|
662
|
+
if (r.value = a, n.value === E.MOVE && l(), n.value === E.CREATE)
|
|
663
663
|
ie(
|
|
664
664
|
i.maps.eventHandler.featureInteraction,
|
|
665
665
|
a
|
|
666
|
-
),
|
|
666
|
+
), t.value.heightOffset = a === P.ABSOLUTE ? 0 : _e;
|
|
667
667
|
else if (n.value === E.EDIT) {
|
|
668
|
-
const { position: v, heightOffset: u } =
|
|
668
|
+
const { position: v, heightOffset: u } = t.value;
|
|
669
669
|
a === P.RELATIVE ? i.maps.activeMap.getHeightFromTerrain([z.wgs84ToMercator(v)]).then((C) => {
|
|
670
670
|
const V = z.mercatorToWgs84(C[0]);
|
|
671
|
-
|
|
672
|
-
}) : (
|
|
671
|
+
t.value && (t.value.heightOffset = v[2] - V[2], t.value.position = V);
|
|
672
|
+
}) : (t.value.position = [
|
|
673
673
|
v[0],
|
|
674
674
|
v[1],
|
|
675
675
|
v[2] + u
|
|
676
|
-
],
|
|
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
|
-
currentFeatures:
|
|
683
|
+
currentEditSession: w,
|
|
684
|
+
currentFeatures: c,
|
|
685
685
|
createViewshed: y,
|
|
686
686
|
viewViewshed(a) {
|
|
687
687
|
S(E.VIEW, a);
|
|
@@ -690,22 +690,22 @@ function Lt(i, t, o) {
|
|
|
690
690
|
S(E.EDIT, a), s.value && (o.setSelection(a.name), o.collectionComponent.openEditorWindow(a));
|
|
691
691
|
},
|
|
692
692
|
persistCurrent() {
|
|
693
|
-
|
|
693
|
+
t.value && (o.add(t.value), s.value = !0, o.setSelection(t.value.name), o.setVisibility(t.value.name, !0));
|
|
694
694
|
},
|
|
695
|
-
moveCurrentViewshed:
|
|
695
|
+
moveCurrentViewshed: x,
|
|
696
696
|
setupMultiSelect() {
|
|
697
|
-
|
|
697
|
+
l(), n.value = E.MULTI_SELECT, f(), t.value = null;
|
|
698
698
|
},
|
|
699
699
|
mode: n,
|
|
700
|
-
heightMode:
|
|
700
|
+
heightMode: r,
|
|
701
701
|
changeHeightMode: T,
|
|
702
702
|
async placeCurrentFeaturesOnTerrain() {
|
|
703
703
|
var a, v;
|
|
704
|
-
if (
|
|
704
|
+
if (t.value && ((a = w.value) == null ? void 0 : a.type) === De.EDIT_FEATURES && i.maps.activeMap instanceof U) {
|
|
705
705
|
const C = (await i.maps.activeMap.getHeightFromTerrain([
|
|
706
|
-
z.wgs84ToMercator((v =
|
|
707
|
-
]))[0][2] -
|
|
708
|
-
|
|
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);
|
|
709
709
|
}
|
|
710
710
|
},
|
|
711
711
|
stop: m,
|
|
@@ -714,10 +714,10 @@ function Lt(i, t, o) {
|
|
|
714
714
|
}
|
|
715
715
|
};
|
|
716
716
|
}
|
|
717
|
-
const
|
|
717
|
+
const Oe = (i, e) => {
|
|
718
718
|
const o = i.__vccOpts || i;
|
|
719
|
-
for (const [
|
|
720
|
-
o[
|
|
719
|
+
for (const [t, s] of e)
|
|
720
|
+
o[t] = s;
|
|
721
721
|
return o;
|
|
722
722
|
}, Ft = {
|
|
723
723
|
distance: [D.MIN_DISTANCE, 2e3],
|
|
@@ -726,18 +726,18 @@ const Se = (i, t) => {
|
|
|
726
726
|
pitch: [-90, 90]
|
|
727
727
|
}, jt = {
|
|
728
728
|
components: {
|
|
729
|
-
VcsTextField:
|
|
730
|
-
VContainer:
|
|
731
|
-
VRow:
|
|
732
|
-
VCol:
|
|
733
|
-
VcsSlider:
|
|
734
|
-
VcsLabel:
|
|
735
|
-
VcsFormSection:
|
|
729
|
+
VcsTextField: lt,
|
|
730
|
+
VContainer: Ve,
|
|
731
|
+
VRow: be,
|
|
732
|
+
VCol: Me,
|
|
733
|
+
VcsSlider: dt,
|
|
734
|
+
VcsLabel: Ce,
|
|
735
|
+
VcsFormSection: Ee,
|
|
736
736
|
VDivider: Ct,
|
|
737
|
-
VcsSelect:
|
|
738
|
-
VcsFormButton:
|
|
739
|
-
VcsFeatureTransforms:
|
|
740
|
-
VcsHelp:
|
|
737
|
+
VcsSelect: ye,
|
|
738
|
+
VcsFormButton: ct,
|
|
739
|
+
VcsFeatureTransforms: ut,
|
|
740
|
+
VcsHelp: ht
|
|
741
741
|
},
|
|
742
742
|
name: "ViewshedWindow",
|
|
743
743
|
props: {
|
|
@@ -754,58 +754,58 @@ const Se = (i, t) => {
|
|
|
754
754
|
},
|
|
755
755
|
setup(i) {
|
|
756
756
|
var v;
|
|
757
|
-
const
|
|
757
|
+
const e = (
|
|
758
758
|
/** @type {import("./viewshedManager.js").ViewshedManager} */
|
|
759
759
|
me("manager")
|
|
760
760
|
), o = (
|
|
761
761
|
/** @type {import("@vcmap/ui").VcsUiApp} */
|
|
762
762
|
me("vcsApp")
|
|
763
763
|
), {
|
|
764
|
-
currentViewshed:
|
|
764
|
+
currentViewshed: t,
|
|
765
765
|
mode: s,
|
|
766
766
|
currentIsPersisted: n
|
|
767
|
-
} =
|
|
767
|
+
} = e, r = $(
|
|
768
768
|
((v = o.maps.activeMap) == null ? void 0 : v.movementApiCallsDisabled) ?? !1
|
|
769
769
|
);
|
|
770
|
-
let
|
|
770
|
+
let l = () => {
|
|
771
771
|
};
|
|
772
|
-
const
|
|
773
|
-
let
|
|
772
|
+
const w = ve(() => i.selection);
|
|
773
|
+
let c = () => {
|
|
774
774
|
};
|
|
775
|
-
const
|
|
775
|
+
const d = J({
|
|
776
776
|
X: void 0,
|
|
777
777
|
Y: void 0,
|
|
778
778
|
Z: void 0
|
|
779
|
-
}), f =
|
|
779
|
+
}), f = q();
|
|
780
780
|
let m = () => {
|
|
781
781
|
};
|
|
782
|
-
const
|
|
782
|
+
const _ = J({
|
|
783
783
|
showPrimitive: !1,
|
|
784
784
|
distance: void 0,
|
|
785
785
|
fov: void 0,
|
|
786
786
|
heading: void 0,
|
|
787
787
|
pitch: void 0
|
|
788
|
-
}), y =
|
|
789
|
-
function
|
|
790
|
-
|
|
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);
|
|
791
791
|
}
|
|
792
792
|
function S() {
|
|
793
|
-
|
|
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);
|
|
794
794
|
}
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
Qe(() => {
|
|
796
|
+
t.value && s.value !== E.CREATE && S();
|
|
797
797
|
}), G(
|
|
798
|
-
|
|
798
|
+
t,
|
|
799
799
|
() => {
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
t.value && (c(), c = t.value.positionChanged.addEventListener(() => {
|
|
801
|
+
x(), m();
|
|
802
802
|
}));
|
|
803
803
|
},
|
|
804
804
|
{ immediate: !0 }
|
|
805
805
|
);
|
|
806
806
|
async function L() {
|
|
807
807
|
var V, O;
|
|
808
|
-
(V =
|
|
808
|
+
(V = t.value) == null || V.deactivate();
|
|
809
809
|
const u = (
|
|
810
810
|
/** @type {import("@vcmap/core").CesiumMap} */
|
|
811
811
|
(O = o.maps.activeMap.getScene()) == null ? void 0 : O.camera
|
|
@@ -814,46 +814,46 @@ const Se = (i, t) => {
|
|
|
814
814
|
});
|
|
815
815
|
m = () => {
|
|
816
816
|
var K;
|
|
817
|
-
C == null || C(), f.value = null, (K =
|
|
817
|
+
C == null || C(), f.value = null, (K = t.value) == null || K.activate(o.maps.activeMap), m = () => {
|
|
818
818
|
};
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
|
-
|
|
821
|
+
et(() => {
|
|
822
822
|
var C, V;
|
|
823
823
|
const u = (C = i.getViewshed) == null ? void 0 : C.call(i);
|
|
824
|
-
u &&
|
|
824
|
+
u && e.editViewshed(u), l = (V = o.maps.activeMap) == null ? void 0 : V.movementDisabledChanged.addEventListener(
|
|
825
825
|
(O) => {
|
|
826
|
-
|
|
826
|
+
r.value = O.apiCalls;
|
|
827
827
|
}
|
|
828
828
|
);
|
|
829
|
-
}),
|
|
830
|
-
|
|
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) : (
|
|
831
831
|
// when a persited viewshed is deselected, stops plugin
|
|
832
|
-
!
|
|
832
|
+
!w.value.length && s.value === E.EDIT && e.stop(!1)
|
|
833
833
|
));
|
|
834
834
|
}), S();
|
|
835
835
|
function T(u, C) {
|
|
836
|
-
m(),
|
|
836
|
+
m(), t.value && (_[u] = C, t.value[u] = C);
|
|
837
837
|
}
|
|
838
838
|
const a = ve(() => {
|
|
839
839
|
const u = [];
|
|
840
|
-
return y.value ===
|
|
840
|
+
return y.value === g.CONE && u.push({
|
|
841
841
|
name: "jumpToViewpoint",
|
|
842
842
|
title: f.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
|
|
843
843
|
icon: "mdi-human-male",
|
|
844
844
|
active: !!f.value,
|
|
845
|
-
disabled:
|
|
845
|
+
disabled: r.value,
|
|
846
846
|
async callback() {
|
|
847
847
|
var C, V, O;
|
|
848
|
-
|
|
849
|
-
new
|
|
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({
|
|
850
850
|
groundPosition: [
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
851
|
+
t.value.position[0],
|
|
852
|
+
t.value.position[1],
|
|
853
|
+
t.value.position[2] + t.value.heightOffset
|
|
854
854
|
],
|
|
855
|
-
heading:
|
|
856
|
-
pitch:
|
|
855
|
+
heading: t.value.heading,
|
|
856
|
+
pitch: t.value.pitch,
|
|
857
857
|
distance: 0,
|
|
858
858
|
animate: !0
|
|
859
859
|
// if not animate, async does not work and the cameraChanged listener is triggered immediately. alternatively set timeout
|
|
@@ -863,10 +863,10 @@ const Se = (i, t) => {
|
|
|
863
863
|
}), u.push({
|
|
864
864
|
name: "moveViewshed",
|
|
865
865
|
title: "viewshed.move",
|
|
866
|
-
icon:
|
|
866
|
+
icon: e.heightMode.value === P.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
|
|
867
867
|
active: s.value === E.MOVE,
|
|
868
868
|
callback() {
|
|
869
|
-
|
|
869
|
+
e.moveCurrentViewshed(
|
|
870
870
|
s.value !== E.MOVE
|
|
871
871
|
);
|
|
872
872
|
}
|
|
@@ -874,42 +874,42 @@ const Se = (i, t) => {
|
|
|
874
874
|
name: "showPrimitive",
|
|
875
875
|
title: "viewshed.showPrimitive",
|
|
876
876
|
icon: "mdi-eye",
|
|
877
|
-
active:
|
|
877
|
+
active: _.showPrimitive,
|
|
878
878
|
callback() {
|
|
879
879
|
this.active = !this.active, T("showPrimitive", this.active);
|
|
880
880
|
}
|
|
881
881
|
}), u;
|
|
882
882
|
});
|
|
883
883
|
return {
|
|
884
|
-
position:
|
|
884
|
+
position: d,
|
|
885
885
|
setPosition(u, C, V) {
|
|
886
|
-
if (m(), !!
|
|
887
|
-
if (V === 2 &&
|
|
888
|
-
|
|
886
|
+
if (m(), !!t.value) {
|
|
887
|
+
if (V === 2 && e.heightMode.value === P.RELATIVE)
|
|
888
|
+
t.value.heightOffset = Number(u);
|
|
889
889
|
else {
|
|
890
|
-
const O = [...
|
|
891
|
-
O[V] = Number(u),
|
|
890
|
+
const O = [...t.value.position];
|
|
891
|
+
O[V] = Number(u), t.value.position = O;
|
|
892
892
|
}
|
|
893
|
-
|
|
893
|
+
d[C] = Number(u);
|
|
894
894
|
}
|
|
895
895
|
},
|
|
896
|
-
parameters:
|
|
896
|
+
parameters: _,
|
|
897
897
|
setParameter: T,
|
|
898
898
|
parameterRanges: Ft,
|
|
899
899
|
ViewshedPluginModes: E,
|
|
900
900
|
viewshedMode: s,
|
|
901
901
|
currentIsPersisted: n,
|
|
902
902
|
viewshedType: y,
|
|
903
|
-
ViewshedTypes:
|
|
903
|
+
ViewshedTypes: g,
|
|
904
904
|
HeightModes: P,
|
|
905
|
-
heightMode:
|
|
906
|
-
TransformationMode:
|
|
907
|
-
changeHeightMode:
|
|
905
|
+
heightMode: e.heightMode,
|
|
906
|
+
TransformationMode: Ue,
|
|
907
|
+
changeHeightMode: e.changeHeightMode,
|
|
908
908
|
async createNewViewshed() {
|
|
909
|
-
await
|
|
909
|
+
await e.createViewshed(y.value);
|
|
910
910
|
},
|
|
911
|
-
addToMyWorkspace: () =>
|
|
912
|
-
cancel: () =>
|
|
911
|
+
addToMyWorkspace: () => e.persistCurrent(),
|
|
912
|
+
cancel: () => e.stop(),
|
|
913
913
|
headerActions: a
|
|
914
914
|
};
|
|
915
915
|
}
|
|
@@ -920,11 +920,11 @@ const Se = (i, t) => {
|
|
|
920
920
|
key: 4,
|
|
921
921
|
class: "d-flex w-full justify-end px-2 pt-2 pb-1"
|
|
922
922
|
};
|
|
923
|
-
function Gt(i,
|
|
924
|
-
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");
|
|
925
925
|
return M(), B("div", null, [
|
|
926
|
-
|
|
927
|
-
|
|
926
|
+
t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", Wt, [
|
|
927
|
+
t.viewshedType === t.ViewshedTypes.CONE ? (M(), N(r, { key: 0 }, {
|
|
928
928
|
default: h(() => [
|
|
929
929
|
F(
|
|
930
930
|
A(i.$t("viewshed.createDescription")),
|
|
@@ -934,7 +934,7 @@ function Gt(i, t, o, e, s, n) {
|
|
|
934
934
|
]),
|
|
935
935
|
_: 1
|
|
936
936
|
/* STABLE */
|
|
937
|
-
})) :
|
|
937
|
+
})) : t.viewshedType === t.ViewshedTypes.THREESIXTY ? (M(), N(r, { key: 1 }, {
|
|
938
938
|
default: h(() => [
|
|
939
939
|
F(
|
|
940
940
|
A(i.$t("viewshed.createThreeSixtyDescription")),
|
|
@@ -945,18 +945,18 @@ function Gt(i, t, o, e, s, n) {
|
|
|
945
945
|
_: 1
|
|
946
946
|
/* STABLE */
|
|
947
947
|
})) : H("v-if", !0)
|
|
948
|
-
])) :
|
|
948
|
+
])) : t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(m, {
|
|
949
949
|
key: 1,
|
|
950
|
-
"header-actions":
|
|
950
|
+
"header-actions": t.headerActions,
|
|
951
951
|
heading: "viewshed.viewpoint",
|
|
952
952
|
"action-button-list-overflow-count": 3
|
|
953
953
|
}, {
|
|
954
954
|
default: h(() => [
|
|
955
955
|
p(f, { class: "px-1 py-0" }, {
|
|
956
956
|
default: h(() => [
|
|
957
|
-
p(
|
|
957
|
+
p(l, { "no-gutters": "" }, {
|
|
958
958
|
default: h(() => [
|
|
959
|
-
|
|
959
|
+
it(
|
|
960
960
|
"span",
|
|
961
961
|
Bt,
|
|
962
962
|
A(i.$t("viewshed.position")),
|
|
@@ -967,13 +967,13 @@ function Gt(i, t, o, e, s, n) {
|
|
|
967
967
|
_: 1
|
|
968
968
|
/* STABLE */
|
|
969
969
|
}),
|
|
970
|
-
|
|
970
|
+
t.viewshedMode === t.ViewshedPluginModes.MOVE && t.heightMode === t.HeightModes.ABSOLUTE ? (M(), N(l, {
|
|
971
971
|
key: 0,
|
|
972
972
|
"no-gutters": ""
|
|
973
973
|
}, {
|
|
974
974
|
default: h(() => [
|
|
975
|
-
p(
|
|
976
|
-
"transformation-mode":
|
|
975
|
+
p(w, {
|
|
976
|
+
"transformation-mode": t.TransformationMode.TRANSLATE,
|
|
977
977
|
"feature-properties": { altitudeMode: "absolute" },
|
|
978
978
|
"allow-z-input": !0,
|
|
979
979
|
class: "w-100"
|
|
@@ -981,7 +981,7 @@ function Gt(i, t, o, e, s, n) {
|
|
|
981
981
|
]),
|
|
982
982
|
_: 1
|
|
983
983
|
/* STABLE */
|
|
984
|
-
})) : (M(), N(
|
|
984
|
+
})) : (M(), N(l, {
|
|
985
985
|
key: 1,
|
|
986
986
|
"no-gutters": ""
|
|
987
987
|
}, {
|
|
@@ -989,23 +989,23 @@ function Gt(i, t, o, e, s, n) {
|
|
|
989
989
|
(M(!0), B(
|
|
990
990
|
pe,
|
|
991
991
|
null,
|
|
992
|
-
we(
|
|
993
|
-
|
|
992
|
+
we(t.position, (T, a, v) => (M(), N(
|
|
993
|
+
d,
|
|
994
994
|
{
|
|
995
995
|
key: v,
|
|
996
996
|
class: "pb-1"
|
|
997
997
|
},
|
|
998
998
|
{
|
|
999
999
|
default: h(() => [
|
|
1000
|
-
p(
|
|
1000
|
+
p(c, {
|
|
1001
1001
|
"model-value": T,
|
|
1002
|
-
"onUpdate:modelValue": (u) =>
|
|
1002
|
+
"onUpdate:modelValue": (u) => t.setPosition(u, a, v),
|
|
1003
1003
|
type: "number",
|
|
1004
1004
|
prefix: a,
|
|
1005
1005
|
step: a === "Z" ? 1 : 1e-4,
|
|
1006
1006
|
unit: a === "Z" ? "m" : "°",
|
|
1007
1007
|
decimals: a === "Z" ? 2 : 8,
|
|
1008
|
-
disabled:
|
|
1008
|
+
disabled: t.viewshedMode === t.ViewshedPluginModes.MOVE && !(a === "Z" && t.heightMode === t.HeightModes.RELATIVE),
|
|
1009
1009
|
"hide-spin-buttons": !0
|
|
1010
1010
|
}, null, 8, ["model-value", "onUpdate:modelValue", "prefix", "step", "unit", "decimals", "disabled"])
|
|
1011
1011
|
]),
|
|
@@ -1030,12 +1030,12 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1030
1030
|
_: 1
|
|
1031
1031
|
/* STABLE */
|
|
1032
1032
|
}, 8, ["header-actions"])) : H("v-if", !0),
|
|
1033
|
-
p(
|
|
1033
|
+
p(_),
|
|
1034
1034
|
p(f, { class: "px-1 py-0" }, {
|
|
1035
1035
|
default: h(() => [
|
|
1036
|
-
p(
|
|
1036
|
+
p(l, { "no-gutters": "" }, {
|
|
1037
1037
|
default: h(() => [
|
|
1038
|
-
p(
|
|
1038
|
+
p(d, null, {
|
|
1039
1039
|
default: h(() => [
|
|
1040
1040
|
p(y, { "html-for": "heightMode" }, {
|
|
1041
1041
|
default: h(() => [
|
|
@@ -1052,16 +1052,16 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1052
1052
|
_: 1
|
|
1053
1053
|
/* STABLE */
|
|
1054
1054
|
}),
|
|
1055
|
-
p(
|
|
1055
|
+
p(d, null, {
|
|
1056
1056
|
default: h(() => [
|
|
1057
|
-
p(
|
|
1057
|
+
p(x, {
|
|
1058
1058
|
id: "heightMode",
|
|
1059
|
-
items: Object.values(
|
|
1059
|
+
items: Object.values(t.HeightModes).map((T) => ({
|
|
1060
1060
|
value: T,
|
|
1061
1061
|
title: `viewshed.${T}`
|
|
1062
1062
|
})),
|
|
1063
|
-
"model-value":
|
|
1064
|
-
"onUpdate:modelValue":
|
|
1063
|
+
"model-value": t.heightMode,
|
|
1064
|
+
"onUpdate:modelValue": t.changeHeightMode
|
|
1065
1065
|
}, null, 8, ["items", "model-value", "onUpdate:modelValue"])
|
|
1066
1066
|
]),
|
|
1067
1067
|
_: 1
|
|
@@ -1075,7 +1075,7 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1075
1075
|
_: 1
|
|
1076
1076
|
/* STABLE */
|
|
1077
1077
|
}),
|
|
1078
|
-
|
|
1078
|
+
t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(f, {
|
|
1079
1079
|
key: 2,
|
|
1080
1080
|
class: "px-1 pt-0 pb-2"
|
|
1081
1081
|
}, {
|
|
@@ -1083,21 +1083,21 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1083
1083
|
(M(!0), B(
|
|
1084
1084
|
pe,
|
|
1085
1085
|
null,
|
|
1086
|
-
we(
|
|
1087
|
-
|
|
1086
|
+
we(t.parameters, (T, a) => (M(), N(
|
|
1087
|
+
l,
|
|
1088
1088
|
{
|
|
1089
1089
|
"no-gutters": "",
|
|
1090
1090
|
key: a
|
|
1091
1091
|
},
|
|
1092
1092
|
{
|
|
1093
1093
|
default: h(() => [
|
|
1094
|
-
a === "distance" ||
|
|
1095
|
-
|
|
1094
|
+
a === "distance" || t.viewshedType === t.ViewshedTypes.CONE && a !== "showPrimitive" ? (M(), N(
|
|
1095
|
+
d,
|
|
1096
1096
|
{ key: 0 },
|
|
1097
1097
|
{
|
|
1098
1098
|
default: h(() => [
|
|
1099
1099
|
p(
|
|
1100
|
-
|
|
1100
|
+
l,
|
|
1101
1101
|
{
|
|
1102
1102
|
"no-gutters": "",
|
|
1103
1103
|
class: "px-1"
|
|
@@ -1105,7 +1105,7 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1105
1105
|
{
|
|
1106
1106
|
default: h(() => [
|
|
1107
1107
|
p(
|
|
1108
|
-
|
|
1108
|
+
d,
|
|
1109
1109
|
null,
|
|
1110
1110
|
{
|
|
1111
1111
|
default: h(() => [
|
|
@@ -1131,7 +1131,7 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1131
1131
|
/* DYNAMIC_SLOTS */
|
|
1132
1132
|
),
|
|
1133
1133
|
p(
|
|
1134
|
-
|
|
1134
|
+
d,
|
|
1135
1135
|
{ class: "d-flex justify-end align-center" },
|
|
1136
1136
|
{
|
|
1137
1137
|
default: h(() => [
|
|
@@ -1163,12 +1163,12 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1163
1163
|
/* DYNAMIC_SLOTS */
|
|
1164
1164
|
),
|
|
1165
1165
|
p(
|
|
1166
|
-
|
|
1166
|
+
l,
|
|
1167
1167
|
{ "no-gutters": "" },
|
|
1168
1168
|
{
|
|
1169
1169
|
default: h(() => [
|
|
1170
1170
|
p(
|
|
1171
|
-
|
|
1171
|
+
d,
|
|
1172
1172
|
null,
|
|
1173
1173
|
{
|
|
1174
1174
|
default: h(() => [
|
|
@@ -1176,11 +1176,11 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1176
1176
|
id: a,
|
|
1177
1177
|
class: "pa-0",
|
|
1178
1178
|
"model-value": T,
|
|
1179
|
-
"onUpdate:modelValue": (v) =>
|
|
1179
|
+
"onUpdate:modelValue": (v) => t.setParameter(a, v),
|
|
1180
1180
|
type: "number",
|
|
1181
1181
|
step: "1",
|
|
1182
|
-
min:
|
|
1183
|
-
max:
|
|
1182
|
+
min: t.parameterRanges[a][0],
|
|
1183
|
+
max: t.parameterRanges[a][1]
|
|
1184
1184
|
}, null, 8, ["id", "model-value", "onUpdate:modelValue", "min", "max"])
|
|
1185
1185
|
]),
|
|
1186
1186
|
_: 2
|
|
@@ -1217,16 +1217,16 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1217
1217
|
_: 1
|
|
1218
1218
|
/* STABLE */
|
|
1219
1219
|
})) : H("v-if", !0),
|
|
1220
|
-
p(
|
|
1221
|
-
|
|
1220
|
+
p(_),
|
|
1221
|
+
t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), B("div", Ht, [
|
|
1222
1222
|
p(L, {
|
|
1223
|
-
onClick:
|
|
1223
|
+
onClick: e[0] || (e[0] = (T) => t.addToMyWorkspace()),
|
|
1224
1224
|
tooltip: "viewshed.addToMyWorkspace",
|
|
1225
1225
|
icon: "$vcsComponentsPlus",
|
|
1226
|
-
disabled:
|
|
1226
|
+
disabled: t.currentIsPersisted || void 0
|
|
1227
1227
|
}, null, 8, ["disabled"]),
|
|
1228
1228
|
p(L, {
|
|
1229
|
-
onClick:
|
|
1229
|
+
onClick: e[1] || (e[1] = (T) => t.createNewViewshed()),
|
|
1230
1230
|
variant: "filled"
|
|
1231
1231
|
}, {
|
|
1232
1232
|
default: h(() => [
|
|
@@ -1239,9 +1239,9 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1239
1239
|
_: 1
|
|
1240
1240
|
/* STABLE */
|
|
1241
1241
|
})
|
|
1242
|
-
])) :
|
|
1242
|
+
])) : t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", zt, [
|
|
1243
1243
|
p(L, {
|
|
1244
|
-
onClick:
|
|
1244
|
+
onClick: e[2] || (e[2] = (T) => t.cancel()),
|
|
1245
1245
|
variant: "outlined"
|
|
1246
1246
|
}, {
|
|
1247
1247
|
default: h(() => [
|
|
@@ -1257,146 +1257,166 @@ function Gt(i, t, o, e, s, n) {
|
|
|
1257
1257
|
])) : H("v-if", !0)
|
|
1258
1258
|
]);
|
|
1259
1259
|
}
|
|
1260
|
-
const Kt = /* @__PURE__ */
|
|
1261
|
-
[
|
|
1262
|
-
[
|
|
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"
|
|
1263
1263
|
};
|
|
1264
|
-
function Jt(i,
|
|
1265
|
-
const
|
|
1264
|
+
function Jt(i, e, o) {
|
|
1265
|
+
const t = $(), s = $(), n = `${o.id}-editor`, r = {
|
|
1266
1266
|
component: Kt,
|
|
1267
1267
|
provides: {
|
|
1268
1268
|
manager: i
|
|
1269
1269
|
},
|
|
1270
1270
|
state: {
|
|
1271
|
-
headerTitle:
|
|
1271
|
+
headerTitle: t,
|
|
1272
1272
|
headerIcon: s,
|
|
1273
1273
|
styles: { width: "280px", height: "auto" },
|
|
1274
|
-
infoUrlCallback:
|
|
1274
|
+
infoUrlCallback: e.getHelpUrlCallback("tools/viewshed.html")
|
|
1275
1275
|
}
|
|
1276
1276
|
};
|
|
1277
|
-
|
|
1277
|
+
ft(e, o, {
|
|
1278
1278
|
editor: (m) => ({
|
|
1279
|
-
...
|
|
1279
|
+
...r,
|
|
1280
1280
|
props: {
|
|
1281
1281
|
selection: o.selection,
|
|
1282
1282
|
getViewshed: () => o.collection.getByKey(m.name)
|
|
1283
1283
|
}
|
|
1284
1284
|
})
|
|
1285
1285
|
});
|
|
1286
|
-
function
|
|
1287
|
-
i.currentViewshed.value && (s.value = ne[i.currentViewshed.value.type], i.currentIsPersisted.value ?
|
|
1286
|
+
function l() {
|
|
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 = [
|
|
1288
1288
|
"viewshed.temporary",
|
|
1289
1289
|
`viewshed.${i.currentViewshed.value.type}`
|
|
1290
1290
|
]);
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1293
|
-
|
|
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(
|
|
1294
1294
|
{
|
|
1295
|
-
...
|
|
1295
|
+
...r,
|
|
1296
1296
|
id: n,
|
|
1297
1297
|
parentId: "category-manager",
|
|
1298
|
-
slot:
|
|
1298
|
+
slot: mt.DYNAMIC_CHILD
|
|
1299
1299
|
},
|
|
1300
1300
|
j
|
|
1301
1301
|
));
|
|
1302
1302
|
}
|
|
1303
|
-
const
|
|
1303
|
+
const c = G(i.currentViewshed, (m) => {
|
|
1304
|
+
m && w();
|
|
1305
|
+
}), d = G(i.currentIsPersisted, (m) => {
|
|
1304
1306
|
m && l();
|
|
1305
|
-
}), c = G(i.currentIsPersisted, (m) => {
|
|
1306
|
-
m && r();
|
|
1307
1307
|
}), f = G(i.mode, () => {
|
|
1308
|
-
i.mode.value ?
|
|
1308
|
+
i.mode.value ? w() : e.windowManager.remove(n);
|
|
1309
1309
|
});
|
|
1310
1310
|
return {
|
|
1311
1311
|
destroy() {
|
|
1312
|
-
|
|
1312
|
+
e.windowManager.remove(n), c(), f(), d();
|
|
1313
1313
|
}
|
|
1314
1314
|
};
|
|
1315
1315
|
}
|
|
1316
|
-
function Zt(i,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
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);
|
|
1331
1340
|
}
|
|
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
|
-
|
|
1358
|
-
|
|
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;
|
|
1359
1379
|
});
|
|
1360
1380
|
return {
|
|
1361
1381
|
destroy() {
|
|
1362
|
-
|
|
1382
|
+
l(), r == null || r(), w();
|
|
1363
1383
|
},
|
|
1364
|
-
toolbox:
|
|
1384
|
+
toolbox: n
|
|
1365
1385
|
};
|
|
1366
1386
|
}
|
|
1367
|
-
function qt(i,
|
|
1368
|
-
le(
|
|
1369
|
-
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;
|
|
1370
1390
|
return () => {
|
|
1371
|
-
i.toolboxManager.remove(
|
|
1391
|
+
i.toolboxManager.remove(r), n();
|
|
1372
1392
|
};
|
|
1373
1393
|
}
|
|
1374
|
-
class ae extends
|
|
1394
|
+
class ae extends $e {
|
|
1375
1395
|
static get className() {
|
|
1376
1396
|
return "ViewshedCategory";
|
|
1377
1397
|
}
|
|
1378
|
-
async _deserializeItem(
|
|
1379
|
-
var
|
|
1398
|
+
async _deserializeItem(e) {
|
|
1399
|
+
var t;
|
|
1380
1400
|
if (
|
|
1381
1401
|
/** @type {import("@vcmap/core").CesiumMap | undefined} */
|
|
1382
|
-
(
|
|
1402
|
+
(t = this._app) == null ? void 0 : t.maps.getByType(U.className)[0]
|
|
1383
1403
|
)
|
|
1384
|
-
return new D(
|
|
1404
|
+
return new D(e);
|
|
1385
1405
|
throw new Error("No CesiumMap available");
|
|
1386
1406
|
}
|
|
1387
1407
|
}
|
|
1388
|
-
function Qt(i,
|
|
1389
|
-
let o,
|
|
1408
|
+
function Qt(i, e) {
|
|
1409
|
+
let o, t = 0;
|
|
1390
1410
|
const s = new Set(
|
|
1391
|
-
|
|
1411
|
+
e.filter((n) => n.type === i).map((n) => n.properties.title)
|
|
1392
1412
|
);
|
|
1393
1413
|
do
|
|
1394
|
-
|
|
1414
|
+
t += 1, s.has(`${i}-${t}`) || (o = `${i}-${t}`);
|
|
1395
1415
|
while (!o);
|
|
1396
1416
|
return o;
|
|
1397
1417
|
}
|
|
1398
1418
|
async function ei(i) {
|
|
1399
|
-
const
|
|
1419
|
+
const e = new X(), o = new X(), { collectionComponent: t, category: s } = await i.categoryManager.requestCategory(
|
|
1400
1420
|
{
|
|
1401
1421
|
type: ae.className,
|
|
1402
1422
|
name: "Viewsheds",
|
|
@@ -1409,22 +1429,22 @@ async function ei(i) {
|
|
|
1409
1429
|
removable: !0
|
|
1410
1430
|
}
|
|
1411
1431
|
);
|
|
1412
|
-
|
|
1432
|
+
t.addItemMapping({
|
|
1413
1433
|
mappingFunction: vt(
|
|
1414
|
-
[
|
|
1434
|
+
[U.className],
|
|
1415
1435
|
i.maps
|
|
1416
1436
|
),
|
|
1417
1437
|
owner: j
|
|
1418
1438
|
});
|
|
1419
|
-
const n = (
|
|
1420
|
-
m.title =
|
|
1421
|
-
|
|
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: _ });
|
|
1422
1442
|
}, m.actions.push(
|
|
1423
|
-
|
|
1443
|
+
J({
|
|
1424
1444
|
name: "visibilityAction",
|
|
1425
1445
|
icon: "$vcsCheckbox",
|
|
1426
1446
|
callback() {
|
|
1427
|
-
o.raiseEvent(
|
|
1447
|
+
o.raiseEvent(d);
|
|
1428
1448
|
}
|
|
1429
1449
|
})
|
|
1430
1450
|
);
|
|
@@ -1433,27 +1453,27 @@ async function ei(i) {
|
|
|
1433
1453
|
() => !0,
|
|
1434
1454
|
n,
|
|
1435
1455
|
j,
|
|
1436
|
-
[
|
|
1456
|
+
[t.id]
|
|
1437
1457
|
);
|
|
1438
|
-
const { action:
|
|
1439
|
-
|
|
1458
|
+
const { action: r, destroy: l } = pt(
|
|
1459
|
+
t.selection,
|
|
1440
1460
|
() => {
|
|
1441
|
-
const
|
|
1442
|
-
(f) =>
|
|
1461
|
+
const d = t.selection.value.map(
|
|
1462
|
+
(f) => t.collection.getByKey(f.name)
|
|
1443
1463
|
);
|
|
1444
|
-
wt(JSON.stringify(
|
|
1464
|
+
wt(JSON.stringify(d), "viewsheds.json");
|
|
1445
1465
|
},
|
|
1446
1466
|
j
|
|
1447
|
-
), { action:
|
|
1448
|
-
async (
|
|
1449
|
-
const { vueI18n: f } = i,
|
|
1450
|
-
|
|
1467
|
+
), { action: w, destroy: c } = gt(
|
|
1468
|
+
async (d) => {
|
|
1469
|
+
const { vueI18n: f } = i, _ = (await Promise.all(
|
|
1470
|
+
d.map(async (S) => {
|
|
1451
1471
|
const L = await S.text();
|
|
1452
1472
|
try {
|
|
1453
1473
|
return JSON.parse(L).map((a) => new D(a));
|
|
1454
1474
|
} catch {
|
|
1455
1475
|
i.notifier.add({
|
|
1456
|
-
type:
|
|
1476
|
+
type: Z.ERROR,
|
|
1457
1477
|
message: f.t("components.import.failure", {
|
|
1458
1478
|
fileName: S.name
|
|
1459
1479
|
})
|
|
@@ -1461,22 +1481,22 @@ async function ei(i) {
|
|
|
1461
1481
|
}
|
|
1462
1482
|
return [];
|
|
1463
1483
|
})
|
|
1464
|
-
)).flat(), y =
|
|
1465
|
-
if (
|
|
1484
|
+
)).flat(), y = _.map((S) => s.collection.add(S)).filter((S) => S != null), x = _.length - y.length;
|
|
1485
|
+
if (x > 0)
|
|
1466
1486
|
return i.notifier.add({
|
|
1467
|
-
type:
|
|
1468
|
-
message: f.t("components.import.addFailure", [
|
|
1487
|
+
type: Z.WARNING,
|
|
1488
|
+
message: f.t("components.import.addFailure", [x])
|
|
1469
1489
|
}), !1;
|
|
1470
1490
|
if (y.length > 0)
|
|
1471
1491
|
i.notifier.add({
|
|
1472
|
-
type:
|
|
1492
|
+
type: Z.SUCCESS,
|
|
1473
1493
|
message: f.t("components.import.featuresAdded", [
|
|
1474
1494
|
y.length
|
|
1475
1495
|
])
|
|
1476
1496
|
});
|
|
1477
1497
|
else
|
|
1478
1498
|
return i.notifier.add({
|
|
1479
|
-
type:
|
|
1499
|
+
type: Z.ERROR,
|
|
1480
1500
|
message: f.t("components.import.nothingAdded")
|
|
1481
1501
|
}), !1;
|
|
1482
1502
|
return !0;
|
|
@@ -1485,62 +1505,62 @@ async function ei(i) {
|
|
|
1485
1505
|
j,
|
|
1486
1506
|
"category-manager"
|
|
1487
1507
|
);
|
|
1488
|
-
return
|
|
1489
|
-
renamed:
|
|
1508
|
+
return t.addActions([r, w]), {
|
|
1509
|
+
renamed: e,
|
|
1490
1510
|
visibilityChanged: o,
|
|
1491
|
-
setSelection(
|
|
1492
|
-
|
|
1511
|
+
setSelection(d) {
|
|
1512
|
+
d && (t.selection.value = t.items.value.filter((f) => d === f.name));
|
|
1493
1513
|
},
|
|
1494
1514
|
clearSelection() {
|
|
1495
|
-
|
|
1515
|
+
t.selection.value.length && (t.selection.value = []);
|
|
1496
1516
|
},
|
|
1497
|
-
setVisibility(
|
|
1498
|
-
const m =
|
|
1499
|
-
(
|
|
1517
|
+
setVisibility(d, f) {
|
|
1518
|
+
const m = t.items.value.find(
|
|
1519
|
+
(_) => d === _.name
|
|
1500
1520
|
);
|
|
1501
1521
|
if (m) {
|
|
1502
|
-
const
|
|
1522
|
+
const _ = m.actions.find(
|
|
1503
1523
|
(y) => y.name === "visibilityAction"
|
|
1504
1524
|
);
|
|
1505
|
-
|
|
1525
|
+
_ && (_.icon = f ? "$vcsCheckboxChecked" : "$vcsCheckbox");
|
|
1506
1526
|
}
|
|
1507
1527
|
},
|
|
1508
|
-
add(
|
|
1509
|
-
|
|
1510
|
-
|
|
1528
|
+
add(d) {
|
|
1529
|
+
d.properties.title = Qt(
|
|
1530
|
+
d.type,
|
|
1511
1531
|
/** @type {import("./viewshed.js").default[]} */
|
|
1512
1532
|
[
|
|
1513
1533
|
...s.collection
|
|
1514
1534
|
]
|
|
1515
|
-
), s.collection.add(
|
|
1535
|
+
), s.collection.add(d);
|
|
1516
1536
|
},
|
|
1517
|
-
remove(
|
|
1518
|
-
const f = s.collection.getByKey(
|
|
1537
|
+
remove(d) {
|
|
1538
|
+
const f = s.collection.getByKey(d);
|
|
1519
1539
|
f && s.collection.remove(f);
|
|
1520
1540
|
},
|
|
1521
|
-
collectionComponent:
|
|
1541
|
+
collectionComponent: t,
|
|
1522
1542
|
destroy() {
|
|
1523
|
-
i.categoryManager.removeOwner(j),
|
|
1543
|
+
i.categoryManager.removeOwner(j), e.destroy(), o.destroy(), l(), c();
|
|
1524
1544
|
}
|
|
1525
1545
|
};
|
|
1526
1546
|
}
|
|
1527
|
-
function
|
|
1547
|
+
function Q() {
|
|
1528
1548
|
return {
|
|
1529
1549
|
visibleColor: D.getDefaultOptions().visibleColor,
|
|
1530
1550
|
shadowColor: D.getDefaultOptions().shadowColor,
|
|
1531
|
-
tools: [...Object.values(
|
|
1551
|
+
tools: [...Object.values(g)]
|
|
1532
1552
|
};
|
|
1533
1553
|
}
|
|
1534
1554
|
const ti = {
|
|
1535
1555
|
name: "ViewshedConfigEditor",
|
|
1536
1556
|
components: {
|
|
1537
1557
|
AbstractConfigEditor: _t,
|
|
1538
|
-
VcsFormSection:
|
|
1539
|
-
VContainer:
|
|
1540
|
-
VRow:
|
|
1541
|
-
VCol:
|
|
1542
|
-
VcsLabel:
|
|
1543
|
-
VcsSelect:
|
|
1558
|
+
VcsFormSection: Ee,
|
|
1559
|
+
VContainer: Ve,
|
|
1560
|
+
VRow: be,
|
|
1561
|
+
VCol: Me,
|
|
1562
|
+
VcsLabel: Ce,
|
|
1563
|
+
VcsSelect: ye,
|
|
1544
1564
|
VColorPicker: Et
|
|
1545
1565
|
},
|
|
1546
1566
|
props: {
|
|
@@ -1554,37 +1574,37 @@ const ti = {
|
|
|
1554
1574
|
}
|
|
1555
1575
|
},
|
|
1556
1576
|
setup(i) {
|
|
1557
|
-
const
|
|
1558
|
-
function
|
|
1577
|
+
const e = i.getConfig(), o = $({ ...Q(), ...e });
|
|
1578
|
+
function t() {
|
|
1559
1579
|
i.setConfig(o.value);
|
|
1560
1580
|
}
|
|
1561
1581
|
return {
|
|
1562
1582
|
localConfig: o,
|
|
1563
|
-
ViewshedTypes:
|
|
1564
|
-
apply:
|
|
1565
|
-
toolItems: Object.values(
|
|
1583
|
+
ViewshedTypes: g,
|
|
1584
|
+
apply: t,
|
|
1585
|
+
toolItems: Object.values(g).map((s) => ({
|
|
1566
1586
|
value: s,
|
|
1567
1587
|
title: `viewshed.${s}`
|
|
1568
1588
|
}))
|
|
1569
1589
|
};
|
|
1570
1590
|
}
|
|
1571
1591
|
};
|
|
1572
|
-
function ii(i,
|
|
1573
|
-
const
|
|
1574
|
-
return M(), N(
|
|
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 }), {
|
|
1575
1595
|
default: h(() => [
|
|
1576
|
-
|
|
1596
|
+
t.localConfig ? (M(), N(m, {
|
|
1577
1597
|
key: 0,
|
|
1578
1598
|
heading: "viewshed.editor.general"
|
|
1579
1599
|
}, {
|
|
1580
1600
|
default: h(() => [
|
|
1581
1601
|
p(f, { class: "px-1 py-0" }, {
|
|
1582
1602
|
default: h(() => [
|
|
1583
|
-
p(
|
|
1603
|
+
p(c, { "no-gutters": "" }, {
|
|
1584
1604
|
default: h(() => [
|
|
1585
|
-
p(
|
|
1605
|
+
p(l, null, {
|
|
1586
1606
|
default: h(() => [
|
|
1587
|
-
p(
|
|
1607
|
+
p(r, { "html-for": "viewshed-editor-tools" }, {
|
|
1588
1608
|
default: h(() => [
|
|
1589
1609
|
F(
|
|
1590
1610
|
A(i.$t("viewshed.editor.tools")),
|
|
@@ -1599,13 +1619,13 @@ function ii(i, t, o, e, s, n) {
|
|
|
1599
1619
|
_: 1
|
|
1600
1620
|
/* STABLE */
|
|
1601
1621
|
}),
|
|
1602
|
-
p(
|
|
1622
|
+
p(l, null, {
|
|
1603
1623
|
default: h(() => [
|
|
1604
|
-
p(
|
|
1624
|
+
p(w, {
|
|
1605
1625
|
id: "viewshed-tools",
|
|
1606
|
-
items:
|
|
1607
|
-
modelValue:
|
|
1608
|
-
"onUpdate:modelValue":
|
|
1626
|
+
items: t.toolItems,
|
|
1627
|
+
modelValue: t.localConfig.tools,
|
|
1628
|
+
"onUpdate:modelValue": e[0] || (e[0] = (y) => t.localConfig.tools = y),
|
|
1609
1629
|
multiple: !0
|
|
1610
1630
|
}, null, 8, ["items", "modelValue"])
|
|
1611
1631
|
]),
|
|
@@ -1616,11 +1636,11 @@ function ii(i, t, o, e, s, n) {
|
|
|
1616
1636
|
_: 1
|
|
1617
1637
|
/* STABLE */
|
|
1618
1638
|
}),
|
|
1619
|
-
p(
|
|
1639
|
+
p(c, { "no-gutters": "" }, {
|
|
1620
1640
|
default: h(() => [
|
|
1621
|
-
p(
|
|
1641
|
+
p(l, null, {
|
|
1622
1642
|
default: h(() => [
|
|
1623
|
-
p(
|
|
1643
|
+
p(r, { "html-for": "viewshed-editor-visible-color" }, {
|
|
1624
1644
|
default: h(() => [
|
|
1625
1645
|
F(
|
|
1626
1646
|
A(i.$t("viewshed.editor.visibleColor")),
|
|
@@ -1635,11 +1655,11 @@ function ii(i, t, o, e, s, n) {
|
|
|
1635
1655
|
_: 1
|
|
1636
1656
|
/* STABLE */
|
|
1637
1657
|
}),
|
|
1638
|
-
p(
|
|
1658
|
+
p(l, null, {
|
|
1639
1659
|
default: h(() => [
|
|
1640
|
-
p(
|
|
1641
|
-
modelValue:
|
|
1642
|
-
"onUpdate:modelValue":
|
|
1660
|
+
p(d, {
|
|
1661
|
+
modelValue: t.localConfig.visibleColor,
|
|
1662
|
+
"onUpdate:modelValue": e[1] || (e[1] = (y) => t.localConfig.visibleColor = y),
|
|
1643
1663
|
mode: "rgba"
|
|
1644
1664
|
}, null, 8, ["modelValue"])
|
|
1645
1665
|
]),
|
|
@@ -1650,11 +1670,11 @@ function ii(i, t, o, e, s, n) {
|
|
|
1650
1670
|
_: 1
|
|
1651
1671
|
/* STABLE */
|
|
1652
1672
|
}),
|
|
1653
|
-
p(
|
|
1673
|
+
p(c, { "no-gutters": "" }, {
|
|
1654
1674
|
default: h(() => [
|
|
1655
|
-
p(
|
|
1675
|
+
p(l, null, {
|
|
1656
1676
|
default: h(() => [
|
|
1657
|
-
p(
|
|
1677
|
+
p(r, { "html-for": "viewshed-editor-shadow-color" }, {
|
|
1658
1678
|
default: h(() => [
|
|
1659
1679
|
F(
|
|
1660
1680
|
A(i.$t("viewshed.editor.shadowColor")),
|
|
@@ -1669,11 +1689,11 @@ function ii(i, t, o, e, s, n) {
|
|
|
1669
1689
|
_: 1
|
|
1670
1690
|
/* STABLE */
|
|
1671
1691
|
}),
|
|
1672
|
-
p(
|
|
1692
|
+
p(l, null, {
|
|
1673
1693
|
default: h(() => [
|
|
1674
|
-
p(
|
|
1675
|
-
modelValue:
|
|
1676
|
-
"onUpdate:modelValue":
|
|
1694
|
+
p(d, {
|
|
1695
|
+
modelValue: t.localConfig.shadowColor,
|
|
1696
|
+
"onUpdate:modelValue": e[2] || (e[2] = (y) => t.localConfig.shadowColor = y),
|
|
1677
1697
|
mode: "rgba"
|
|
1678
1698
|
}, null, 8, ["modelValue"])
|
|
1679
1699
|
]),
|
|
@@ -1697,9 +1717,9 @@ function ii(i, t, o, e, s, n) {
|
|
|
1697
1717
|
/* STABLE */
|
|
1698
1718
|
}, 16, ["onSubmit"]);
|
|
1699
1719
|
}
|
|
1700
|
-
const oi = /* @__PURE__ */
|
|
1720
|
+
const oi = /* @__PURE__ */ Oe(ti, [["render", ii]]);
|
|
1701
1721
|
function ui(i) {
|
|
1702
|
-
let
|
|
1722
|
+
let e, o, t = () => {
|
|
1703
1723
|
};
|
|
1704
1724
|
return {
|
|
1705
1725
|
get name() {
|
|
@@ -1718,55 +1738,55 @@ function ui(i) {
|
|
|
1718
1738
|
*/
|
|
1719
1739
|
async initialize(s, n) {
|
|
1720
1740
|
o = s, s.categoryClassRegistry.registerClass(
|
|
1721
|
-
this[
|
|
1741
|
+
this[He],
|
|
1722
1742
|
ae.className,
|
|
1723
1743
|
ae
|
|
1724
1744
|
);
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1745
|
+
const r = await ei(s);
|
|
1746
|
+
e = Lt(
|
|
1727
1747
|
s,
|
|
1728
1748
|
i,
|
|
1729
|
-
|
|
1749
|
+
r
|
|
1730
1750
|
);
|
|
1731
|
-
const
|
|
1751
|
+
const l = qt(
|
|
1732
1752
|
s,
|
|
1733
|
-
|
|
1753
|
+
e,
|
|
1734
1754
|
j,
|
|
1735
|
-
i.tools ||
|
|
1736
|
-
), { destroy:
|
|
1737
|
-
|
|
1755
|
+
i.tools || Q().tools
|
|
1756
|
+
), { destroy: w } = Jt(
|
|
1757
|
+
e,
|
|
1738
1758
|
s,
|
|
1739
|
-
|
|
1740
|
-
), { activeMap:
|
|
1741
|
-
function
|
|
1742
|
-
if (n != null && n.m && n.cv &&
|
|
1759
|
+
r.collectionComponent
|
|
1760
|
+
), { activeMap: c } = s.maps;
|
|
1761
|
+
function d(_) {
|
|
1762
|
+
if (n != null && n.m && n.cv && _ instanceof U) {
|
|
1743
1763
|
const y = new D(n.cv);
|
|
1744
|
-
n.m === E.VIEW ?
|
|
1764
|
+
n.m === E.VIEW ? e.viewViewshed(y) : e.editViewshed(y);
|
|
1745
1765
|
}
|
|
1746
1766
|
}
|
|
1747
1767
|
let f = !1;
|
|
1748
|
-
|
|
1768
|
+
c && (f = !0, d(c));
|
|
1749
1769
|
const m = s.maps.mapActivated.addEventListener(
|
|
1750
|
-
(
|
|
1751
|
-
|
|
1770
|
+
(_) => {
|
|
1771
|
+
e.stop(), f || (d(_), f = !0);
|
|
1752
1772
|
}
|
|
1753
1773
|
);
|
|
1754
|
-
|
|
1755
|
-
m(),
|
|
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
|
|
@@ -1774,9 +1794,9 @@ function ui(i) {
|
|
|
1774
1794
|
* @returns {ViewshedPluginState}
|
|
1775
1795
|
*/
|
|
1776
1796
|
getState(s) {
|
|
1777
|
-
var
|
|
1778
|
-
const n = {},
|
|
1779
|
-
return
|
|
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;
|
|
1780
1800
|
},
|
|
1781
1801
|
/**
|
|
1782
1802
|
* components for configuring the plugin and/ or custom items defined by the plugin
|
|
@@ -1794,7 +1814,7 @@ function ui(i) {
|
|
|
1794
1814
|
}
|
|
1795
1815
|
];
|
|
1796
1816
|
},
|
|
1797
|
-
destroy: () =>
|
|
1817
|
+
destroy: () => t(),
|
|
1798
1818
|
i18n: {
|
|
1799
1819
|
en: {
|
|
1800
1820
|
viewshed: {
|
|
@@ -1811,11 +1831,11 @@ function ui(i) {
|
|
|
1811
1831
|
absolute: "Absolute",
|
|
1812
1832
|
new: "New",
|
|
1813
1833
|
cancel: "Cancel",
|
|
1814
|
-
[
|
|
1815
|
-
[
|
|
1834
|
+
[g.CONE]: "Cone viewshed analysis",
|
|
1835
|
+
[g.THREESIXTY]: "360° viewshed analysis",
|
|
1816
1836
|
create: {
|
|
1817
|
-
[
|
|
1818
|
-
[
|
|
1837
|
+
[g.CONE]: "Create cone viewshed analysis",
|
|
1838
|
+
[g.THREESIXTY]: "Create 360° viewshed analysis"
|
|
1819
1839
|
},
|
|
1820
1840
|
addToMyWorkspace: "Add to My Workspace",
|
|
1821
1841
|
temporary: "Temporary",
|
|
@@ -1849,11 +1869,11 @@ function ui(i) {
|
|
|
1849
1869
|
absolute: "Absolut",
|
|
1850
1870
|
new: "Neu",
|
|
1851
1871
|
cancel: "Abbrechen",
|
|
1852
|
-
[
|
|
1853
|
-
[
|
|
1872
|
+
[g.CONE]: "Sichtkegelanalyse",
|
|
1873
|
+
[g.THREESIXTY]: "360° Sichtsanalyse",
|
|
1854
1874
|
create: {
|
|
1855
|
-
[
|
|
1856
|
-
[
|
|
1875
|
+
[g.CONE]: "Sichtkegelanalyse erstellen",
|
|
1876
|
+
[g.THREESIXTY]: "360° Sichtanalyse erstellen"
|
|
1857
1877
|
},
|
|
1858
1878
|
addToMyWorkspace: "Zu Mein Arbeitsbereich hinzufügen",
|
|
1859
1879
|
temporary: "Temporäre",
|