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