@vcmap/viewshed 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +619 -599
- package/package.json +1 -1
- package/src/ViewshedWindow.vue +6 -1
- package/src/index.js +36 -17
- package/src/util/toolboxHelper.js +0 -1
- package/src/viewshed.js +27 -31
- package/src/viewshedManager.js +38 -18
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { VcsCameraPrimitive as
|
|
5
|
-
import { Color as
|
|
6
|
-
import { shallowRef as
|
|
7
|
-
import { ol$Observable$unByKey as
|
|
8
|
-
import { VcsTextField as
|
|
9
|
-
import { VContainer as
|
|
10
|
-
const
|
|
1
|
+
var pe = Object.defineProperty;
|
|
2
|
+
var we = (s, e, i) => e in s ? pe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
|
|
3
|
+
var Q = (s, e, i) => (we(s, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
+
import { VcsCameraPrimitive as me, VcsObject as ge, VcsEvent as x, AbstractInteraction as _e, EventType as N, Projection as I, SessionType as Ce, CesiumMap as D, startEditFeaturesSession as Ee, startEditGeometrySession as ye, VectorLayer as Ve, wgs84Projection as be, maxZIndex as Me, markVolatile as Te, Viewpoint as Oe, TransformationMode as Se, Category as Pe, moduleIdSymbol as Ae } from "../../../assets/core.js";
|
|
5
|
+
import { Color as j, Matrix4 as Ie, Transforms as Re, Primitive as ee, GeometryInstance as te, SphereGeometry as $e, ColorGeometryInstanceAttribute as ie, PerInstanceColorAppearance as se, SphereOutlineGeometry as Ne, Math as T, Cartesian3 as O, ShadowMap as xe, Camera as De, HeightReference as Le } from "../../../assets/cesium.js";
|
|
6
|
+
import { shallowRef as K, ref as A, nextTick as ke, inject as oe, computed as ne, reactive as W, watchEffect as Fe, watch as R, onMounted as je, onUnmounted as We } from "../../../assets/vue.js";
|
|
7
|
+
import { ol$Observable$unByKey as Be, Feature as ze, ol$geom$Point as Ge, ol$style$Style as He } from "../../../assets/ol.js";
|
|
8
|
+
import { VcsTextField as Ue, VcsSlider as Ke, VcsLabel as ae, VcsFormSection as le, VcsSelect as ce, VcsFormButton as Xe, VcsFeatureTransforms as Ye, makeEditorCollectionComponentClass as Je, WindowSlot as Ze, ToolboxType as qe, createListExportAction as Qe, downloadText as et, createListImportAction as tt, AbstractConfigEditor as it } from "../../../assets/ui.js";
|
|
9
|
+
import { VContainer as de, VRow as he, VCol as ue, VDivider as st, VColorPicker as ot } from "../../../assets/vuetify.js";
|
|
10
|
+
const $ = [
|
|
11
11
|
[String, "string"],
|
|
12
12
|
[Number, "number"],
|
|
13
13
|
[Boolean, "boolean"],
|
|
@@ -15,160 +15,160 @@ const x = [
|
|
|
15
15
|
[void 0, "undefined"],
|
|
16
16
|
[Symbol, "symbol"]
|
|
17
17
|
];
|
|
18
|
-
function
|
|
18
|
+
function B(s) {
|
|
19
19
|
const e = {};
|
|
20
20
|
if (!s || e.toString(s) !== "[object Object]")
|
|
21
21
|
return !1;
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
22
|
+
const i = Object.getPrototypeOf(s);
|
|
23
|
+
if (!i)
|
|
24
24
|
return !0;
|
|
25
|
-
const
|
|
26
|
-
return typeof o == "function" &&
|
|
25
|
+
const t = e.hasOwnProperty, o = t.call(i, "constructor") && i.constructor;
|
|
26
|
+
return typeof o == "function" && t.toString.call(o) === t.toString.call(Object);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function b(s, e) {
|
|
29
29
|
if (s === null)
|
|
30
30
|
return "null";
|
|
31
31
|
if (typeof s > "u")
|
|
32
32
|
return "undefined";
|
|
33
33
|
if (e)
|
|
34
34
|
return typeof s;
|
|
35
|
-
let
|
|
35
|
+
let i;
|
|
36
36
|
if (Array.isArray(s))
|
|
37
|
-
|
|
37
|
+
i = `[${s.map((o) => b(o, e)).join(",")}]`;
|
|
38
38
|
else
|
|
39
39
|
try {
|
|
40
|
-
|
|
40
|
+
i = JSON.stringify(s);
|
|
41
41
|
} catch {
|
|
42
|
-
|
|
42
|
+
i = typeof s;
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return i = i || typeof s, i.length > 20 ? `${i.substr(0, 20)}...` : i;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? s === e ? !1 : `Expected ${
|
|
46
|
+
function nt(s, e) {
|
|
47
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? s === e ? !1 : `Expected ${b(s)} to equal ${e.toString()}` : null;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function rt(s, e, i) {
|
|
50
50
|
if (Array.isArray(e)) {
|
|
51
51
|
if (e.length !== 1)
|
|
52
52
|
throw new Error("Array patterns may only have on type");
|
|
53
53
|
if (Array.isArray(s)) {
|
|
54
|
-
let
|
|
55
|
-
return s.findIndex((
|
|
54
|
+
let t = !1;
|
|
55
|
+
return s.findIndex((n) => {
|
|
56
56
|
try {
|
|
57
|
-
z(
|
|
57
|
+
z(n, e[0], i);
|
|
58
58
|
} catch (a) {
|
|
59
|
-
|
|
59
|
+
t = a.message.replace(/Match failed:\s/, "");
|
|
60
60
|
}
|
|
61
|
-
return
|
|
62
|
-
}) > -1 ? `${
|
|
61
|
+
return t;
|
|
62
|
+
}) > -1 ? `${t} in ${b(s)}` : !1;
|
|
63
63
|
}
|
|
64
|
-
return `Expected ${
|
|
64
|
+
return `Expected ${b(s)} to be an Array`;
|
|
65
65
|
}
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
function X(s, e,
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
71
|
-
return `Expected ${
|
|
72
|
-
let
|
|
73
|
-
const a = Object.keys(e).find((
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
|
|
68
|
+
function X(s, e, i) {
|
|
69
|
+
const t = i ? `${i}.` : "";
|
|
70
|
+
if (!B(s))
|
|
71
|
+
return `Expected ${b(s)} to be a plain Object`;
|
|
72
|
+
let n = !1;
|
|
73
|
+
const a = Object.keys(e).find((c) => {
|
|
74
|
+
const r = s[c];
|
|
75
|
+
if (B(e[c]))
|
|
76
|
+
n = X(r, e[c], t + c);
|
|
77
77
|
else
|
|
78
78
|
try {
|
|
79
|
-
z(
|
|
80
|
-
} catch (
|
|
81
|
-
|
|
79
|
+
z(r, e[c]);
|
|
80
|
+
} catch (f) {
|
|
81
|
+
n = f.message.replace(/Match failed:\s/, "");
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return n;
|
|
84
84
|
});
|
|
85
|
-
return a ? `${
|
|
85
|
+
return a ? `${n} in object.${t}${a}` : !1;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function at(s, e) {
|
|
88
88
|
if (e === Number)
|
|
89
|
-
return Number.isFinite(s) ? !1 : `expected ${
|
|
90
|
-
for (let
|
|
91
|
-
if (e ===
|
|
92
|
-
return typeof s ===
|
|
89
|
+
return Number.isFinite(s) ? !1 : `expected ${b(s)} to be a number, excluding NaN`;
|
|
90
|
+
for (let i = $.length; i--; )
|
|
91
|
+
if (e === $[i][0])
|
|
92
|
+
return typeof s === $[i][1] ? !1 : `expected ${b(s)} to be a ${$[i][1]}`;
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Y(s) {
|
|
96
96
|
if (s === null)
|
|
97
97
|
return "null";
|
|
98
|
-
const e =
|
|
98
|
+
const e = $.find((o) => o[0] === s);
|
|
99
99
|
if (e)
|
|
100
100
|
return e[1];
|
|
101
|
-
let
|
|
101
|
+
let i = s.toString();
|
|
102
102
|
if (s.className)
|
|
103
103
|
return s.className;
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
return
|
|
107
|
-
if (
|
|
104
|
+
const t = i.match(/function (.*)\(/);
|
|
105
|
+
if (t && t.length > 1)
|
|
106
|
+
return t[1];
|
|
107
|
+
if (B(s)) {
|
|
108
108
|
const o = {};
|
|
109
|
-
Object.keys(s).forEach((
|
|
110
|
-
o[
|
|
109
|
+
Object.keys(s).forEach((n) => {
|
|
110
|
+
o[n] = Y(s[n]);
|
|
111
111
|
});
|
|
112
112
|
try {
|
|
113
|
-
|
|
113
|
+
i = `Object of ${JSON.stringify(o)}`;
|
|
114
114
|
} catch {
|
|
115
|
-
|
|
115
|
+
i = "Object";
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return i;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
120
|
+
function fe(s, e, i) {
|
|
121
|
+
const t = i ? `${i}.` : "";
|
|
122
122
|
let o = !1;
|
|
123
123
|
return Object.keys(s).find((a) => {
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
o =
|
|
124
|
+
if (B(e[a])) {
|
|
125
|
+
const c = s[a];
|
|
126
|
+
o = fe(c, e[a], t + a);
|
|
127
127
|
} else
|
|
128
|
-
e[a] || (o = `Found additional key ${
|
|
128
|
+
e[a] || (o = `Found additional key ${t}${a}`);
|
|
129
129
|
return o = o ? o.replace(/\sin.*/, "") : !1, o;
|
|
130
|
-
}) ? `${o} in ${
|
|
130
|
+
}) ? `${o} in ${b(s)}` : !1;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
return a ===
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
return
|
|
142
|
-
if (Array.isArray(
|
|
143
|
-
return
|
|
144
|
-
if (
|
|
145
|
-
return a instanceof
|
|
146
|
-
if (
|
|
132
|
+
function lt(s, e, i) {
|
|
133
|
+
const t = function(a, c) {
|
|
134
|
+
if (c == null)
|
|
135
|
+
return a === c ? !1 : `Expected ${b(a)} to be ${c}`;
|
|
136
|
+
const r = at(a, c);
|
|
137
|
+
if (r !== null)
|
|
138
|
+
return r;
|
|
139
|
+
const f = nt(a, c);
|
|
140
|
+
if (f !== null)
|
|
141
|
+
return f;
|
|
142
|
+
if (Array.isArray(c))
|
|
143
|
+
return rt(a, c, i);
|
|
144
|
+
if (c instanceof Function)
|
|
145
|
+
return a instanceof c ? !1 : `Expected ${b(a, !0)} to be of Type ${Y(c)}`;
|
|
146
|
+
if (c === Object)
|
|
147
147
|
return X(a, {});
|
|
148
|
-
if (typeof
|
|
149
|
-
throw new Error(`Cannot handler pattern ${
|
|
150
|
-
const
|
|
151
|
-
return
|
|
148
|
+
if (typeof c != "object")
|
|
149
|
+
throw new Error(`Cannot handler pattern ${c}`);
|
|
150
|
+
const h = X(a, c);
|
|
151
|
+
return h || (i ? fe(a, c) : !1);
|
|
152
152
|
};
|
|
153
153
|
let o;
|
|
154
|
-
return Array.isArray(e) && e.length > 1 ? e.every((a) =>
|
|
154
|
+
return Array.isArray(e) && e.length > 1 ? e.every((a) => t(s, a)) && (o = `Expected ${b(s)} to be a ${e.map((a) => Y(a)).join(" or ")}`) : o = t(s, e), o;
|
|
155
155
|
}
|
|
156
|
-
function z(s, e,
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
throw new Error(`Match failed: ${
|
|
156
|
+
function z(s, e, i) {
|
|
157
|
+
const t = lt(s, e, i);
|
|
158
|
+
if (t)
|
|
159
|
+
throw new Error(`Match failed: ${t}`);
|
|
160
160
|
return !1;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function ct(s, e, i) {
|
|
163
163
|
if (s != null) {
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
return
|
|
164
|
+
const t = Object.values(e).find((o) => o == s);
|
|
165
|
+
if (t != null)
|
|
166
|
+
return t;
|
|
167
167
|
}
|
|
168
|
-
return
|
|
168
|
+
return i;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
class
|
|
170
|
+
const dt = new j(), H = new Ie();
|
|
171
|
+
class ht extends me {
|
|
172
172
|
constructor(e) {
|
|
173
173
|
super(e), this.spot = e.spot;
|
|
174
174
|
}
|
|
@@ -181,49 +181,49 @@ class ct extends pe {
|
|
|
181
181
|
if (this.spot)
|
|
182
182
|
super.update(e);
|
|
183
183
|
else {
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const i = this._planesPrimitives, t = this._outlinePrimitives;
|
|
185
|
+
i.length === 0 && (Re.eastNorthUpToFixedFrame(
|
|
186
186
|
this._camera.positionWC,
|
|
187
187
|
void 0,
|
|
188
|
-
|
|
189
|
-
),
|
|
188
|
+
H
|
|
189
|
+
), i[0] = new ee({
|
|
190
190
|
allowPicking: this.allowPicking,
|
|
191
|
-
geometryInstances: new
|
|
192
|
-
geometry: new
|
|
191
|
+
geometryInstances: new te({
|
|
192
|
+
geometry: new $e({
|
|
193
193
|
radius: 2
|
|
194
194
|
}),
|
|
195
195
|
attributes: {
|
|
196
|
-
color:
|
|
197
|
-
|
|
196
|
+
color: ie.fromColor(
|
|
197
|
+
j.fromAlpha(this._color, 0.1, dt)
|
|
198
198
|
)
|
|
199
199
|
},
|
|
200
|
-
modelMatrix:
|
|
200
|
+
modelMatrix: H
|
|
201
201
|
}),
|
|
202
|
-
appearance: new
|
|
202
|
+
appearance: new se({
|
|
203
203
|
translucent: !0,
|
|
204
204
|
flat: !0
|
|
205
205
|
}),
|
|
206
206
|
asynchronous: !1
|
|
207
|
-
}),
|
|
207
|
+
}), t[0] = new ee({
|
|
208
208
|
allowPicking: this.allowPicking,
|
|
209
|
-
geometryInstances: new
|
|
210
|
-
geometry: new
|
|
209
|
+
geometryInstances: new te({
|
|
210
|
+
geometry: new Ne({
|
|
211
211
|
radius: 2
|
|
212
212
|
}),
|
|
213
213
|
attributes: {
|
|
214
|
-
color:
|
|
214
|
+
color: ie.fromColor(this._color)
|
|
215
215
|
},
|
|
216
|
-
modelMatrix:
|
|
216
|
+
modelMatrix: H
|
|
217
217
|
}),
|
|
218
|
-
appearance: new
|
|
218
|
+
appearance: new se({
|
|
219
219
|
translucent: !1,
|
|
220
220
|
flat: !0
|
|
221
221
|
}),
|
|
222
222
|
asynchronous: !1
|
|
223
223
|
}));
|
|
224
|
-
const { length: o } =
|
|
225
|
-
for (let
|
|
226
|
-
|
|
224
|
+
const { length: o } = i;
|
|
225
|
+
for (let n = 0; n < o; ++n)
|
|
226
|
+
t[n].update(e), i[n].update(e);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
}
|
|
@@ -231,14 +231,14 @@ const w = {
|
|
|
231
231
|
CONE: "cone",
|
|
232
232
|
THREESIXTY: "360"
|
|
233
233
|
};
|
|
234
|
-
function
|
|
235
|
-
const
|
|
234
|
+
function ut(s, e) {
|
|
235
|
+
const i = new De(s), t = (
|
|
236
236
|
/** @type {import("@vcmap-cesium/engine").PerspectiveFrustum} */
|
|
237
|
-
|
|
237
|
+
i.frustum
|
|
238
238
|
);
|
|
239
|
-
return
|
|
239
|
+
return t.fov = e.fov, t.near = e.near, t.aspectRatio = e.aspectRatio, t.far = e.far, i;
|
|
240
240
|
}
|
|
241
|
-
const E = class E extends
|
|
241
|
+
const E = class E extends ge {
|
|
242
242
|
static get className() {
|
|
243
243
|
return "Viewshed";
|
|
244
244
|
}
|
|
@@ -249,7 +249,7 @@ const E = class E extends we {
|
|
|
249
249
|
static getDefaultOptions() {
|
|
250
250
|
return {
|
|
251
251
|
frustum: {
|
|
252
|
-
fov:
|
|
252
|
+
fov: T.PI / 3,
|
|
253
253
|
near: 1,
|
|
254
254
|
aspectRatio: 1,
|
|
255
255
|
far: 300
|
|
@@ -266,32 +266,31 @@ const E = class E extends we {
|
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* @param {ViewshedOptions} options The options for the viewshed.
|
|
269
|
-
* @param {import("@vcmap/core").CesiumMap} [cesiumMap] The cesiumMap the viewshed should be applied to. If this parameter is passed, the viewshed is activated and all other viewsheds are deactivated.
|
|
270
269
|
*/
|
|
271
|
-
constructor(e
|
|
272
|
-
var i, o,
|
|
270
|
+
constructor(e) {
|
|
271
|
+
var i, t, o, n, a, c;
|
|
273
272
|
super(e), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
|
|
274
273
|
fov: ((i = e.frustumOptions) == null ? void 0 : i.fov) || E.getDefaultOptions().frustum.fov,
|
|
275
|
-
far: ((
|
|
276
|
-
near: ((
|
|
277
|
-
aspectRatio: ((
|
|
274
|
+
far: ((t = e.frustumOptions) == null ? void 0 : t.far) || E.getDefaultOptions().frustum.far,
|
|
275
|
+
near: ((o = e.frustumOptions) == null ? void 0 : o.near) || E.getDefaultOptions().frustum.near,
|
|
276
|
+
aspectRatio: ((n = e.frustumOptions) == null ? void 0 : n.aspectRatio) || E.getDefaultOptions().frustum.aspectRatio
|
|
278
277
|
}, this._headingPitchRollValues = e.orientation || {
|
|
279
278
|
...E.getDefaultOptions().orientation
|
|
280
|
-
}, this._position = e.position || E.getDefaultOptions().position, this._viewshedType =
|
|
281
|
-
visibleColor:
|
|
282
|
-
((
|
|
279
|
+
}, this._position = e.position || E.getDefaultOptions().position, this._viewshedType = ct(e.viewshedType, w), this._colors = {
|
|
280
|
+
visibleColor: j.fromCssColorString(
|
|
281
|
+
((a = e.colorOptions) == null ? void 0 : a.visibleColor) || E.getDefaultOptions().visibleColor
|
|
283
282
|
),
|
|
284
|
-
shadowColor:
|
|
285
|
-
((
|
|
283
|
+
shadowColor: j.fromCssColorString(
|
|
284
|
+
((c = e.colorOptions) == null ? void 0 : c.shadowColor) || E.getDefaultOptions().shadowColor
|
|
286
285
|
)
|
|
287
|
-
}, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this.
|
|
286
|
+
}, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this._positionChanged = new x(), this._active = !1;
|
|
288
287
|
}
|
|
289
288
|
/**
|
|
290
289
|
* 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.
|
|
291
290
|
* @param {import("ol/coordinate").Coordinate} coords The new positions coordinates in degrees
|
|
292
291
|
*/
|
|
293
292
|
set position(e) {
|
|
294
|
-
z(e, [Number]), this._position = e, this._shadowCamera && (this._shadowCamera.position =
|
|
293
|
+
z(e, [Number]), this._position = e, this._shadowCamera && (this._shadowCamera.position = O.fromDegrees(
|
|
295
294
|
e[0],
|
|
296
295
|
e[1],
|
|
297
296
|
e[2] + this._heightOffset
|
|
@@ -315,11 +314,11 @@ const E = class E extends we {
|
|
|
315
314
|
* @param {number} value the offset that is added to the position height.
|
|
316
315
|
*/
|
|
317
316
|
set heightOffset(e) {
|
|
318
|
-
this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position =
|
|
317
|
+
this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position = O.fromDegrees(
|
|
319
318
|
this.position[0],
|
|
320
319
|
this.position[1],
|
|
321
320
|
this.position[2] + e
|
|
322
|
-
), this.
|
|
321
|
+
), this._updatePrimitive());
|
|
323
322
|
}
|
|
324
323
|
/**
|
|
325
324
|
* Getter for height offset.
|
|
@@ -333,7 +332,7 @@ const E = class E extends we {
|
|
|
333
332
|
* @param {number} value The distance in meters.
|
|
334
333
|
*/
|
|
335
334
|
set distance(e) {
|
|
336
|
-
this._frustumOptions.far = e > E.MIN_DISTANCE ? e : E.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._updateShadowMap(), this._viewshedType === w.CONE && this._updatePrimitive());
|
|
335
|
+
this._frustumOptions.far = e > E.MIN_DISTANCE ? e : E.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === w.THREESIXTY && this._updateShadowMap(), this._viewshedType === w.CONE && this._updatePrimitive());
|
|
337
336
|
}
|
|
338
337
|
/**
|
|
339
338
|
* Returns the reach of the viewshed.
|
|
@@ -347,23 +346,23 @@ const E = class E extends we {
|
|
|
347
346
|
* @param {number} value The field of view in degrees.
|
|
348
347
|
*/
|
|
349
348
|
set fov(e) {
|
|
350
|
-
this._frustumOptions.fov = e *
|
|
349
|
+
this._frustumOptions.fov = e * T.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = e * T.RADIANS_PER_DEGREE, this._viewshedType === w.CONE && this._updatePrimitive());
|
|
351
350
|
}
|
|
352
351
|
/**
|
|
353
352
|
* Returns the field of view.
|
|
354
353
|
* @returns {number} The field of view in degrees.
|
|
355
354
|
*/
|
|
356
355
|
get fov() {
|
|
357
|
-
return this._frustumOptions.fov *
|
|
356
|
+
return this._frustumOptions.fov * T.DEGREES_PER_RADIAN;
|
|
358
357
|
}
|
|
359
358
|
/**
|
|
360
359
|
* Sets the heading of a cone viewshed. Does not have impact on 360 viewshed.
|
|
361
360
|
* @param {number} value Heading in degrees.
|
|
362
361
|
*/
|
|
363
362
|
set heading(e) {
|
|
364
|
-
this._headingPitchRollValues.heading = e *
|
|
363
|
+
this._headingPitchRollValues.heading = e * T.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
|
|
365
364
|
orientation: {
|
|
366
|
-
heading: e *
|
|
365
|
+
heading: e * T.RADIANS_PER_DEGREE,
|
|
367
366
|
pitch: this._shadowCamera.pitch,
|
|
368
367
|
roll: 0
|
|
369
368
|
}
|
|
@@ -374,16 +373,16 @@ const E = class E extends we {
|
|
|
374
373
|
* @returns {number} The heading in degress.
|
|
375
374
|
*/
|
|
376
375
|
get heading() {
|
|
377
|
-
return this._headingPitchRollValues.heading *
|
|
376
|
+
return this._headingPitchRollValues.heading * T.DEGREES_PER_RADIAN;
|
|
378
377
|
}
|
|
379
378
|
/**
|
|
380
379
|
* Sets the pitch of a cone viewshed. 0 is horizontal. Does not have impact on 360 viewshed.
|
|
381
380
|
* @param {number} value The pitch in degrees.
|
|
382
381
|
*/
|
|
383
382
|
set pitch(e) {
|
|
384
|
-
if (this._headingPitchRollValues.pitch = e *
|
|
385
|
-
const
|
|
386
|
-
this._shadowCamera.lookUp(
|
|
383
|
+
if (this._headingPitchRollValues.pitch = e * T.RADIANS_PER_DEGREE, this._shadowCamera) {
|
|
384
|
+
const i = e * T.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
|
|
385
|
+
this._shadowCamera.lookUp(i), this._viewshedType === w.CONE && this._updatePrimitive();
|
|
387
386
|
}
|
|
388
387
|
}
|
|
389
388
|
/**
|
|
@@ -391,7 +390,7 @@ const E = class E extends we {
|
|
|
391
390
|
* @returns {number} The pitch in degrees.
|
|
392
391
|
*/
|
|
393
392
|
get pitch() {
|
|
394
|
-
return this._headingPitchRollValues.pitch *
|
|
393
|
+
return this._headingPitchRollValues.pitch * T.DEGREES_PER_RADIAN;
|
|
395
394
|
}
|
|
396
395
|
/**
|
|
397
396
|
* Sets whether the primitive of the viewshed should be shown or not.
|
|
@@ -408,41 +407,46 @@ const E = class E extends we {
|
|
|
408
407
|
return this._showPrimitive;
|
|
409
408
|
}
|
|
410
409
|
/**
|
|
411
|
-
*
|
|
410
|
+
* Returns the type of the Viewshed.
|
|
412
411
|
* @returns {ViewshedTypes}
|
|
413
412
|
*/
|
|
414
413
|
get type() {
|
|
415
414
|
return this._viewshedType;
|
|
416
415
|
}
|
|
417
416
|
/**
|
|
418
|
-
*
|
|
417
|
+
* @returns {ShadowMap|null}
|
|
418
|
+
*/
|
|
419
|
+
get shadowMap() {
|
|
420
|
+
return this._shadowMap;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Deactivates the viewshed by removing primitive and removing shadowMap.
|
|
419
424
|
*/
|
|
420
425
|
deactivate() {
|
|
421
|
-
var e
|
|
422
|
-
this._active && (this._removePrimitive(),
|
|
426
|
+
var e;
|
|
427
|
+
this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (e = this._shadowMap) == null || e.destroy(), this._shadowCamera = null, this._scene = null, this._cesiumMap = null, this._shadowMap = null, this._active = !1);
|
|
423
428
|
}
|
|
424
429
|
/**
|
|
425
|
-
* Activates viewshed.
|
|
430
|
+
* Activates viewshed.
|
|
426
431
|
* @param {import("@vcmap/core").CesiumMap} cesiumMap The cesium map to which the shadow map of the viewshed is applied to.
|
|
427
432
|
*/
|
|
428
433
|
activate(e) {
|
|
429
434
|
if (this._active || (this._active = !0), e !== this._cesiumMap) {
|
|
430
435
|
this._cesiumMap = e;
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
433
|
-
this._shadowCamera =
|
|
436
|
+
const i = e.getScene();
|
|
437
|
+
if (i)
|
|
438
|
+
this._shadowCamera = ut(i, this._frustumOptions), this._position && (this.position = this._position), this._scene = i;
|
|
434
439
|
else
|
|
435
440
|
throw new Error("CesiumMap contains no scene");
|
|
436
|
-
this._updateShadowMap(), this._updatePrimitive()
|
|
437
|
-
this.deactivate();
|
|
438
|
-
});
|
|
441
|
+
this._updateShadowMap(), this._updatePrimitive();
|
|
439
442
|
}
|
|
440
443
|
}
|
|
441
444
|
/**
|
|
442
445
|
* Updates the shadow map by creating a new one and applying all the current parameters.
|
|
443
446
|
*/
|
|
444
447
|
_updateShadowMap() {
|
|
445
|
-
|
|
448
|
+
var e;
|
|
449
|
+
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((e = this._shadowMap) == null || e.destroy(), this._shadowMap = new xe({
|
|
446
450
|
// @ts-ignore
|
|
447
451
|
context: this._scene.context,
|
|
448
452
|
lightCamera: this._shadowCamera,
|
|
@@ -457,11 +461,11 @@ const E = class E extends we {
|
|
|
457
461
|
}), this._shadowMap.viewshed = this._colors, this._cesiumMap.setShadowMap(this._shadowMap));
|
|
458
462
|
}
|
|
459
463
|
_removePrimitive() {
|
|
460
|
-
var e;
|
|
461
|
-
this._primitive && ((e = this._scene) == null ||
|
|
464
|
+
var e, i, t;
|
|
465
|
+
this._primitive && !((i = (e = this._primitive).isDestroyed) != null && i.call(e)) && ((t = this._scene) == null || t.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
|
|
462
466
|
}
|
|
463
467
|
_updatePrimitive() {
|
|
464
|
-
this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new
|
|
468
|
+
this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new ht({
|
|
465
469
|
camera: this._shadowCamera,
|
|
466
470
|
allowPicking: !1,
|
|
467
471
|
spot: this._viewshedType === w.CONE
|
|
@@ -474,13 +478,13 @@ const E = class E extends we {
|
|
|
474
478
|
lookAt(e) {
|
|
475
479
|
if (!this._shadowCamera)
|
|
476
480
|
return;
|
|
477
|
-
const
|
|
478
|
-
if (this.distance =
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
+
const i = O.fromDegrees(e[0], e[1], e[2]);
|
|
482
|
+
if (this.distance = O.distance(this._shadowCamera.position, i), this.type === w.CONE && !i.equals(this._shadowCamera.position)) {
|
|
483
|
+
const t = new O();
|
|
484
|
+
O.subtract(i, this._shadowCamera.position, i), O.normalize(i, i), O.normalize(this._shadowCamera.position, t), this._shadowCamera.setView({
|
|
481
485
|
orientation: {
|
|
482
|
-
direction:
|
|
483
|
-
up:
|
|
486
|
+
direction: i,
|
|
487
|
+
up: t
|
|
484
488
|
}
|
|
485
489
|
}), this._headingPitchRollValues.heading = this._shadowCamera.heading, this._headingPitchRollValues.pitch = this._shadowCamera.pitch;
|
|
486
490
|
}
|
|
@@ -509,18 +513,20 @@ const E = class E extends we {
|
|
|
509
513
|
* Destroys the viewshed.
|
|
510
514
|
*/
|
|
511
515
|
destroy() {
|
|
512
|
-
|
|
516
|
+
var t;
|
|
517
|
+
const e = this._cesiumMap, i = this._shadowMap;
|
|
518
|
+
this.deactivate(), ((t = e == null ? void 0 : e.getScene()) == null ? void 0 : t.shadowMap) === i && e.setDefaultShadowMap();
|
|
513
519
|
}
|
|
514
520
|
};
|
|
515
|
-
|
|
516
|
-
let
|
|
517
|
-
class
|
|
521
|
+
Q(E, "MIN_DISTANCE", 10);
|
|
522
|
+
let M = E;
|
|
523
|
+
class ft extends _e {
|
|
518
524
|
/**
|
|
519
525
|
*
|
|
520
526
|
* @param {import("./viewshed").default} viewshed
|
|
521
527
|
*/
|
|
522
528
|
constructor(e) {
|
|
523
|
-
super(
|
|
529
|
+
super(N.CLICKMOVE), this._viewshed = e, this._positioned = new x(), this._finished = new x(), this._position = !1, this.setActive();
|
|
524
530
|
}
|
|
525
531
|
get finished() {
|
|
526
532
|
return this._finished;
|
|
@@ -529,237 +535,241 @@ class ht extends me {
|
|
|
529
535
|
return this._positioned;
|
|
530
536
|
}
|
|
531
537
|
async pipe(e) {
|
|
532
|
-
return e.position && (this._position ? (this._viewshed.lookAt(I.mercatorToWgs84(e.position)), e.type &
|
|
538
|
+
return e.position && (this._position ? (this._viewshed.lookAt(I.mercatorToWgs84(e.position)), e.type & N.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = I.mercatorToWgs84(e.position), e.type & N.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
|
|
533
539
|
}
|
|
534
540
|
destroy() {
|
|
535
541
|
super.destroy(), this._finished.destroy(), this._positioned.destroy();
|
|
536
542
|
}
|
|
537
543
|
}
|
|
538
|
-
const
|
|
544
|
+
const y = {
|
|
539
545
|
ABSOLUTE: "absolute",
|
|
540
546
|
RELATIVE: "relative"
|
|
541
|
-
},
|
|
547
|
+
}, m = {
|
|
542
548
|
CREATE: "create",
|
|
543
549
|
VIEW: "view",
|
|
544
550
|
EDIT: "edit",
|
|
545
551
|
MOVE: "move",
|
|
546
552
|
MULTI_SELECT: "multiSelect"
|
|
547
|
-
},
|
|
548
|
-
function
|
|
549
|
-
const e = new
|
|
550
|
-
projection:
|
|
551
|
-
zIndex:
|
|
553
|
+
}, re = 1.8;
|
|
554
|
+
function vt(s) {
|
|
555
|
+
const e = new Ve({
|
|
556
|
+
projection: be.toJSON(),
|
|
557
|
+
zIndex: Me - 1
|
|
552
558
|
});
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
return
|
|
559
|
+
Te(e), e.activate();
|
|
560
|
+
const i = new ze(new Ge(s));
|
|
561
|
+
return i.setStyle(new He({})), e.addFeatures([i]), e.vectorProperties.altitudeMode = Le.NONE, {
|
|
556
562
|
layer: e,
|
|
557
|
-
feature:
|
|
563
|
+
feature: i,
|
|
558
564
|
destroy() {
|
|
559
|
-
|
|
565
|
+
i.dispose(), e.destroy();
|
|
560
566
|
}
|
|
561
567
|
};
|
|
562
568
|
}
|
|
563
569
|
function U(s, e) {
|
|
564
|
-
const
|
|
565
|
-
s.setActive(
|
|
570
|
+
const i = e === y.ABSOLUTE ? N.CLICKMOVE : N.NONE;
|
|
571
|
+
s.setActive(i), s.pickPosition = i, s.pullPickedPosition = 1.8;
|
|
566
572
|
}
|
|
567
|
-
function
|
|
568
|
-
const
|
|
569
|
-
let
|
|
573
|
+
function pt(s, e, i) {
|
|
574
|
+
const t = K(null), o = A(null), n = A(null), a = A(y.ABSOLUTE);
|
|
575
|
+
let c = () => {
|
|
576
|
+
};
|
|
577
|
+
const r = K(null);
|
|
578
|
+
let f = () => {
|
|
570
579
|
};
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
o.value && i.value ? (i.value.deactivate(), t.setVisibility(i.value.name, !1)) : (f = i.value) == null || f.destroy(), i.value = h, (d = i.value) == null || d.activate(s.maps.activeMap);
|
|
580
|
+
function h() {
|
|
581
|
+
var l;
|
|
582
|
+
o.value && t.value ? (t.value.deactivate(), i.setVisibility(t.value.name, !1)) : (l = t.value) == null || l.destroy();
|
|
575
583
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
584
|
+
function v(l = !0) {
|
|
585
|
+
f(), c(), h(), t.value = null, l && i.clearSelection(), o.value = null, n.value = null;
|
|
578
586
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
587
|
+
function u(l) {
|
|
588
|
+
f(), h(), s.maps.activeMap instanceof D && (t.value = l, l.activate(s.maps.activeMap), f = s.maps.activeMap.shadowMapChanged.addEventListener((d) => {
|
|
589
|
+
var p;
|
|
590
|
+
d !== ((p = t.value) == null ? void 0 : p.shadowMap) && v(!1);
|
|
591
|
+
}));
|
|
592
|
+
}
|
|
593
|
+
async function _(l) {
|
|
594
|
+
v(), await ke();
|
|
595
|
+
const { eventHandler: d } = s.maps, { featureInteraction: p } = d, g = new M({
|
|
596
|
+
viewshedType: l,
|
|
597
|
+
colorOptions: {
|
|
598
|
+
visibleColor: e.visibleColor,
|
|
599
|
+
shadowColor: e.shadowColor
|
|
590
600
|
},
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
);
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
|
|
601
|
+
heightOffset: a.value === y.ABSOLUTE ? 0 : re
|
|
602
|
+
});
|
|
603
|
+
u(g);
|
|
604
|
+
const C = new ft(t.value);
|
|
605
|
+
C.finished.addEventListener(() => {
|
|
606
|
+
c(), t.value ? (t.value.showPrimitive = !0, n.value = m.EDIT) : v();
|
|
597
607
|
});
|
|
598
|
-
const
|
|
599
|
-
|
|
608
|
+
const k = d.addExclusiveInteraction(
|
|
609
|
+
C,
|
|
600
610
|
() => {
|
|
601
|
-
|
|
611
|
+
C.destroy();
|
|
602
612
|
}
|
|
603
613
|
);
|
|
604
|
-
U(
|
|
605
|
-
U(
|
|
606
|
-
}),
|
|
607
|
-
|
|
614
|
+
U(p, a.value), C.positioned.addEventListener(() => {
|
|
615
|
+
U(p, y.ABSOLUTE);
|
|
616
|
+
}), c = () => {
|
|
617
|
+
k(), C.destroy(), p.setActive(), c = () => {
|
|
608
618
|
};
|
|
609
|
-
},
|
|
619
|
+
}, n.value = m.CREATE;
|
|
610
620
|
}
|
|
611
|
-
function
|
|
612
|
-
var
|
|
613
|
-
if (
|
|
614
|
-
|
|
621
|
+
function V(l) {
|
|
622
|
+
var d;
|
|
623
|
+
if (t.value && l) {
|
|
624
|
+
c();
|
|
615
625
|
const {
|
|
616
|
-
layer:
|
|
617
|
-
feature:
|
|
626
|
+
layer: p,
|
|
627
|
+
feature: g,
|
|
618
628
|
destroy: C
|
|
619
|
-
} =
|
|
620
|
-
s.layers.add(
|
|
621
|
-
|
|
629
|
+
} = vt(t.value.position);
|
|
630
|
+
s.layers.add(p), a.value === y.ABSOLUTE ? (r.value = Ee(s, p), r.value.setFeatures([g])) : (r.value = ye(s, p), r.value.setFeature(g)), r.value.stopped.addEventListener(() => {
|
|
631
|
+
c();
|
|
622
632
|
});
|
|
623
|
-
const
|
|
624
|
-
|
|
633
|
+
const k = (d = g.getGeometry()) == null ? void 0 : d.on("change", () => {
|
|
634
|
+
t.value ? t.value.position = I.mercatorToWgs84(
|
|
625
635
|
/** @type {import("ol/geom").Point} */
|
|
626
|
-
|
|
627
|
-
) :
|
|
636
|
+
g.getGeometry().getCoordinates()
|
|
637
|
+
) : v();
|
|
628
638
|
});
|
|
629
|
-
|
|
630
|
-
var
|
|
631
|
-
|
|
632
|
-
},
|
|
639
|
+
n.value = m.MOVE, c = () => {
|
|
640
|
+
var q;
|
|
641
|
+
c = () => {
|
|
642
|
+
}, k && Be(k), (q = r.value) == null || q.stop(), r.value = null, s.layers.remove(p), C(), n.value = m.EDIT;
|
|
633
643
|
};
|
|
634
644
|
} else
|
|
635
|
-
|
|
645
|
+
c();
|
|
636
646
|
}
|
|
637
|
-
function
|
|
638
|
-
|
|
647
|
+
function P(l, d) {
|
|
648
|
+
c(), t.value !== d && (u(d), a.value = d.heightOffset ? y.RELATIVE : y.ABSOLUTE), o.value = !!d.properties.title, n.value = l, o.value && i.setVisibility(d.name, !0);
|
|
639
649
|
}
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
(
|
|
643
|
-
var
|
|
644
|
-
|
|
650
|
+
const L = [
|
|
651
|
+
i.collectionComponent.collection.removed.addEventListener(
|
|
652
|
+
(l) => {
|
|
653
|
+
var d;
|
|
654
|
+
i.remove(l.name), ((d = t.value) == null ? void 0 : d.name) === l.name && v();
|
|
645
655
|
}
|
|
646
656
|
),
|
|
647
|
-
|
|
648
|
-
var
|
|
649
|
-
const
|
|
650
|
-
`${
|
|
657
|
+
i.renamed.addEventListener(({ item: l, title: d }) => {
|
|
658
|
+
var g;
|
|
659
|
+
const p = s.windowManager.get(
|
|
660
|
+
`${i.collectionComponent.id}-editor`
|
|
651
661
|
);
|
|
652
|
-
|
|
662
|
+
p && ((g = t.value) == null ? void 0 : g.name) === l.name && (p.state.headerTitle = d);
|
|
653
663
|
}),
|
|
654
|
-
|
|
655
|
-
var
|
|
656
|
-
const
|
|
657
|
-
|
|
664
|
+
i.visibilityChanged.addEventListener((l) => {
|
|
665
|
+
var p;
|
|
666
|
+
const d = ((p = t.value) == null ? void 0 : p.name) === l.name;
|
|
667
|
+
d ? v() : (P(m.VIEW, l), i.clearSelection()), i.setVisibility(l.name, !d);
|
|
658
668
|
})
|
|
659
669
|
];
|
|
660
|
-
function
|
|
661
|
-
if (!(
|
|
662
|
-
if (a.value =
|
|
670
|
+
function G(l) {
|
|
671
|
+
if (!(l === a.value || !t.value)) {
|
|
672
|
+
if (a.value = l, n.value === m.MOVE && c(), n.value === m.CREATE)
|
|
663
673
|
U(
|
|
664
674
|
s.maps.eventHandler.featureInteraction,
|
|
665
|
-
|
|
666
|
-
),
|
|
667
|
-
else if (
|
|
668
|
-
const { position:
|
|
669
|
-
|
|
670
|
-
const C = I.mercatorToWgs84(
|
|
671
|
-
|
|
672
|
-
}) : (
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
],
|
|
675
|
+
l
|
|
676
|
+
), t.value.heightOffset = l === y.ABSOLUTE ? 0 : re;
|
|
677
|
+
else if (n.value === m.EDIT) {
|
|
678
|
+
const { position: d, heightOffset: p } = t.value;
|
|
679
|
+
l === y.RELATIVE ? s.maps.activeMap.getHeightFromTerrain([I.wgs84ToMercator(d)]).then((g) => {
|
|
680
|
+
const C = I.mercatorToWgs84(g[0]);
|
|
681
|
+
t.value && (t.value.heightOffset = d[2] - C[2], t.value.position = C);
|
|
682
|
+
}) : (t.value.position = [
|
|
683
|
+
d[0],
|
|
684
|
+
d[1],
|
|
685
|
+
d[2] + p
|
|
686
|
+
], t.value.heightOffset = 0);
|
|
677
687
|
}
|
|
678
688
|
}
|
|
679
689
|
}
|
|
680
690
|
return {
|
|
681
|
-
currentViewshed:
|
|
691
|
+
currentViewshed: t,
|
|
682
692
|
currentIsPersisted: o,
|
|
683
|
-
currentEditSession:
|
|
684
|
-
createViewshed:
|
|
685
|
-
viewViewshed(
|
|
686
|
-
|
|
693
|
+
currentEditSession: r,
|
|
694
|
+
createViewshed: _,
|
|
695
|
+
viewViewshed(l) {
|
|
696
|
+
P(m.VIEW, l);
|
|
687
697
|
},
|
|
688
|
-
editViewshed(
|
|
689
|
-
|
|
698
|
+
editViewshed(l) {
|
|
699
|
+
P(m.EDIT, l), o.value && (i.setSelection(l.name), i.collectionComponent.openEditorWindow(l));
|
|
690
700
|
},
|
|
691
701
|
persistCurrent() {
|
|
692
|
-
|
|
702
|
+
t.value && (i.add(t.value), o.value = !0, i.setSelection(t.value.name), i.setVisibility(t.value.name, !0));
|
|
693
703
|
},
|
|
694
|
-
moveCurrentViewshed:
|
|
704
|
+
moveCurrentViewshed: V,
|
|
695
705
|
setupMultiSelect() {
|
|
696
|
-
|
|
706
|
+
c(), n.value = m.MULTI_SELECT, h(), t.value = null;
|
|
697
707
|
},
|
|
698
|
-
mode:
|
|
708
|
+
mode: n,
|
|
699
709
|
heightMode: a,
|
|
700
|
-
changeHeightMode:
|
|
710
|
+
changeHeightMode: G,
|
|
701
711
|
async placeCurrentFeaturesOnTerrain() {
|
|
702
|
-
var
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
I.wgs84ToMercator((
|
|
706
|
-
]))[0][2] -
|
|
707
|
-
|
|
712
|
+
var l, d;
|
|
713
|
+
if (t.value && ((l = r.value) == null ? void 0 : l.type) === Ce.EDIT_FEATURES && s.maps.activeMap instanceof D) {
|
|
714
|
+
const g = (await s.maps.activeMap.getHeightFromTerrain([
|
|
715
|
+
I.wgs84ToMercator((d = t.value) == null ? void 0 : d.position)
|
|
716
|
+
]))[0][2] - t.value.position[2];
|
|
717
|
+
r.value.translate(0, 0, g);
|
|
708
718
|
}
|
|
709
719
|
},
|
|
710
|
-
stop:
|
|
720
|
+
stop: v,
|
|
711
721
|
destroy() {
|
|
712
|
-
|
|
722
|
+
v(), L.forEach((l) => l());
|
|
713
723
|
}
|
|
714
724
|
};
|
|
715
725
|
}
|
|
716
|
-
function
|
|
717
|
-
var
|
|
718
|
-
e && (
|
|
719
|
-
var
|
|
720
|
-
if (a ? (
|
|
721
|
-
|
|
726
|
+
function ve(s, e, i, t, o, n, a, c) {
|
|
727
|
+
var r = typeof s == "function" ? s.options : s;
|
|
728
|
+
e && (r.render = e, r.staticRenderFns = i, r._compiled = !0), t && (r.functional = !0), n && (r._scopeId = "data-v-" + n);
|
|
729
|
+
var f;
|
|
730
|
+
if (a ? (f = function(u) {
|
|
731
|
+
u = u || // cached call
|
|
722
732
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
723
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
724
|
-
},
|
|
733
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !u && typeof __VUE_SSR_CONTEXT__ < "u" && (u = __VUE_SSR_CONTEXT__), o && o.call(this, u), u && u._registeredComponents && u._registeredComponents.add(a);
|
|
734
|
+
}, r._ssrRegister = f) : o && (f = c ? function() {
|
|
725
735
|
o.call(
|
|
726
736
|
this,
|
|
727
|
-
(
|
|
737
|
+
(r.functional ? this.parent : this).$root.$options.shadowRoot
|
|
728
738
|
);
|
|
729
|
-
} : o),
|
|
730
|
-
if (
|
|
731
|
-
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
return
|
|
739
|
+
} : o), f)
|
|
740
|
+
if (r.functional) {
|
|
741
|
+
r._injectStyles = f;
|
|
742
|
+
var h = r.render;
|
|
743
|
+
r.render = function(_, V) {
|
|
744
|
+
return f.call(V), h(_, V);
|
|
735
745
|
};
|
|
736
746
|
} else {
|
|
737
|
-
var
|
|
738
|
-
|
|
747
|
+
var v = r.beforeCreate;
|
|
748
|
+
r.beforeCreate = v ? [].concat(v, f) : [f];
|
|
739
749
|
}
|
|
740
750
|
return {
|
|
741
751
|
exports: s,
|
|
742
|
-
options:
|
|
752
|
+
options: r
|
|
743
753
|
};
|
|
744
754
|
}
|
|
745
|
-
const
|
|
746
|
-
distance: [
|
|
755
|
+
const wt = {
|
|
756
|
+
distance: [M.MIN_DISTANCE, 2e3],
|
|
747
757
|
fov: [25, 85],
|
|
748
758
|
heading: [0, 360],
|
|
749
759
|
pitch: [-90, 90]
|
|
750
|
-
},
|
|
760
|
+
}, mt = {
|
|
751
761
|
components: {
|
|
752
|
-
VcsTextField:
|
|
753
|
-
VContainer:
|
|
754
|
-
VRow:
|
|
755
|
-
VCol:
|
|
756
|
-
VcsSlider:
|
|
757
|
-
VcsLabel:
|
|
758
|
-
VcsFormSection:
|
|
759
|
-
VDivider:
|
|
760
|
-
VcsSelect:
|
|
761
|
-
VcsFormButton:
|
|
762
|
-
VcsFeatureTransforms:
|
|
762
|
+
VcsTextField: Ue,
|
|
763
|
+
VContainer: de,
|
|
764
|
+
VRow: he,
|
|
765
|
+
VCol: ue,
|
|
766
|
+
VcsSlider: Ke,
|
|
767
|
+
VcsLabel: ae,
|
|
768
|
+
VcsFormSection: le,
|
|
769
|
+
VDivider: st,
|
|
770
|
+
VcsSelect: ce,
|
|
771
|
+
VcsFormButton: Xe,
|
|
772
|
+
VcsFeatureTransforms: Ye
|
|
763
773
|
},
|
|
764
774
|
name: "ViewshedWindow",
|
|
765
775
|
props: {
|
|
@@ -777,244 +787,244 @@ const vt = {
|
|
|
777
787
|
setup(s) {
|
|
778
788
|
const e = (
|
|
779
789
|
/** @type {import("./viewshedManager.js").ViewshedManager} */
|
|
780
|
-
|
|
781
|
-
),
|
|
790
|
+
oe("manager")
|
|
791
|
+
), i = (
|
|
782
792
|
/** @type {import("@vcmap/ui").VcsUiApp} */
|
|
783
|
-
|
|
793
|
+
oe("vcsApp")
|
|
784
794
|
), {
|
|
785
|
-
currentViewshed:
|
|
795
|
+
currentViewshed: t,
|
|
786
796
|
mode: o,
|
|
787
|
-
currentIsPersisted:
|
|
788
|
-
} = e, a =
|
|
789
|
-
let
|
|
797
|
+
currentIsPersisted: n
|
|
798
|
+
} = e, a = ne(() => s.selection);
|
|
799
|
+
let c = () => {
|
|
790
800
|
};
|
|
791
|
-
const
|
|
801
|
+
const r = W({
|
|
792
802
|
X: void 0,
|
|
793
803
|
Y: void 0,
|
|
794
804
|
Z: void 0
|
|
795
|
-
}),
|
|
796
|
-
let
|
|
805
|
+
}), f = K();
|
|
806
|
+
let h = () => {
|
|
797
807
|
};
|
|
798
|
-
const
|
|
808
|
+
const v = W({
|
|
799
809
|
showPrimitive: !1,
|
|
800
810
|
distance: void 0,
|
|
801
811
|
fov: void 0,
|
|
802
812
|
heading: void 0,
|
|
803
813
|
pitch: void 0
|
|
804
|
-
}),
|
|
814
|
+
}), u = A();
|
|
805
815
|
function _() {
|
|
806
|
-
|
|
816
|
+
t.value && (r.X = t.value.position[0], r.Y = t.value.position[1], r.Z = e.heightMode.value === y.ABSOLUTE ? t.value.position[2] : t.value.heightOffset);
|
|
807
817
|
}
|
|
808
|
-
function
|
|
809
|
-
_(),
|
|
818
|
+
function V() {
|
|
819
|
+
_(), t.value && (v.distance = t.value.distance, v.fov = t.value.fov, v.heading = t.value.heading, v.pitch = t.value.pitch, v.showPrimitive = t.value.showPrimitive, u.value = t.value.type);
|
|
810
820
|
}
|
|
811
|
-
|
|
812
|
-
|
|
821
|
+
Fe(() => {
|
|
822
|
+
t.value && o.value !== m.CREATE && V();
|
|
813
823
|
}), R(
|
|
814
|
-
|
|
824
|
+
t,
|
|
815
825
|
() => {
|
|
816
|
-
|
|
817
|
-
_(),
|
|
826
|
+
t.value && (c(), c = t.value.positionChanged.addEventListener(() => {
|
|
827
|
+
_(), h();
|
|
818
828
|
}));
|
|
819
829
|
},
|
|
820
830
|
{ immediate: !0 }
|
|
821
831
|
);
|
|
822
|
-
async function
|
|
823
|
-
var
|
|
824
|
-
(
|
|
825
|
-
const
|
|
832
|
+
async function P() {
|
|
833
|
+
var p, g;
|
|
834
|
+
(p = t.value) == null || p.deactivate();
|
|
835
|
+
const l = (
|
|
826
836
|
/** @type {import("@vcmap/core").CesiumMap} */
|
|
827
|
-
(
|
|
828
|
-
),
|
|
829
|
-
|
|
837
|
+
(g = i.maps.activeMap.getScene()) == null ? void 0 : g.camera
|
|
838
|
+
), d = l == null ? void 0 : l.changed.addEventListener(() => {
|
|
839
|
+
h();
|
|
830
840
|
});
|
|
831
|
-
|
|
832
|
-
var
|
|
833
|
-
|
|
841
|
+
h = () => {
|
|
842
|
+
var C;
|
|
843
|
+
d == null || d(), f.value = null, (C = t.value) == null || C.activate(i.maps.activeMap), h = () => {
|
|
834
844
|
};
|
|
835
845
|
};
|
|
836
846
|
}
|
|
837
|
-
|
|
838
|
-
var
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
-
}),
|
|
842
|
-
|
|
847
|
+
je(() => {
|
|
848
|
+
var d;
|
|
849
|
+
const l = (d = s.getViewshed) == null ? void 0 : d.call(s);
|
|
850
|
+
l && e.editViewshed(l);
|
|
851
|
+
}), We(() => {
|
|
852
|
+
c(), h(), n.value || ((o.value === m.EDIT || o.value === m.MOVE) && t.value ? e.viewViewshed(t.value) : o.value === m.CREATE && e.stop()), a.value && (a.value.length > 1 ? e.setupMultiSelect() : a.value.length === 1 && t.value ? e.viewViewshed(t.value) : (
|
|
843
853
|
// when a persited viewshed is deselected, stops plugin
|
|
844
|
-
!a.value.length && o.value ===
|
|
854
|
+
!a.value.length && o.value === m.EDIT && e.stop(!1)
|
|
845
855
|
));
|
|
846
|
-
}),
|
|
847
|
-
function
|
|
848
|
-
|
|
856
|
+
}), V();
|
|
857
|
+
function L(l, d) {
|
|
858
|
+
h(), t.value && (v[l] = d, t.value[l] = d);
|
|
849
859
|
}
|
|
850
|
-
const
|
|
851
|
-
const
|
|
852
|
-
return
|
|
860
|
+
const G = ne(() => {
|
|
861
|
+
const l = [];
|
|
862
|
+
return u.value === w.CONE && l.push({
|
|
853
863
|
name: "jumpToViewpoint",
|
|
854
|
-
title:
|
|
864
|
+
title: f.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
|
|
855
865
|
icon: "mdi-human-male",
|
|
856
|
-
active: !!
|
|
866
|
+
active: !!f.value,
|
|
857
867
|
async callback() {
|
|
858
|
-
var
|
|
859
|
-
e.moveCurrentViewshed(!1),
|
|
860
|
-
new
|
|
868
|
+
var d, p, g;
|
|
869
|
+
e.moveCurrentViewshed(!1), t.value && !f.value ? (f.value = await ((d = i.maps.activeMap) == null ? void 0 : d.getViewpoint()), await ((p = i.maps.activeMap) == null ? void 0 : p.gotoViewpoint(
|
|
870
|
+
new Oe({
|
|
861
871
|
groundPosition: [
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
872
|
+
t.value.position[0],
|
|
873
|
+
t.value.position[1],
|
|
874
|
+
t.value.position[2] + t.value.heightOffset
|
|
865
875
|
],
|
|
866
|
-
heading:
|
|
867
|
-
pitch:
|
|
876
|
+
heading: t.value.heading,
|
|
877
|
+
pitch: t.value.pitch,
|
|
868
878
|
distance: 0,
|
|
869
879
|
animate: !0
|
|
870
880
|
// if not animate, async does not work and the cameraChanged listener is triggered immediately. alternatively set timeout
|
|
871
881
|
})
|
|
872
|
-
)),
|
|
882
|
+
)), P()) : f.value && ((g = i.maps.activeMap) == null || g.gotoViewpoint(f.value), h());
|
|
873
883
|
}
|
|
874
|
-
}),
|
|
884
|
+
}), l.push({
|
|
875
885
|
name: "moveViewshed",
|
|
876
886
|
title: "viewshed.move",
|
|
877
|
-
icon: e.heightMode.value ===
|
|
878
|
-
active: o.value ===
|
|
887
|
+
icon: e.heightMode.value === y.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
|
|
888
|
+
active: o.value === m.MOVE,
|
|
879
889
|
callback() {
|
|
880
890
|
e.moveCurrentViewshed(
|
|
881
|
-
o.value !==
|
|
891
|
+
o.value !== m.MOVE
|
|
882
892
|
);
|
|
883
893
|
}
|
|
884
|
-
}),
|
|
894
|
+
}), l.unshift({
|
|
885
895
|
name: "showPrimitive",
|
|
886
896
|
title: "viewshed.showPrimitive",
|
|
887
897
|
icon: "mdi-eye",
|
|
888
|
-
active:
|
|
898
|
+
active: v.showPrimitive,
|
|
889
899
|
callback() {
|
|
890
|
-
this.active = !this.active,
|
|
900
|
+
this.active = !this.active, L("showPrimitive", this.active);
|
|
891
901
|
}
|
|
892
|
-
}),
|
|
902
|
+
}), l;
|
|
893
903
|
});
|
|
894
904
|
return {
|
|
895
|
-
position:
|
|
896
|
-
setPosition(d, p
|
|
897
|
-
if (
|
|
898
|
-
if (
|
|
899
|
-
|
|
905
|
+
position: r,
|
|
906
|
+
setPosition(l, d, p) {
|
|
907
|
+
if (h(), !!t.value) {
|
|
908
|
+
if (p === 2 && e.heightMode.value === y.RELATIVE)
|
|
909
|
+
t.value.heightOffset = Number(l);
|
|
900
910
|
else {
|
|
901
|
-
const
|
|
902
|
-
|
|
911
|
+
const g = [...t.value.position];
|
|
912
|
+
g[p] = Number(l), t.value.position = g;
|
|
903
913
|
}
|
|
904
|
-
|
|
914
|
+
r[d] = Number(l);
|
|
905
915
|
}
|
|
906
916
|
},
|
|
907
|
-
parameters:
|
|
908
|
-
setParameter:
|
|
909
|
-
parameterRanges:
|
|
910
|
-
ViewshedPluginModes:
|
|
917
|
+
parameters: v,
|
|
918
|
+
setParameter: L,
|
|
919
|
+
parameterRanges: wt,
|
|
920
|
+
ViewshedPluginModes: m,
|
|
911
921
|
viewshedMode: o,
|
|
912
|
-
currentIsPersisted:
|
|
913
|
-
viewshedType:
|
|
922
|
+
currentIsPersisted: n,
|
|
923
|
+
viewshedType: u,
|
|
914
924
|
ViewshedTypes: w,
|
|
915
|
-
HeightModes:
|
|
925
|
+
HeightModes: y,
|
|
916
926
|
heightMode: e.heightMode,
|
|
917
|
-
TransformationMode:
|
|
927
|
+
TransformationMode: Se,
|
|
918
928
|
changeHeightMode: e.changeHeightMode,
|
|
919
929
|
async createNewViewshed() {
|
|
920
|
-
await e.createViewshed(
|
|
930
|
+
await e.createViewshed(u.value);
|
|
921
931
|
},
|
|
922
932
|
addToMyWorkspace: () => e.persistCurrent(),
|
|
923
933
|
cancel: () => e.stop(),
|
|
924
|
-
headerActions:
|
|
934
|
+
headerActions: G
|
|
925
935
|
};
|
|
926
936
|
}
|
|
927
937
|
};
|
|
928
|
-
var
|
|
929
|
-
var e = this,
|
|
930
|
-
return
|
|
931
|
-
return
|
|
932
|
-
}), 1)], 1)], 1) : e._e(),
|
|
933
|
-
value:
|
|
934
|
-
text: `viewshed.${
|
|
935
|
-
})), value: e.heightMode }, on: { input: e.changeHeightMode } })], 1)], 1)], 1), e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ?
|
|
936
|
-
return
|
|
937
|
-
}), 1) : e._e(),
|
|
938
|
+
var gt = function() {
|
|
939
|
+
var e = this, i = e._self._c;
|
|
940
|
+
return i("div", [e.viewshedMode === e.ViewshedPluginModes.CREATE ? i("div", { staticClass: "px-2 py-1" }, [e.viewshedType === e.ViewshedTypes.CONE ? [e._v(" " + e._s(e.$t("viewshed.createDescription")) + " ")] : e.viewshedType === e.ViewshedTypes.THREESIXTY ? [e._v(" " + e._s(e.$t("viewshed.createThreeSixtyDescription")) + " ")] : e._e()], 2) : e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? i("VcsFormSection", { attrs: { "header-actions": e.headerActions, heading: "viewshed.viewpoint", "action-button-list-overflow-count": 3 } }, [i("v-container", { staticClass: "px-1 py-0" }, [i("v-row", { attrs: { "no-gutters": "" } }, [i("span", { staticClass: "px-1 py-0" }, [e._v(e._s(e.$t("viewshed.position")))])]), e.viewshedMode === e.ViewshedPluginModes.MOVE && e.heightMode === e.HeightModes.ABSOLUTE ? i("v-row", { attrs: { "no-gutters": "" } }, [i("VcsFeatureTransforms", { attrs: { "transformation-mode": e.TransformationMode.TRANSLATE, "feature-properties": { altitudeMode: "absolute" }, "allow-z-input": !0 } })], 1) : i("v-row", { attrs: { "no-gutters": "" } }, e._l(e.position, function(t, o, n) {
|
|
941
|
+
return i("v-col", { key: n, staticClass: "pb-1" }, [i("VcsTextField", { attrs: { value: t, type: "number", prefix: o, "show-spin-buttons": !0, step: o === "Z" ? 1 : 1e-4, unit: o === "Z" ? "m" : "°", decimals: o === "Z" ? 2 : 8, disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(o === "Z" && e.heightMode === e.HeightModes.RELATIVE) }, on: { input: (a) => e.setPosition(a, o, n) } })], 1);
|
|
942
|
+
}), 1)], 1)], 1) : e._e(), i("v-divider"), i("v-container", { staticClass: "px-1 py-0" }, [i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", [e._v(" " + e._s(e.$t("viewshed.heightMode")) + " ")])], 1), i("v-col", [i("VcsSelect", { attrs: { items: Object.values(e.HeightModes).map((t) => ({
|
|
943
|
+
value: t,
|
|
944
|
+
text: `viewshed.${t}`
|
|
945
|
+
})), value: e.heightMode }, on: { input: e.changeHeightMode } })], 1)], 1)], 1), e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? i("v-container", { staticClass: "px-1 pt-0 pb-2" }, e._l(e.parameters, function(t, o) {
|
|
946
|
+
return i("v-row", { key: o, attrs: { "no-gutters": "" } }, [o === "distance" || e.viewshedType === e.ViewshedTypes.CONE && o !== "showPrimitive" ? i("v-col", [i("v-row", { staticClass: "pr-1", attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", { attrs: { "html-for": o } }, [e._v(" " + e._s(e.$t(`viewshed.${o}`)) + " ")])], 1), i("v-col", { staticClass: "d-flex justify-end align-center" }, [o === "distance" ? i("span", [e._v(e._s(`${t} m`))]) : i("span", [e._v(e._s(`${t} °`))])])], 1), i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsSlider", { attrs: { id: o, value: t, type: "number", step: "1", min: e.parameterRanges[o][0], max: e.parameterRanges[o][1], height: "15" }, on: { input: (n) => e.setParameter(o, n) } })], 1)], 1)], 1) : e._e()], 1);
|
|
947
|
+
}), 1) : e._e(), i("v-divider"), e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? i("div", { staticClass: "d-flex w-full justify-space-between px-2 pt-2 pb-1" }, [i("VcsFormButton", { attrs: { tooltip: "viewshed.addToMyWorkspace", icon: "$vcsComponentsPlus", disabled: e.currentIsPersisted || void 0 }, on: { click: function(t) {
|
|
938
948
|
return e.addToMyWorkspace();
|
|
939
|
-
} } }),
|
|
949
|
+
} } }), i("VcsFormButton", { attrs: { variant: "filled" }, on: { click: function(t) {
|
|
940
950
|
return e.createNewViewshed();
|
|
941
|
-
} } }, [e._v(" " + e._s(e.$t("viewshed.new")) + " ")])], 1) : e.viewshedMode === e.ViewshedPluginModes.CREATE ?
|
|
951
|
+
} } }, [e._v(" " + e._s(e.$t("viewshed.new")) + " ")])], 1) : e.viewshedMode === e.ViewshedPluginModes.CREATE ? i("div", { staticClass: "d-flex w-full justify-end px-2 pt-2 pb-1" }, [i("VcsFormButton", { attrs: { variant: "filled" }, on: { click: function(t) {
|
|
942
952
|
return e.cancel();
|
|
943
953
|
} } }, [e._v(" " + e._s(e.$t("viewshed.cancel")) + " ")])], 1) : e._e()], 1);
|
|
944
|
-
},
|
|
945
|
-
pt,
|
|
946
|
-
wt,
|
|
954
|
+
}, _t = [], Ct = /* @__PURE__ */ ve(
|
|
947
955
|
mt,
|
|
956
|
+
gt,
|
|
957
|
+
_t,
|
|
948
958
|
!1,
|
|
949
959
|
null,
|
|
950
960
|
null,
|
|
951
961
|
null,
|
|
952
962
|
null
|
|
953
963
|
);
|
|
954
|
-
const
|
|
964
|
+
const Et = Ct.exports, S = "@vcmap/viewshed", yt = "2.0.5", Vt = "^5.1", J = {
|
|
955
965
|
[w.CONE]: "$vcsViewshed",
|
|
956
966
|
[w.THREESIXTY]: "$vcsViewshedCone"
|
|
957
967
|
};
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
component:
|
|
968
|
+
function bt(s, e, i) {
|
|
969
|
+
const t = A(), o = A(), n = `${i.id}-editor`, a = {
|
|
970
|
+
component: Et,
|
|
961
971
|
provides: {
|
|
962
972
|
manager: s
|
|
963
973
|
},
|
|
964
974
|
state: {
|
|
965
|
-
headerTitle:
|
|
975
|
+
headerTitle: t,
|
|
966
976
|
headerIcon: o,
|
|
967
977
|
styles: { width: "280px", height: "auto" },
|
|
968
978
|
infoUrlCallback: e.getHelpUrlCallback("tools/viewshedTool.html")
|
|
969
979
|
}
|
|
970
980
|
};
|
|
971
|
-
|
|
972
|
-
editor: (
|
|
981
|
+
Je(e, i, {
|
|
982
|
+
editor: (u) => ({
|
|
973
983
|
...a,
|
|
974
984
|
props: {
|
|
975
|
-
selection:
|
|
976
|
-
getViewshed: () =>
|
|
985
|
+
selection: i.selection,
|
|
986
|
+
getViewshed: () => i.collection.getByKey(u.name)
|
|
977
987
|
}
|
|
978
988
|
})
|
|
979
989
|
});
|
|
980
|
-
function
|
|
981
|
-
s.currentViewshed.value && (o.value =
|
|
990
|
+
function c() {
|
|
991
|
+
s.currentViewshed.value && (o.value = J[s.currentViewshed.value.type], s.currentIsPersisted.value ? t.value = s.currentViewshed.value.properties.title : s.mode.value === m.CREATE ? t.value = [
|
|
982
992
|
"viewshed.create",
|
|
983
993
|
`viewshed.${s.currentViewshed.value.type}`
|
|
984
|
-
] :
|
|
994
|
+
] : t.value = [
|
|
985
995
|
"viewshed.temporary",
|
|
986
996
|
`viewshed.${s.currentViewshed.value.type}`
|
|
987
997
|
]);
|
|
988
998
|
}
|
|
989
|
-
function
|
|
990
|
-
|
|
999
|
+
function r() {
|
|
1000
|
+
c(), s.currentViewshed.value && !s.currentIsPersisted.value && (s.mode.value === m.EDIT || s.mode.value === m.MOVE || s.mode.value === m.CREATE) && (e.windowManager.has(n) || e.windowManager.add(
|
|
991
1001
|
{
|
|
992
1002
|
...a,
|
|
993
|
-
id:
|
|
1003
|
+
id: n,
|
|
994
1004
|
parentId: "category-manager",
|
|
995
|
-
slot:
|
|
1005
|
+
slot: Ze.DYNAMIC_LEFT
|
|
996
1006
|
},
|
|
997
|
-
|
|
1007
|
+
S
|
|
998
1008
|
));
|
|
999
1009
|
}
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
}),
|
|
1003
|
-
|
|
1004
|
-
}),
|
|
1005
|
-
s.mode.value ?
|
|
1010
|
+
const f = R(s.currentViewshed, (u) => {
|
|
1011
|
+
u && r();
|
|
1012
|
+
}), h = R(s.currentIsPersisted, (u) => {
|
|
1013
|
+
u && c();
|
|
1014
|
+
}), v = R(s.mode, () => {
|
|
1015
|
+
s.mode.value ? r() : e.windowManager.remove(n);
|
|
1006
1016
|
});
|
|
1007
1017
|
return {
|
|
1008
1018
|
destroy() {
|
|
1009
|
-
e.windowManager.remove(
|
|
1019
|
+
e.windowManager.remove(n), f(), v(), h();
|
|
1010
1020
|
}
|
|
1011
1021
|
};
|
|
1012
1022
|
}
|
|
1013
|
-
function
|
|
1023
|
+
function Mt(s, e, i, t) {
|
|
1014
1024
|
const o = {
|
|
1015
|
-
type:
|
|
1016
|
-
action:
|
|
1017
|
-
name:
|
|
1025
|
+
type: qe.SELECT,
|
|
1026
|
+
action: W({
|
|
1027
|
+
name: i,
|
|
1018
1028
|
currentIndex: 0,
|
|
1019
1029
|
active: !1,
|
|
1020
1030
|
background: !1,
|
|
@@ -1023,193 +1033,193 @@ function yt(s, e, t, i) {
|
|
|
1023
1033
|
if (this.active)
|
|
1024
1034
|
this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop();
|
|
1025
1035
|
else {
|
|
1026
|
-
const
|
|
1027
|
-
e.createViewshed(
|
|
1036
|
+
const r = this.tools[this.currentIndex].name;
|
|
1037
|
+
e.createViewshed(r);
|
|
1028
1038
|
}
|
|
1029
1039
|
},
|
|
1030
|
-
selected(
|
|
1031
|
-
if (
|
|
1032
|
-
this.currentIndex =
|
|
1033
|
-
const
|
|
1034
|
-
e.createViewshed(
|
|
1040
|
+
selected(r) {
|
|
1041
|
+
if (r !== this.currentIndex) {
|
|
1042
|
+
this.currentIndex = r;
|
|
1043
|
+
const f = this.tools[this.currentIndex].name;
|
|
1044
|
+
e.createViewshed(f);
|
|
1035
1045
|
}
|
|
1036
1046
|
},
|
|
1037
|
-
tools:
|
|
1047
|
+
tools: t.flatMap((r) => r === w.CONE ? {
|
|
1038
1048
|
name: w.CONE,
|
|
1039
|
-
icon:
|
|
1049
|
+
icon: J[w.CONE],
|
|
1040
1050
|
title: `viewshed.${w.CONE}`
|
|
1041
|
-
} :
|
|
1051
|
+
} : r === w.THREESIXTY ? {
|
|
1042
1052
|
name: w.THREESIXTY,
|
|
1043
|
-
icon:
|
|
1053
|
+
icon: J[w.THREESIXTY],
|
|
1044
1054
|
title: `viewshed.${w.THREESIXTY}`
|
|
1045
1055
|
} : [])
|
|
1046
1056
|
})
|
|
1047
|
-
},
|
|
1048
|
-
|
|
1057
|
+
}, n = R(e.mode, (r) => {
|
|
1058
|
+
r === m.VIEW ? (o.action.background = !0, o.action.active = !0) : r ? (o.action.background = !1, o.action.active = !0) : (o.action.background = !1, o.action.active = !1);
|
|
1049
1059
|
}), a = R(
|
|
1050
1060
|
e.currentViewshed,
|
|
1051
|
-
(
|
|
1052
|
-
|
|
1053
|
-
(
|
|
1061
|
+
(r) => {
|
|
1062
|
+
r && (o.action.currentIndex = o.action.tools.findIndex(
|
|
1063
|
+
(f) => f.name === r.type
|
|
1054
1064
|
));
|
|
1055
1065
|
}
|
|
1056
|
-
),
|
|
1057
|
-
|
|
1066
|
+
), c = s.maps.mapActivated.addEventListener((r) => {
|
|
1067
|
+
r instanceof D ? o.action.disabled = !1 : o.action.disabled = !0;
|
|
1058
1068
|
});
|
|
1059
1069
|
return {
|
|
1060
1070
|
destroy() {
|
|
1061
|
-
|
|
1071
|
+
n(), a(), c();
|
|
1062
1072
|
},
|
|
1063
1073
|
toolbox: o
|
|
1064
1074
|
};
|
|
1065
1075
|
}
|
|
1066
|
-
function
|
|
1067
|
-
z(
|
|
1068
|
-
const { toolbox: o, destroy:
|
|
1076
|
+
function Tt(s, e, i, t) {
|
|
1077
|
+
z(t, [Object.values(w)]);
|
|
1078
|
+
const { toolbox: o, destroy: n } = Mt(s, e, i, t), a = s.toolboxManager.add(o, i).id;
|
|
1069
1079
|
return () => {
|
|
1070
|
-
s.toolboxManager.remove(a),
|
|
1080
|
+
s.toolboxManager.remove(a), n();
|
|
1071
1081
|
};
|
|
1072
1082
|
}
|
|
1073
|
-
class
|
|
1083
|
+
class Z extends Pe {
|
|
1074
1084
|
static get className() {
|
|
1075
1085
|
return "ViewshedCategory";
|
|
1076
1086
|
}
|
|
1077
1087
|
async _deserializeItem(e) {
|
|
1078
|
-
var
|
|
1079
|
-
const
|
|
1088
|
+
var t;
|
|
1089
|
+
const i = (
|
|
1080
1090
|
/** @type {import("@vcmap/core").CesiumMap | undefined} */
|
|
1081
|
-
(
|
|
1091
|
+
(t = this._app) == null ? void 0 : t.maps.getByType(D.className)[0]
|
|
1082
1092
|
);
|
|
1083
|
-
if (
|
|
1084
|
-
return new
|
|
1093
|
+
if (i)
|
|
1094
|
+
return new M(e, i);
|
|
1085
1095
|
throw new Error("No CesiumMap available");
|
|
1086
1096
|
}
|
|
1087
1097
|
}
|
|
1088
|
-
function
|
|
1089
|
-
let
|
|
1098
|
+
function Ot(s, e) {
|
|
1099
|
+
let i, t = 0;
|
|
1090
1100
|
const o = new Set(
|
|
1091
|
-
e.filter((
|
|
1101
|
+
e.filter((n) => n.type === s).map((n) => n.properties.title)
|
|
1092
1102
|
);
|
|
1093
1103
|
do
|
|
1094
|
-
|
|
1095
|
-
while (!
|
|
1096
|
-
return
|
|
1104
|
+
t += 1, o.has(`${s}-${t}`) || (i = `${s}-${t}`);
|
|
1105
|
+
while (!i);
|
|
1106
|
+
return i;
|
|
1097
1107
|
}
|
|
1098
|
-
async function
|
|
1099
|
-
const e = new
|
|
1108
|
+
async function St(s) {
|
|
1109
|
+
const e = new x(), i = new x(), { collectionComponent: t, category: o } = await s.categoryManager.requestCategory(
|
|
1100
1110
|
{
|
|
1101
|
-
type:
|
|
1111
|
+
type: Z.className,
|
|
1102
1112
|
name: "Viewsheds",
|
|
1103
1113
|
title: "Viewsheds"
|
|
1104
1114
|
},
|
|
1105
|
-
|
|
1115
|
+
S,
|
|
1106
1116
|
{
|
|
1107
1117
|
selectable: !0,
|
|
1108
1118
|
renamable: !0,
|
|
1109
1119
|
removable: !0
|
|
1110
1120
|
}
|
|
1111
|
-
),
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
},
|
|
1115
|
-
|
|
1121
|
+
), n = (h, v, u) => {
|
|
1122
|
+
u.title = h.properties.title, u.titleChanged = (_) => {
|
|
1123
|
+
h.properties.title = _, u.title = _, e.raiseEvent({ item: h, title: _ });
|
|
1124
|
+
}, u.actions.push(
|
|
1125
|
+
W({
|
|
1116
1126
|
name: "visibilityAction",
|
|
1117
1127
|
icon: "$vcsCheckbox",
|
|
1118
1128
|
callback() {
|
|
1119
|
-
|
|
1129
|
+
i.raiseEvent(h);
|
|
1120
1130
|
}
|
|
1121
1131
|
})
|
|
1122
1132
|
);
|
|
1123
1133
|
};
|
|
1124
1134
|
s.categoryManager.addMappingFunction(
|
|
1125
1135
|
() => !0,
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
[
|
|
1136
|
+
n,
|
|
1137
|
+
S,
|
|
1138
|
+
[t.id]
|
|
1129
1139
|
);
|
|
1130
|
-
const { action: a, destroy:
|
|
1131
|
-
|
|
1140
|
+
const { action: a, destroy: c } = Qe(
|
|
1141
|
+
t.selection,
|
|
1132
1142
|
() => {
|
|
1133
|
-
const
|
|
1134
|
-
(
|
|
1143
|
+
const h = t.selection.value.map(
|
|
1144
|
+
(v) => t.collection.getByKey(v.name)
|
|
1135
1145
|
);
|
|
1136
|
-
|
|
1146
|
+
et(JSON.stringify(h), "viewsheds.json");
|
|
1137
1147
|
},
|
|
1138
|
-
|
|
1139
|
-
), { action:
|
|
1140
|
-
async (
|
|
1148
|
+
S
|
|
1149
|
+
), { action: r, destroy: f } = tt(
|
|
1150
|
+
async (h) => {
|
|
1141
1151
|
await Promise.all(
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1144
|
-
JSON.parse(
|
|
1145
|
-
const
|
|
1146
|
-
o.collection.add(
|
|
1152
|
+
h.map(async (v) => {
|
|
1153
|
+
const u = await v.text();
|
|
1154
|
+
JSON.parse(u).forEach((V) => {
|
|
1155
|
+
const P = new M(V);
|
|
1156
|
+
o.collection.add(P);
|
|
1147
1157
|
});
|
|
1148
1158
|
})
|
|
1149
1159
|
);
|
|
1150
1160
|
},
|
|
1151
1161
|
s.windowManager,
|
|
1152
|
-
|
|
1162
|
+
S,
|
|
1153
1163
|
"category-manager"
|
|
1154
1164
|
);
|
|
1155
|
-
return
|
|
1165
|
+
return t.addActions([a, r]), {
|
|
1156
1166
|
renamed: e,
|
|
1157
|
-
visibilityChanged:
|
|
1158
|
-
setSelection(
|
|
1159
|
-
|
|
1167
|
+
visibilityChanged: i,
|
|
1168
|
+
setSelection(h) {
|
|
1169
|
+
h && (t.selection.value = t.items.value.filter((v) => h === v.name));
|
|
1160
1170
|
},
|
|
1161
1171
|
clearSelection() {
|
|
1162
|
-
|
|
1172
|
+
t.selection.value.length && (t.selection.value = []);
|
|
1163
1173
|
},
|
|
1164
|
-
setVisibility(
|
|
1165
|
-
const
|
|
1166
|
-
(_) =>
|
|
1174
|
+
setVisibility(h, v) {
|
|
1175
|
+
const u = t.items.value.find(
|
|
1176
|
+
(_) => h === _.name
|
|
1167
1177
|
);
|
|
1168
|
-
if (
|
|
1169
|
-
const _ =
|
|
1170
|
-
(
|
|
1178
|
+
if (u) {
|
|
1179
|
+
const _ = u.actions.find(
|
|
1180
|
+
(V) => V.name === "visibilityAction"
|
|
1171
1181
|
);
|
|
1172
|
-
_ && (_.icon =
|
|
1182
|
+
_ && (_.icon = v ? "$vcsCheckboxChecked" : "$vcsCheckbox");
|
|
1173
1183
|
}
|
|
1174
1184
|
},
|
|
1175
|
-
add(
|
|
1176
|
-
|
|
1177
|
-
|
|
1185
|
+
add(h) {
|
|
1186
|
+
h.properties.title = Ot(
|
|
1187
|
+
h.type,
|
|
1178
1188
|
/** @type {import("./viewshed.js").default[]} */
|
|
1179
1189
|
[
|
|
1180
1190
|
...o.collection
|
|
1181
1191
|
]
|
|
1182
|
-
), o.collection.add(
|
|
1192
|
+
), o.collection.add(h);
|
|
1183
1193
|
},
|
|
1184
|
-
remove(
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1194
|
+
remove(h) {
|
|
1195
|
+
const v = o.collection.getByKey(h);
|
|
1196
|
+
v && o.collection.remove(v);
|
|
1187
1197
|
},
|
|
1188
|
-
collectionComponent:
|
|
1198
|
+
collectionComponent: t,
|
|
1189
1199
|
destroy() {
|
|
1190
|
-
s.categoryManager.removeOwner(
|
|
1200
|
+
s.categoryManager.removeOwner(S), e.destroy(), i.destroy(), c(), f();
|
|
1191
1201
|
}
|
|
1192
1202
|
};
|
|
1193
1203
|
}
|
|
1194
1204
|
function F() {
|
|
1195
1205
|
return {
|
|
1196
|
-
visibleColor:
|
|
1197
|
-
shadowColor:
|
|
1206
|
+
visibleColor: M.getDefaultOptions().visibleColor,
|
|
1207
|
+
shadowColor: M.getDefaultOptions().shadowColor,
|
|
1198
1208
|
tools: [...Object.values(w)]
|
|
1199
1209
|
};
|
|
1200
1210
|
}
|
|
1201
|
-
const
|
|
1211
|
+
const Pt = {
|
|
1202
1212
|
name: "ViewshedConfigEditor",
|
|
1203
1213
|
title: "Viewshed Editor",
|
|
1204
1214
|
components: {
|
|
1205
|
-
AbstractConfigEditor:
|
|
1206
|
-
VcsFormSection:
|
|
1207
|
-
VContainer:
|
|
1208
|
-
VRow:
|
|
1209
|
-
VCol:
|
|
1210
|
-
VcsLabel:
|
|
1211
|
-
VcsSelect:
|
|
1212
|
-
VColorPicker:
|
|
1215
|
+
AbstractConfigEditor: it,
|
|
1216
|
+
VcsFormSection: le,
|
|
1217
|
+
VContainer: de,
|
|
1218
|
+
VRow: he,
|
|
1219
|
+
VCol: ue,
|
|
1220
|
+
VcsLabel: ae,
|
|
1221
|
+
VcsSelect: ce,
|
|
1222
|
+
VColorPicker: ot
|
|
1213
1223
|
},
|
|
1214
1224
|
props: {
|
|
1215
1225
|
getConfig: {
|
|
@@ -1223,91 +1233,99 @@ const Ot = {
|
|
|
1223
1233
|
},
|
|
1224
1234
|
setup(s) {
|
|
1225
1235
|
const e = A({});
|
|
1226
|
-
s.getConfig().then((
|
|
1227
|
-
e.value = Object.assign(F(),
|
|
1236
|
+
s.getConfig().then((t) => {
|
|
1237
|
+
e.value = Object.assign(F(), t);
|
|
1228
1238
|
});
|
|
1229
|
-
async function
|
|
1239
|
+
async function i() {
|
|
1230
1240
|
await s.setConfig(e.value);
|
|
1231
1241
|
}
|
|
1232
1242
|
return {
|
|
1233
1243
|
localConfig: e,
|
|
1234
1244
|
ViewshedTypes: w,
|
|
1235
|
-
apply:
|
|
1236
|
-
toolItems: Object.values(w).map((
|
|
1237
|
-
value:
|
|
1238
|
-
text: `viewshed.${
|
|
1245
|
+
apply: i,
|
|
1246
|
+
toolItems: Object.values(w).map((t) => ({
|
|
1247
|
+
value: t,
|
|
1248
|
+
text: `viewshed.${t}`
|
|
1239
1249
|
}))
|
|
1240
1250
|
};
|
|
1241
1251
|
}
|
|
1242
1252
|
};
|
|
1243
|
-
var
|
|
1244
|
-
var e = this,
|
|
1245
|
-
return
|
|
1246
|
-
e.$set(e.localConfig, "tools",
|
|
1247
|
-
}, expression: "localConfig.tools" } })], 1)], 1),
|
|
1248
|
-
e.$set(e.localConfig, "visibleColor",
|
|
1249
|
-
}, expression: "localConfig.visibleColor" } })], 1)], 1),
|
|
1250
|
-
e.$set(e.localConfig, "shadowColor",
|
|
1253
|
+
var At = function() {
|
|
1254
|
+
var e = this, i = e._self._c;
|
|
1255
|
+
return i("AbstractConfigEditor", e._b({ on: { submit: e.apply } }, "AbstractConfigEditor", { ...e.$attrs, ...e.$props }, !1), [e.localConfig ? i("VcsFormSection", { attrs: { heading: "viewshed.editor.general" } }, [i("v-container", { staticClass: "px-1 py-0" }, [i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", { attrs: { "html-for": "viewshed-editor-tools" } }, [e._v(e._s(e.$t("viewshed.editor.tools")))])], 1), i("v-col", [i("VcsSelect", { attrs: { id: "viewshed-tools", items: e.toolItems, multiple: !0 }, model: { value: e.localConfig.tools, callback: function(t) {
|
|
1256
|
+
e.$set(e.localConfig, "tools", t);
|
|
1257
|
+
}, expression: "localConfig.tools" } })], 1)], 1), i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", { attrs: { "html-for": "viewshed-editor-visible-color" } }, [e._v(e._s(e.$t("viewshed.editor.visibleColor")))])], 1), i("v-col", [i("VColorPicker", { attrs: { mode: "rgba" }, model: { value: e.localConfig.visibleColor, callback: function(t) {
|
|
1258
|
+
e.$set(e.localConfig, "visibleColor", t);
|
|
1259
|
+
}, expression: "localConfig.visibleColor" } })], 1)], 1), i("v-row", { attrs: { "no-gutters": "" } }, [i("v-col", [i("VcsLabel", { attrs: { "html-for": "viewshed-editor-shadow-color" } }, [e._v(e._s(e.$t("viewshed.editor.shadowColor")))])], 1), i("v-col", [i("VColorPicker", { attrs: { mode: "rgba" }, model: { value: e.localConfig.shadowColor, callback: function(t) {
|
|
1260
|
+
e.$set(e.localConfig, "shadowColor", t);
|
|
1251
1261
|
}, expression: "localConfig.shadowColor" } })], 1)], 1)], 1)], 1) : e._e()], 1);
|
|
1252
|
-
},
|
|
1253
|
-
Ot,
|
|
1254
|
-
St,
|
|
1262
|
+
}, It = [], Rt = /* @__PURE__ */ ve(
|
|
1255
1263
|
Pt,
|
|
1264
|
+
At,
|
|
1265
|
+
It,
|
|
1256
1266
|
!1,
|
|
1257
1267
|
null,
|
|
1258
1268
|
null,
|
|
1259
1269
|
null,
|
|
1260
1270
|
null
|
|
1261
1271
|
);
|
|
1262
|
-
const
|
|
1263
|
-
function
|
|
1264
|
-
let e,
|
|
1272
|
+
const $t = Rt.exports;
|
|
1273
|
+
function Wt(s) {
|
|
1274
|
+
let e, i = () => {
|
|
1265
1275
|
};
|
|
1266
1276
|
return {
|
|
1267
1277
|
get name() {
|
|
1268
|
-
return
|
|
1278
|
+
return S;
|
|
1269
1279
|
},
|
|
1270
1280
|
get version() {
|
|
1271
|
-
return
|
|
1281
|
+
return yt;
|
|
1272
1282
|
},
|
|
1273
1283
|
get mapVersion() {
|
|
1274
|
-
return
|
|
1284
|
+
return Vt;
|
|
1275
1285
|
},
|
|
1276
1286
|
/**
|
|
1277
1287
|
* @param {import("@vcmap/ui").VcsUiApp} vcsUiApp
|
|
1278
1288
|
* @param {ViewshedPluginState=} state
|
|
1279
1289
|
* @returns {Promise<void>}
|
|
1280
1290
|
*/
|
|
1281
|
-
async initialize(
|
|
1282
|
-
|
|
1283
|
-
this[
|
|
1284
|
-
|
|
1285
|
-
|
|
1291
|
+
async initialize(t, o) {
|
|
1292
|
+
t.categoryClassRegistry.registerClass(
|
|
1293
|
+
this[Ae],
|
|
1294
|
+
Z.className,
|
|
1295
|
+
Z
|
|
1286
1296
|
);
|
|
1287
|
-
const
|
|
1288
|
-
e =
|
|
1289
|
-
|
|
1297
|
+
const n = await St(t);
|
|
1298
|
+
e = pt(
|
|
1299
|
+
t,
|
|
1290
1300
|
s,
|
|
1291
|
-
|
|
1301
|
+
n
|
|
1292
1302
|
);
|
|
1293
|
-
const a =
|
|
1294
|
-
|
|
1303
|
+
const a = Tt(
|
|
1304
|
+
t,
|
|
1295
1305
|
e,
|
|
1296
|
-
|
|
1306
|
+
S,
|
|
1297
1307
|
s.tools || F().tools
|
|
1298
|
-
), { destroy:
|
|
1308
|
+
), { destroy: c } = bt(
|
|
1299
1309
|
e,
|
|
1300
|
-
|
|
1301
|
-
|
|
1310
|
+
t,
|
|
1311
|
+
n.collectionComponent
|
|
1312
|
+
), { activeMap: r } = t.maps;
|
|
1313
|
+
function f(u) {
|
|
1314
|
+
if (o != null && o.mode && o.currentViewshed && u instanceof D) {
|
|
1315
|
+
const _ = new M(o.currentViewshed, r);
|
|
1316
|
+
o.mode === m.VIEW ? e.viewViewshed(_) : e.editViewshed(_);
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
let h = !1;
|
|
1320
|
+
r && (h = !0, f(r));
|
|
1321
|
+
const v = t.maps.mapActivated.addEventListener(
|
|
1322
|
+
(u) => {
|
|
1323
|
+
e.stop(), h || (f(u), h = !0);
|
|
1324
|
+
}
|
|
1302
1325
|
);
|
|
1303
|
-
|
|
1304
|
-
a(),
|
|
1326
|
+
i = () => {
|
|
1327
|
+
v(), a(), c(), n.destroy(), e.destroy();
|
|
1305
1328
|
};
|
|
1306
|
-
const { activeMap: n } = i.maps;
|
|
1307
|
-
if (o != null && o.mode && o.currentViewshed && n instanceof B) {
|
|
1308
|
-
const u = new T(o.currentViewshed, n);
|
|
1309
|
-
o.mode === g.VIEW ? e.viewViewshed(u) : e.editViewshed(u);
|
|
1310
|
-
}
|
|
1311
1329
|
},
|
|
1312
1330
|
/**
|
|
1313
1331
|
* should return all default values of the configuration
|
|
@@ -1319,18 +1337,18 @@ function kt(s) {
|
|
|
1319
1337
|
* @returns {ViewshedPluginOptions}
|
|
1320
1338
|
*/
|
|
1321
1339
|
toJSON() {
|
|
1322
|
-
const
|
|
1323
|
-
return s.tools && F().tools.length !== s.tools.length && (
|
|
1340
|
+
const t = {};
|
|
1341
|
+
return s.tools && F().tools.length !== s.tools.length && (t.tools = [...s.tools]), s.shadowColor && s.shadowColor !== M.getDefaultOptions().shadowColor && (t.shadowColor = s.shadowColor), s.visibleColor && s.visibleColor !== M.getDefaultOptions().visibleColor && (t.visibleColor = s.visibleColor), t;
|
|
1324
1342
|
},
|
|
1325
1343
|
/**
|
|
1326
1344
|
* should return the plugins state
|
|
1327
1345
|
* @returns {ViewshedPluginState}
|
|
1328
1346
|
*/
|
|
1329
1347
|
getState() {
|
|
1330
|
-
var
|
|
1348
|
+
var t;
|
|
1331
1349
|
return {
|
|
1332
1350
|
mode: e.mode.value,
|
|
1333
|
-
currentViewshed: (
|
|
1351
|
+
currentViewshed: (t = e.currentViewshed.value) == null ? void 0 : t.toJSON()
|
|
1334
1352
|
};
|
|
1335
1353
|
},
|
|
1336
1354
|
/**
|
|
@@ -1338,9 +1356,9 @@ function kt(s) {
|
|
|
1338
1356
|
* @returns {Array<import("@vcmap/ui").PluginConfigEditor>}
|
|
1339
1357
|
*/
|
|
1340
1358
|
getConfigEditors() {
|
|
1341
|
-
return [{ component:
|
|
1359
|
+
return [{ component: $t }];
|
|
1342
1360
|
},
|
|
1343
|
-
destroy:
|
|
1361
|
+
destroy: i,
|
|
1344
1362
|
i18n: {
|
|
1345
1363
|
en: {
|
|
1346
1364
|
viewshed: {
|
|
@@ -1366,9 +1384,10 @@ function kt(s) {
|
|
|
1366
1384
|
returnToViewpoint: "Return to previous viewpoint",
|
|
1367
1385
|
move: "Move viewpoint",
|
|
1368
1386
|
createDescription: "Click the map twice. First click places the origin, second defines the distance and direction of the viewshed.",
|
|
1387
|
+
createThreeSixtyDescription: "Click the map twice. First click places the origin, second defines the distance of the viewshed.",
|
|
1369
1388
|
remove: "Remove",
|
|
1370
1389
|
editor: {
|
|
1371
|
-
general: "General",
|
|
1390
|
+
general: "General Settings",
|
|
1372
1391
|
visibleColor: "Visible color",
|
|
1373
1392
|
shadowColor: "Shadow color",
|
|
1374
1393
|
tools: "Tools"
|
|
@@ -1399,11 +1418,12 @@ function kt(s) {
|
|
|
1399
1418
|
returnToViewpoint: "Zu vorherigem Viewpoint zurück springen",
|
|
1400
1419
|
move: "Viewpoint verschieben",
|
|
1401
1420
|
createDescription: "Klicke zweimal in die Karte. Der erste Klick platziert den Ursprung, der zweite die Distanz und die Richtung des Viewsheds.",
|
|
1421
|
+
createThreeSixtyDescription: "Klicke zweimal in die Karte. Der erste Klick platziert den Ursprung, der zweite die Distanz des Viewsheds.",
|
|
1402
1422
|
remove: "Entfernen",
|
|
1403
1423
|
editor: {
|
|
1404
|
-
general: "
|
|
1424
|
+
general: "Allgemeine Einstellungen",
|
|
1405
1425
|
visibleColor: "Sichtbarer Bereich",
|
|
1406
|
-
shadowColor: "
|
|
1426
|
+
shadowColor: "Nicht sichtbarer Bereich",
|
|
1407
1427
|
tools: "Werkzeuge"
|
|
1408
1428
|
}
|
|
1409
1429
|
}
|
|
@@ -1412,5 +1432,5 @@ function kt(s) {
|
|
|
1412
1432
|
};
|
|
1413
1433
|
}
|
|
1414
1434
|
export {
|
|
1415
|
-
|
|
1435
|
+
Wt as default
|
|
1416
1436
|
};
|