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