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