@vcmap/viewshed 2.0.1 → 2.0.2
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 +121 -128
- package/package.json +1 -1
- package/src/ViewshedWindow.vue +1 -1
- package/src/viewshedCategory.js +10 -19
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Z = (s, e, t) => (
|
|
4
|
-
import { VcsCameraPrimitive as
|
|
5
|
-
import { Color as k, Matrix4 as
|
|
6
|
-
import { shallowRef as H, ref as A, nextTick as
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var ve = (s, e, t) => e in s ? fe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var Z = (s, e, t) => (ve(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { VcsCameraPrimitive as pe, VcsObject as we, VcsEvent as L, AbstractInteraction as me, EventType as D, Projection as I, SessionType as ge, CesiumMap as B, startEditFeaturesSession as _e, startEditGeometrySession as Ce, VectorLayer as Ee, wgs84Projection as Ve, maxZIndex as ye, markVolatile as be, Viewpoint as Me, TransformationMode as Te, Category as Oe, moduleIdSymbol as Se } from "../../../assets/core.js";
|
|
5
|
+
import { Color as k, Matrix4 as Pe, Transforms as Ae, Primitive as q, GeometryInstance as Q, SphereGeometry as Ie, ColorGeometryInstanceAttribute as ee, PerInstanceColorAppearance as te, SphereOutlineGeometry as Re, Math as O, Cartesian3 as S, ShadowMap as $e, Camera as Ne, HeightReference as xe } from "../../../assets/cesium.js";
|
|
6
|
+
import { shallowRef as H, ref as A, nextTick as De, inject as ie, computed as se, reactive as j, watchEffect as Le, watch as R, onMounted as Fe, onUnmounted as ke } from "../../../assets/vue.js";
|
|
7
7
|
import { ol$Observable$unByKey as je, Feature as We, ol$geom$Point as Be, ol$style$Style as ze } from "../../../assets/ol.js";
|
|
8
|
-
import { VcsTextField as Ge, VcsSlider as Ue, VcsLabel as
|
|
9
|
-
import { VContainer as
|
|
8
|
+
import { VcsTextField as Ge, VcsSlider as Ue, VcsLabel as ne, VcsFormSection as re, VcsSelect as ae, VcsFormButton as He, VcsFeatureTransforms as Xe, makeEditorCollectionComponentClass as Ke, WindowSlot as Ye, ToolboxType as Je, createListExportAction as Ze, downloadText as qe, createListImportAction as Qe, AbstractConfigEditor as et } from "../../../assets/ui.js";
|
|
9
|
+
import { VContainer as le, VRow as ce, VCol as de, VDivider as tt, VColorPicker as it } from "../../../assets/vuetify.js";
|
|
10
10
|
const x = [
|
|
11
11
|
[String, "string"],
|
|
12
12
|
[Number, "number"],
|
|
@@ -117,13 +117,13 @@ function K(s) {
|
|
|
117
117
|
}
|
|
118
118
|
return t;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function he(s, e, t) {
|
|
121
121
|
const i = t ? `${t}.` : "";
|
|
122
122
|
let o = !1;
|
|
123
123
|
return Object.keys(s).find((a) => {
|
|
124
124
|
if (W(e[a])) {
|
|
125
125
|
const l = s[a];
|
|
126
|
-
o =
|
|
126
|
+
o = he(l, e[a], i + a);
|
|
127
127
|
} else
|
|
128
128
|
e[a] || (o = `Found additional key ${i}${a}`);
|
|
129
129
|
return o = o ? o.replace(/\sin.*/, "") : !1, o;
|
|
@@ -148,7 +148,7 @@ function rt(s, e, t) {
|
|
|
148
148
|
if (typeof l != "object")
|
|
149
149
|
throw new Error(`Cannot handler pattern ${l}`);
|
|
150
150
|
const c = X(a, l);
|
|
151
|
-
return c || (t ?
|
|
151
|
+
return c || (t ? he(a, l) : !1);
|
|
152
152
|
};
|
|
153
153
|
let o;
|
|
154
154
|
return Array.isArray(e) && e.length > 1 ? e.every((a) => i(s, a)) && (o = `Expected ${M(s)} to be a ${e.map((a) => K(a)).join(" or ")}`) : o = i(s, e), o;
|
|
@@ -167,8 +167,8 @@ function at(s, e, t) {
|
|
|
167
167
|
}
|
|
168
168
|
return t;
|
|
169
169
|
}
|
|
170
|
-
const lt = new k(), G = new
|
|
171
|
-
class ct extends
|
|
170
|
+
const lt = new k(), G = new Pe();
|
|
171
|
+
class ct extends pe {
|
|
172
172
|
constructor(e) {
|
|
173
173
|
super(e), this.spot = e.spot;
|
|
174
174
|
}
|
|
@@ -182,14 +182,14 @@ class ct extends ve {
|
|
|
182
182
|
super.update(e);
|
|
183
183
|
else {
|
|
184
184
|
const t = this._planesPrimitives, i = this._outlinePrimitives;
|
|
185
|
-
t.length === 0 && (
|
|
185
|
+
t.length === 0 && (Ae.eastNorthUpToFixedFrame(
|
|
186
186
|
this._camera.positionWC,
|
|
187
187
|
void 0,
|
|
188
188
|
G
|
|
189
189
|
), t[0] = new q({
|
|
190
190
|
allowPicking: this.allowPicking,
|
|
191
191
|
geometryInstances: new Q({
|
|
192
|
-
geometry: new
|
|
192
|
+
geometry: new Ie({
|
|
193
193
|
radius: 2
|
|
194
194
|
}),
|
|
195
195
|
attributes: {
|
|
@@ -207,7 +207,7 @@ class ct extends ve {
|
|
|
207
207
|
}), i[0] = new q({
|
|
208
208
|
allowPicking: this.allowPicking,
|
|
209
209
|
geometryInstances: new Q({
|
|
210
|
-
geometry: new
|
|
210
|
+
geometry: new Re({
|
|
211
211
|
radius: 2
|
|
212
212
|
}),
|
|
213
213
|
attributes: {
|
|
@@ -232,13 +232,13 @@ const w = {
|
|
|
232
232
|
THREESIXTY: "360"
|
|
233
233
|
};
|
|
234
234
|
function dt(s, e) {
|
|
235
|
-
const t = new
|
|
235
|
+
const t = new Ne(s), i = (
|
|
236
236
|
/** @type {import("@vcmap-cesium/engine").PerspectiveFrustum} */
|
|
237
237
|
t.frustum
|
|
238
238
|
);
|
|
239
239
|
return i.fov = e.fov, i.near = e.near, i.aspectRatio = e.aspectRatio, i.far = e.far, t;
|
|
240
240
|
}
|
|
241
|
-
const E = class E extends
|
|
241
|
+
const E = class E extends we {
|
|
242
242
|
static get className() {
|
|
243
243
|
return "Viewshed";
|
|
244
244
|
}
|
|
@@ -442,7 +442,7 @@ const E = class E extends pe {
|
|
|
442
442
|
* Updates the shadow map by creating a new one and applying all the current parameters.
|
|
443
443
|
*/
|
|
444
444
|
_updateShadowMap() {
|
|
445
|
-
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || (this._shadowMap = new
|
|
445
|
+
!this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || (this._shadowMap = new $e({
|
|
446
446
|
// @ts-ignore
|
|
447
447
|
context: this._scene.context,
|
|
448
448
|
lightCamera: this._shadowCamera,
|
|
@@ -514,7 +514,7 @@ const E = class E extends pe {
|
|
|
514
514
|
};
|
|
515
515
|
Z(E, "MIN_DISTANCE", 10);
|
|
516
516
|
let T = E;
|
|
517
|
-
class ht extends
|
|
517
|
+
class ht extends me {
|
|
518
518
|
/**
|
|
519
519
|
*
|
|
520
520
|
* @param {import("./viewshed").default} viewshed
|
|
@@ -544,15 +544,15 @@ const V = {
|
|
|
544
544
|
EDIT: "edit",
|
|
545
545
|
MOVE: "move",
|
|
546
546
|
MULTI_SELECT: "multiSelect"
|
|
547
|
-
},
|
|
547
|
+
}, oe = 1.8;
|
|
548
548
|
function ut(s) {
|
|
549
|
-
const e = new
|
|
550
|
-
projection:
|
|
551
|
-
zIndex:
|
|
549
|
+
const e = new Ee({
|
|
550
|
+
projection: Ve.toJSON(),
|
|
551
|
+
zIndex: ye - 1
|
|
552
552
|
});
|
|
553
|
-
|
|
553
|
+
be(e), e.activate();
|
|
554
554
|
const t = new We(new Be(s));
|
|
555
|
-
return t.setStyle(new ze({})), e.addFeatures([t]), e.vectorProperties.altitudeMode =
|
|
555
|
+
return t.setStyle(new ze({})), e.addFeatures([t]), e.vectorProperties.altitudeMode = xe.NONE, {
|
|
556
556
|
layer: e,
|
|
557
557
|
feature: t,
|
|
558
558
|
destroy() {
|
|
@@ -569,24 +569,24 @@ function ft(s, e, t) {
|
|
|
569
569
|
let l = () => {
|
|
570
570
|
};
|
|
571
571
|
const n = H(null);
|
|
572
|
-
function u(
|
|
573
|
-
var f,
|
|
574
|
-
o.value && i.value ? (i.value.deactivate(), t.setVisibility(i.value.name, !1)) : (f = i.value) == null || f.destroy(), i.value =
|
|
572
|
+
function u(h) {
|
|
573
|
+
var f, d;
|
|
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);
|
|
575
575
|
}
|
|
576
|
-
function c(
|
|
577
|
-
l(), u(null),
|
|
576
|
+
function c(h = !0) {
|
|
577
|
+
l(), u(null), h && t.clearSelection(), o.value = null, r.value = null;
|
|
578
578
|
}
|
|
579
|
-
async function m(
|
|
580
|
-
c(), await
|
|
581
|
-
const { eventHandler: f } = s.maps, { featureInteraction:
|
|
579
|
+
async function m(h) {
|
|
580
|
+
c(), await De();
|
|
581
|
+
const { eventHandler: f } = s.maps, { featureInteraction: d } = f;
|
|
582
582
|
i.value = new T(
|
|
583
583
|
{
|
|
584
|
-
viewshedType:
|
|
584
|
+
viewshedType: h,
|
|
585
585
|
colorOptions: {
|
|
586
586
|
visibleColor: e.visibleColor,
|
|
587
587
|
shadowColor: e.shadowColor
|
|
588
588
|
},
|
|
589
|
-
heightOffset: a.value === V.ABSOLUTE ? 0 :
|
|
589
|
+
heightOffset: a.value === V.ABSOLUTE ? 0 : oe
|
|
590
590
|
},
|
|
591
591
|
/** @type {import("@vcmap/core").CesiumMap} */
|
|
592
592
|
s.maps.activeMap
|
|
@@ -601,23 +601,23 @@ function ft(s, e, t) {
|
|
|
601
601
|
p.destroy();
|
|
602
602
|
}
|
|
603
603
|
);
|
|
604
|
-
U(
|
|
605
|
-
U(
|
|
604
|
+
U(d, a.value), p.positioned.addEventListener(() => {
|
|
605
|
+
U(d, V.ABSOLUTE);
|
|
606
606
|
}), l = () => {
|
|
607
|
-
C(), p.destroy(),
|
|
607
|
+
C(), p.destroy(), d.setActive(), l = () => {
|
|
608
608
|
};
|
|
609
609
|
}, r.value = g.CREATE;
|
|
610
610
|
}
|
|
611
|
-
function v(
|
|
611
|
+
function v(h) {
|
|
612
612
|
var f;
|
|
613
|
-
if (i.value &&
|
|
613
|
+
if (i.value && h) {
|
|
614
614
|
l();
|
|
615
615
|
const {
|
|
616
|
-
layer:
|
|
616
|
+
layer: d,
|
|
617
617
|
feature: p,
|
|
618
618
|
destroy: C
|
|
619
619
|
} = ut(i.value.position);
|
|
620
|
-
s.layers.add(
|
|
620
|
+
s.layers.add(d), a.value === V.ABSOLUTE ? (n.value = _e(s, d), n.value.setFeatures([p])) : (n.value = Ce(s, d), n.value.setFeature(p)), n.value.stopped.addEventListener(() => {
|
|
621
621
|
l();
|
|
622
622
|
});
|
|
623
623
|
const b = (f = p.getGeometry()) == null ? void 0 : f.on("change", () => {
|
|
@@ -629,50 +629,50 @@ function ft(s, e, t) {
|
|
|
629
629
|
r.value = g.MOVE, l = () => {
|
|
630
630
|
var N;
|
|
631
631
|
l = () => {
|
|
632
|
-
}, b && je(b), (N = n.value) == null || N.stop(), n.value = null, s.layers.remove(
|
|
632
|
+
}, b && je(b), (N = n.value) == null || N.stop(), n.value = null, s.layers.remove(d), C(), r.value = g.EDIT;
|
|
633
633
|
};
|
|
634
634
|
} else
|
|
635
635
|
l();
|
|
636
636
|
}
|
|
637
|
-
function _(
|
|
638
|
-
l(), i.value !== f && (u(f), a.value = f.heightOffset ? V.RELATIVE : V.ABSOLUTE), o.value = !!f.properties.title, r.value =
|
|
637
|
+
function _(h, f) {
|
|
638
|
+
l(), i.value !== f && (u(f), a.value = f.heightOffset ? V.RELATIVE : V.ABSOLUTE), o.value = !!f.properties.title, r.value = h, o.value && t.setVisibility(f.name, !0);
|
|
639
639
|
}
|
|
640
640
|
const y = [
|
|
641
641
|
t.collectionComponent.collection.removed.addEventListener(
|
|
642
|
-
(
|
|
642
|
+
(h) => {
|
|
643
643
|
var f;
|
|
644
|
-
t.remove(
|
|
644
|
+
t.remove(h.name), ((f = i.value) == null ? void 0 : f.name) === h.name && c();
|
|
645
645
|
}
|
|
646
646
|
),
|
|
647
|
-
t.renamed.addEventListener(({ item:
|
|
647
|
+
t.renamed.addEventListener(({ item: h, title: f }) => {
|
|
648
648
|
var p;
|
|
649
|
-
const
|
|
649
|
+
const d = s.windowManager.get(
|
|
650
650
|
`${t.collectionComponent.id}-editor`
|
|
651
651
|
);
|
|
652
|
-
|
|
652
|
+
d && ((p = i.value) == null ? void 0 : p.name) === h.name && (d.state.headerTitle = f);
|
|
653
653
|
}),
|
|
654
|
-
t.visibilityChanged.addEventListener((
|
|
655
|
-
var
|
|
656
|
-
const f = ((
|
|
657
|
-
f ? c() : (_(g.VIEW,
|
|
654
|
+
t.visibilityChanged.addEventListener((h) => {
|
|
655
|
+
var d;
|
|
656
|
+
const f = ((d = i.value) == null ? void 0 : d.name) === h.name;
|
|
657
|
+
f ? c() : (_(g.VIEW, h), t.clearSelection()), t.setVisibility(h.name, !f);
|
|
658
658
|
})
|
|
659
659
|
];
|
|
660
|
-
function $(
|
|
661
|
-
if (!(
|
|
662
|
-
if (a.value =
|
|
660
|
+
function $(h) {
|
|
661
|
+
if (!(h === a.value || !i.value)) {
|
|
662
|
+
if (a.value = h, r.value === g.MOVE && l(), r.value === g.CREATE)
|
|
663
663
|
U(
|
|
664
664
|
s.maps.eventHandler.featureInteraction,
|
|
665
|
-
|
|
666
|
-
), i.value.heightOffset =
|
|
665
|
+
h
|
|
666
|
+
), i.value.heightOffset = h === V.ABSOLUTE ? 0 : oe;
|
|
667
667
|
else if (r.value === g.EDIT) {
|
|
668
|
-
const { position: f, heightOffset:
|
|
669
|
-
|
|
668
|
+
const { position: f, heightOffset: d } = i.value;
|
|
669
|
+
h === V.RELATIVE ? s.maps.activeMap.getHeightFromTerrain([I.wgs84ToMercator(f)]).then((p) => {
|
|
670
670
|
const C = I.mercatorToWgs84(p[0]);
|
|
671
671
|
i.value && (i.value.heightOffset = f[2] - C[2], i.value.position = C);
|
|
672
672
|
}) : (i.value.position = [
|
|
673
673
|
f[0],
|
|
674
674
|
f[1],
|
|
675
|
-
f[2] +
|
|
675
|
+
f[2] + d
|
|
676
676
|
], i.value.heightOffset = 0);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
@@ -682,11 +682,11 @@ function ft(s, e, t) {
|
|
|
682
682
|
currentIsPersisted: o,
|
|
683
683
|
currentEditSession: n,
|
|
684
684
|
createViewshed: m,
|
|
685
|
-
viewViewshed(
|
|
686
|
-
_(g.VIEW,
|
|
685
|
+
viewViewshed(h) {
|
|
686
|
+
_(g.VIEW, h);
|
|
687
687
|
},
|
|
688
|
-
editViewshed(
|
|
689
|
-
_(g.EDIT,
|
|
688
|
+
editViewshed(h) {
|
|
689
|
+
_(g.EDIT, h), o.value && (t.setSelection(h.name), t.collectionComponent.openEditorWindow(h));
|
|
690
690
|
},
|
|
691
691
|
persistCurrent() {
|
|
692
692
|
i.value && (t.add(i.value), o.value = !0, t.setSelection(i.value.name), t.setVisibility(i.value.name, !0));
|
|
@@ -699,8 +699,8 @@ function ft(s, e, t) {
|
|
|
699
699
|
heightMode: a,
|
|
700
700
|
changeHeightMode: $,
|
|
701
701
|
async placeCurrentFeaturesOnTerrain() {
|
|
702
|
-
var
|
|
703
|
-
if (i.value && ((
|
|
702
|
+
var h, f;
|
|
703
|
+
if (i.value && ((h = n.value) == null ? void 0 : h.type) === ge.EDIT_FEATURES && s.maps.activeMap instanceof B) {
|
|
704
704
|
const p = (await s.maps.activeMap.getHeightFromTerrain([
|
|
705
705
|
I.wgs84ToMercator((f = i.value) == null ? void 0 : f.position)
|
|
706
706
|
]))[0][2] - i.value.position[2];
|
|
@@ -709,11 +709,11 @@ function ft(s, e, t) {
|
|
|
709
709
|
},
|
|
710
710
|
stop: c,
|
|
711
711
|
destroy() {
|
|
712
|
-
c(), y.forEach((
|
|
712
|
+
c(), y.forEach((h) => h());
|
|
713
713
|
}
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function ue(s, e, t, i, o, r, a, l) {
|
|
717
717
|
var n = typeof s == "function" ? s.options : s;
|
|
718
718
|
e && (n.render = e, n.staticRenderFns = t, n._compiled = !0), i && (n.functional = !0), r && (n._scopeId = "data-v-" + r);
|
|
719
719
|
var u;
|
|
@@ -750,14 +750,14 @@ const vt = {
|
|
|
750
750
|
}, pt = {
|
|
751
751
|
components: {
|
|
752
752
|
VcsTextField: Ge,
|
|
753
|
-
VContainer:
|
|
754
|
-
VRow:
|
|
755
|
-
VCol:
|
|
753
|
+
VContainer: le,
|
|
754
|
+
VRow: ce,
|
|
755
|
+
VCol: de,
|
|
756
756
|
VcsSlider: Ue,
|
|
757
|
-
VcsLabel:
|
|
758
|
-
VcsFormSection:
|
|
757
|
+
VcsLabel: ne,
|
|
758
|
+
VcsFormSection: re,
|
|
759
759
|
VDivider: tt,
|
|
760
|
-
VcsSelect:
|
|
760
|
+
VcsSelect: ae,
|
|
761
761
|
VcsFormButton: He,
|
|
762
762
|
VcsFeatureTransforms: Xe
|
|
763
763
|
},
|
|
@@ -785,7 +785,7 @@ const vt = {
|
|
|
785
785
|
currentViewshed: i,
|
|
786
786
|
mode: o,
|
|
787
787
|
currentIsPersisted: r
|
|
788
|
-
} = e, a =
|
|
788
|
+
} = e, a = se(() => s.selection);
|
|
789
789
|
let l = () => {
|
|
790
790
|
};
|
|
791
791
|
const n = j({
|
|
@@ -808,7 +808,7 @@ const vt = {
|
|
|
808
808
|
function y() {
|
|
809
809
|
_(), i.value && (m.distance = i.value.distance, m.fov = i.value.fov, m.heading = i.value.heading, m.pitch = i.value.pitch, m.showPrimitive = i.value.showPrimitive, v.value = i.value.type);
|
|
810
810
|
}
|
|
811
|
-
|
|
811
|
+
Le(() => {
|
|
812
812
|
i.value && o.value !== g.CREATE && y();
|
|
813
813
|
}), R(
|
|
814
814
|
i,
|
|
@@ -822,10 +822,10 @@ const vt = {
|
|
|
822
822
|
async function $() {
|
|
823
823
|
var C, b;
|
|
824
824
|
(C = i.value) == null || C.deactivate();
|
|
825
|
-
const
|
|
825
|
+
const d = (
|
|
826
826
|
/** @type {import("@vcmap/core").CesiumMap} */
|
|
827
827
|
(b = t.maps.activeMap.getScene()) == null ? void 0 : b.camera
|
|
828
|
-
), p =
|
|
828
|
+
), p = d == null ? void 0 : d.changed.addEventListener(() => {
|
|
829
829
|
c();
|
|
830
830
|
});
|
|
831
831
|
c = () => {
|
|
@@ -834,22 +834,22 @@ const vt = {
|
|
|
834
834
|
};
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
|
|
837
|
+
Fe(() => {
|
|
838
838
|
var p;
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
-
}),
|
|
839
|
+
const d = (p = s.getViewshed) == null ? void 0 : p.call(s);
|
|
840
|
+
d && e.editViewshed(d);
|
|
841
|
+
}), ke(() => {
|
|
842
842
|
l(), c(), r.value || ((o.value === g.EDIT || o.value === g.MOVE) && i.value ? e.viewViewshed(i.value) : o.value === g.CREATE && e.stop()), a.value && (a.value.length > 1 ? e.setupMultiSelect() : a.value.length === 1 && i.value ? e.viewViewshed(i.value) : (
|
|
843
843
|
// when a persited viewshed is deselected, stops plugin
|
|
844
844
|
!a.value.length && o.value === g.EDIT && e.stop(!1)
|
|
845
845
|
));
|
|
846
846
|
}), y();
|
|
847
|
-
function d
|
|
848
|
-
c(), i.value && (m[
|
|
847
|
+
function h(d, p) {
|
|
848
|
+
c(), i.value && (m[d] = p, i.value[d] = p);
|
|
849
849
|
}
|
|
850
|
-
const f =
|
|
851
|
-
const
|
|
852
|
-
return v.value === w.CONE &&
|
|
850
|
+
const f = se(() => {
|
|
851
|
+
const d = [];
|
|
852
|
+
return v.value === w.CONE && d.push({
|
|
853
853
|
name: "jumpToViewpoint",
|
|
854
854
|
title: u.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
|
|
855
855
|
icon: "mdi-human-male",
|
|
@@ -857,7 +857,7 @@ const vt = {
|
|
|
857
857
|
async callback() {
|
|
858
858
|
var p, C, b;
|
|
859
859
|
e.moveCurrentViewshed(!1), i.value && !u.value ? (u.value = await ((p = t.maps.activeMap) == null ? void 0 : p.getViewpoint()), await ((C = t.maps.activeMap) == null ? void 0 : C.gotoViewpoint(
|
|
860
|
-
new
|
|
860
|
+
new Me({
|
|
861
861
|
groundPosition: [
|
|
862
862
|
i.value.position[0],
|
|
863
863
|
i.value.position[1],
|
|
@@ -871,7 +871,7 @@ const vt = {
|
|
|
871
871
|
})
|
|
872
872
|
)), $()) : u.value && ((b = t.maps.activeMap) == null || b.gotoViewpoint(u.value), c());
|
|
873
873
|
}
|
|
874
|
-
}),
|
|
874
|
+
}), d.push({
|
|
875
875
|
name: "moveViewshed",
|
|
876
876
|
title: "viewshed.move",
|
|
877
877
|
icon: e.heightMode.value === V.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
|
|
@@ -881,31 +881,31 @@ const vt = {
|
|
|
881
881
|
o.value !== g.MOVE
|
|
882
882
|
);
|
|
883
883
|
}
|
|
884
|
-
}),
|
|
884
|
+
}), d.unshift({
|
|
885
885
|
name: "showPrimitive",
|
|
886
886
|
title: "viewshed.showPrimitive",
|
|
887
887
|
icon: "mdi-eye",
|
|
888
888
|
active: m.showPrimitive,
|
|
889
889
|
callback() {
|
|
890
|
-
this.active = !this.active,
|
|
890
|
+
this.active = !this.active, h("showPrimitive", this.active);
|
|
891
891
|
}
|
|
892
|
-
}),
|
|
892
|
+
}), d;
|
|
893
893
|
});
|
|
894
894
|
return {
|
|
895
895
|
position: n,
|
|
896
|
-
setPosition(
|
|
896
|
+
setPosition(d, p, C) {
|
|
897
897
|
if (c(), !!i.value) {
|
|
898
898
|
if (C === 2 && e.heightMode.value === V.RELATIVE)
|
|
899
|
-
i.value.heightOffset = Number(
|
|
899
|
+
i.value.heightOffset = Number(d);
|
|
900
900
|
else {
|
|
901
901
|
const b = [...i.value.position];
|
|
902
|
-
b[C] = Number(
|
|
902
|
+
b[C] = Number(d), i.value.position = b;
|
|
903
903
|
}
|
|
904
|
-
n[p] = Number(
|
|
904
|
+
n[p] = Number(d);
|
|
905
905
|
}
|
|
906
906
|
},
|
|
907
907
|
parameters: m,
|
|
908
|
-
setParameter:
|
|
908
|
+
setParameter: h,
|
|
909
909
|
parameterRanges: vt,
|
|
910
910
|
ViewshedPluginModes: g,
|
|
911
911
|
viewshedMode: o,
|
|
@@ -914,7 +914,7 @@ const vt = {
|
|
|
914
914
|
ViewshedTypes: w,
|
|
915
915
|
HeightModes: V,
|
|
916
916
|
heightMode: e.heightMode,
|
|
917
|
-
TransformationMode:
|
|
917
|
+
TransformationMode: Te,
|
|
918
918
|
changeHeightMode: e.changeHeightMode,
|
|
919
919
|
async createNewViewshed() {
|
|
920
920
|
await e.createViewshed(v.value);
|
|
@@ -941,7 +941,7 @@ var wt = function() {
|
|
|
941
941
|
} } }, [e._v(" " + e._s(e.$t("viewshed.new")) + " ")])], 1) : e.viewshedMode === e.ViewshedPluginModes.CREATE ? t("div", { staticClass: "d-flex w-full justify-end px-2 pt-2 pb-1" }, [t("VcsFormButton", { attrs: { variant: "filled" }, on: { click: function(i) {
|
|
942
942
|
return e.cancel();
|
|
943
943
|
} } }, [e._v(" " + e._s(e.$t("viewshed.cancel")) + " ")])], 1) : e._e()], 1);
|
|
944
|
-
}, mt = [], gt = /* @__PURE__ */
|
|
944
|
+
}, mt = [], gt = /* @__PURE__ */ ue(
|
|
945
945
|
pt,
|
|
946
946
|
wt,
|
|
947
947
|
mt,
|
|
@@ -951,7 +951,7 @@ var wt = function() {
|
|
|
951
951
|
null,
|
|
952
952
|
null
|
|
953
953
|
);
|
|
954
|
-
const _t = gt.exports, P = "@vcmap/viewshed", Ct = "2.0.
|
|
954
|
+
const _t = gt.exports, P = "@vcmap/viewshed", Ct = "2.0.2", Et = "^5.1", Y = {
|
|
955
955
|
[w.CONE]: "$vcsViewshed",
|
|
956
956
|
[w.THREESIXTY]: "$vcsViewshedCone"
|
|
957
957
|
};
|
|
@@ -1070,7 +1070,7 @@ function bt(s, e, t, i) {
|
|
|
1070
1070
|
s.toolboxManager.remove(a), r();
|
|
1071
1071
|
};
|
|
1072
1072
|
}
|
|
1073
|
-
class J extends
|
|
1073
|
+
class J extends Oe {
|
|
1074
1074
|
static get className() {
|
|
1075
1075
|
return "ViewshedCategory";
|
|
1076
1076
|
}
|
|
@@ -1138,22 +1138,15 @@ async function Tt(s) {
|
|
|
1138
1138
|
P
|
|
1139
1139
|
), { action: n, destroy: u } = Qe(
|
|
1140
1140
|
async (c) => {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
} catch (d) {
|
|
1151
|
-
$(d);
|
|
1152
|
-
}
|
|
1153
|
-
}, _.readAsText(v);
|
|
1154
|
-
});
|
|
1155
|
-
});
|
|
1156
|
-
await Promise.all(m);
|
|
1141
|
+
await Promise.all(
|
|
1142
|
+
c.map(async (m) => {
|
|
1143
|
+
const v = await m.text();
|
|
1144
|
+
JSON.parse(v).forEach((y) => {
|
|
1145
|
+
const $ = new T(y);
|
|
1146
|
+
o.collection.add($);
|
|
1147
|
+
});
|
|
1148
|
+
})
|
|
1149
|
+
);
|
|
1157
1150
|
},
|
|
1158
1151
|
s.windowManager,
|
|
1159
1152
|
P,
|
|
@@ -1210,12 +1203,12 @@ const Ot = {
|
|
|
1210
1203
|
title: "Viewshed Editor",
|
|
1211
1204
|
components: {
|
|
1212
1205
|
AbstractConfigEditor: et,
|
|
1213
|
-
VcsFormSection:
|
|
1214
|
-
VContainer:
|
|
1215
|
-
VRow:
|
|
1216
|
-
VCol:
|
|
1217
|
-
VcsLabel:
|
|
1218
|
-
VcsSelect:
|
|
1206
|
+
VcsFormSection: re,
|
|
1207
|
+
VContainer: le,
|
|
1208
|
+
VRow: ce,
|
|
1209
|
+
VCol: de,
|
|
1210
|
+
VcsLabel: ne,
|
|
1211
|
+
VcsSelect: ae,
|
|
1219
1212
|
VColorPicker: it
|
|
1220
1213
|
},
|
|
1221
1214
|
props: {
|
|
@@ -1256,7 +1249,7 @@ var St = function() {
|
|
|
1256
1249
|
}, expression: "localConfig.visibleColor" } })], 1)], 1), t("v-row", { attrs: { "no-gutters": "" } }, [t("v-col", [t("VcsLabel", { attrs: { "html-for": "viewshed-editor-shadow-color" } }, [e._v(e._s(e.$t("viewshed.editor.shadowColor")))])], 1), t("v-col", [t("VColorPicker", { attrs: { mode: "rgba" }, model: { value: e.localConfig.shadowColor, callback: function(i) {
|
|
1257
1250
|
e.$set(e.localConfig, "shadowColor", i);
|
|
1258
1251
|
}, expression: "localConfig.shadowColor" } })], 1)], 1)], 1)], 1) : e._e()], 1);
|
|
1259
|
-
}, Pt = [], At = /* @__PURE__ */
|
|
1252
|
+
}, Pt = [], At = /* @__PURE__ */ ue(
|
|
1260
1253
|
Ot,
|
|
1261
1254
|
St,
|
|
1262
1255
|
Pt,
|
|
@@ -1287,7 +1280,7 @@ function kt(s) {
|
|
|
1287
1280
|
*/
|
|
1288
1281
|
async initialize(i, o) {
|
|
1289
1282
|
i.categoryClassRegistry.registerClass(
|
|
1290
|
-
this[
|
|
1283
|
+
this[Se],
|
|
1291
1284
|
J.className,
|
|
1292
1285
|
J
|
|
1293
1286
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcmap/viewshed",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Tool to simulate a \"viewer\" and their field of vision from a certain standpoint in the map. It allows the user to see which areas and buildings can or can't be seen from a specific standpoint, regarding different viewing distances, viewers' sizes and orientations.Th",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
package/src/ViewshedWindow.vue
CHANGED
package/src/viewshedCategory.js
CHANGED
|
@@ -133,25 +133,16 @@ export async function createCategory(app) {
|
|
|
133
133
|
const { action: importAction, destroy: destroyImportAction } =
|
|
134
134
|
createListImportAction(
|
|
135
135
|
async (files) => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
resolve();
|
|
147
|
-
} catch (e) {
|
|
148
|
-
reject(e);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
reader.readAsText(file);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
await Promise.all(promises);
|
|
136
|
+
await Promise.all(
|
|
137
|
+
files.map(async (file) => {
|
|
138
|
+
const text = await file.text();
|
|
139
|
+
const viewshedOptions = JSON.parse(text);
|
|
140
|
+
viewshedOptions.forEach((options) => {
|
|
141
|
+
const viewshed = new Viewshed(options);
|
|
142
|
+
category.collection.add(viewshed);
|
|
143
|
+
});
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
155
146
|
},
|
|
156
147
|
app.windowManager,
|
|
157
148
|
name,
|