@vcmap/viewshed 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # v2.0.8
2
+
3
+ - fix window slot
4
+
5
+ # v2.0.7
6
+
7
+ - disable myWorkspace items if not 3D
8
+
1
9
  # v2.0.0
2
10
 
3
11
  - implements the new uniform select behavior
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  var pe = Object.defineProperty;
2
2
  var we = (s, e, i) => e in s ? pe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
3
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 D, AbstractInteraction as _e, EventType as x, Projection as I, SessionType as Ce, CesiumMap as $, 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 S, ShadowMap as xe, Camera as De, HeightReference as Le } from "../../../assets/cesium.js";
6
- import { shallowRef as K, ref as A, nextTick as Fe, inject as oe, computed as ne, reactive as W, watchEffect as ke, 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";
4
+ import { VcsCameraPrimitive as me, VcsObject as ge, VcsEvent as D, AbstractInteraction as _e, EventType as x, Projection as A, SessionType as Ce, CesiumMap as $, 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 Ie } from "../../../assets/core.js";
5
+ import { Color as j, Matrix4 as Ae, 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 S, ShadowMap as xe, Camera as De, HeightReference as Le } from "../../../assets/cesium.js";
6
+ import { shallowRef as K, ref as I, nextTick as Fe, inject as oe, computed as ne, reactive as W, watchEffect as ke, 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 He, ol$style$Style as Ge } from "../../../assets/ol.js";
8
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, createSupportedMapMappingFunction as Qe, createListExportAction as et, downloadText as tt, createListImportAction as it, AbstractConfigEditor as st } from "../../../assets/ui.js";
9
9
  import { VContainer as de, VRow as he, VCol as ue, VDivider as ot, VColorPicker as nt } from "../../../assets/vuetify.js";
10
10
  const N = [
@@ -167,7 +167,7 @@ function dt(s, e, i) {
167
167
  }
168
168
  return i;
169
169
  }
170
- const ht = new j(), H = new Ie();
170
+ const ht = new j(), G = new Ae();
171
171
  class ut extends me {
172
172
  constructor(e) {
173
173
  super(e), this.spot = e.spot;
@@ -185,7 +185,7 @@ class ut extends me {
185
185
  i.length === 0 && (Re.eastNorthUpToFixedFrame(
186
186
  this._camera.positionWC,
187
187
  void 0,
188
- H
188
+ G
189
189
  ), i[0] = new ee({
190
190
  allowPicking: this.allowPicking,
191
191
  geometryInstances: new te({
@@ -197,7 +197,7 @@ class ut extends me {
197
197
  j.fromAlpha(this._color, 0.1, ht)
198
198
  )
199
199
  },
200
- modelMatrix: H
200
+ modelMatrix: G
201
201
  }),
202
202
  appearance: new se({
203
203
  translucent: !0,
@@ -213,7 +213,7 @@ class ut extends me {
213
213
  attributes: {
214
214
  color: ie.fromColor(this._color)
215
215
  },
216
- modelMatrix: H
216
+ modelMatrix: G
217
217
  }),
218
218
  appearance: new se({
219
219
  translucent: !1,
@@ -535,7 +535,7 @@ class vt extends _e {
535
535
  return this._positioned;
536
536
  }
537
537
  async pipe(e) {
538
- return e.position && (this._position ? (this._viewshed.lookAt(I.mercatorToWgs84(e.position)), e.type & x.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = I.mercatorToWgs84(e.position), e.type & x.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
538
+ return e.position && (this._position ? (this._viewshed.lookAt(A.mercatorToWgs84(e.position)), e.type & x.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = A.mercatorToWgs84(e.position), e.type & x.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
539
539
  }
540
540
  destroy() {
541
541
  super.destroy(), this._finished.destroy(), this._positioned.destroy();
@@ -557,8 +557,8 @@ function pt(s) {
557
557
  zIndex: Me - 1
558
558
  });
559
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, {
560
+ const i = new ze(new He(s));
561
+ return i.setStyle(new Ge({})), e.addFeatures([i]), e.vectorProperties.altitudeMode = Le.NONE, {
562
562
  layer: e,
563
563
  feature: i,
564
564
  destroy() {
@@ -571,7 +571,7 @@ function U(s, e) {
571
571
  s.setActive(i), s.pickPosition = i, s.pullPickedPosition = 1.8;
572
572
  }
573
573
  function wt(s, e, i) {
574
- const t = K(null), o = A(null), n = A(null), a = A(y.ABSOLUTE);
574
+ const t = K(null), o = I(null), n = I(null), a = I(y.ABSOLUTE);
575
575
  let c = () => {
576
576
  };
577
577
  const r = K(null);
@@ -631,7 +631,7 @@ function wt(s, e, i) {
631
631
  c();
632
632
  });
633
633
  const F = (d = g.getGeometry()) == null ? void 0 : d.on("change", () => {
634
- t.value ? t.value.position = I.mercatorToWgs84(
634
+ t.value ? t.value.position = A.mercatorToWgs84(
635
635
  /** @type {import("ol/geom").Point} */
636
636
  g.getGeometry().getCoordinates()
637
637
  ) : v();
@@ -667,7 +667,7 @@ function wt(s, e, i) {
667
667
  d ? v() : (P(m.VIEW, l), i.clearSelection()), i.setVisibility(l.name, !d);
668
668
  })
669
669
  ];
670
- function G(l) {
670
+ function H(l) {
671
671
  if (!(l === a.value || !t.value)) {
672
672
  if (a.value = l, n.value === m.MOVE && c(), n.value === m.CREATE)
673
673
  U(
@@ -676,8 +676,8 @@ function wt(s, e, i) {
676
676
  ), t.value.heightOffset = l === y.ABSOLUTE ? 0 : re;
677
677
  else if (n.value === m.EDIT) {
678
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]);
679
+ l === y.RELATIVE ? s.maps.activeMap.getHeightFromTerrain([A.wgs84ToMercator(d)]).then((g) => {
680
+ const C = A.mercatorToWgs84(g[0]);
681
681
  t.value && (t.value.heightOffset = d[2] - C[2], t.value.position = C);
682
682
  }) : (t.value.position = [
683
683
  d[0],
@@ -707,12 +707,12 @@ function wt(s, e, i) {
707
707
  },
708
708
  mode: n,
709
709
  heightMode: a,
710
- changeHeightMode: G,
710
+ changeHeightMode: H,
711
711
  async placeCurrentFeaturesOnTerrain() {
712
712
  var l, d;
713
713
  if (t.value && ((l = r.value) == null ? void 0 : l.type) === Ce.EDIT_FEATURES && s.maps.activeMap instanceof $) {
714
714
  const g = (await s.maps.activeMap.getHeightFromTerrain([
715
- I.wgs84ToMercator((d = t.value) == null ? void 0 : d.position)
715
+ A.wgs84ToMercator((d = t.value) == null ? void 0 : d.position)
716
716
  ]))[0][2] - t.value.position[2];
717
717
  r.value.translate(0, 0, g);
718
718
  }
@@ -811,7 +811,7 @@ const mt = {
811
811
  fov: void 0,
812
812
  heading: void 0,
813
813
  pitch: void 0
814
- }), u = A();
814
+ }), u = I();
815
815
  function _() {
816
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);
817
817
  }
@@ -857,7 +857,7 @@ const mt = {
857
857
  function L(l, d) {
858
858
  h(), t.value && (v[l] = d, t.value[l] = d);
859
859
  }
860
- const G = ne(() => {
860
+ const H = ne(() => {
861
861
  const l = [];
862
862
  return u.value === w.CONE && l.push({
863
863
  name: "jumpToViewpoint",
@@ -931,7 +931,7 @@ const mt = {
931
931
  },
932
932
  addToMyWorkspace: () => e.persistCurrent(),
933
933
  cancel: () => e.stop(),
934
- headerActions: G
934
+ headerActions: H
935
935
  };
936
936
  }
937
937
  };
@@ -961,12 +961,12 @@ var _t = function() {
961
961
  null,
962
962
  null
963
963
  );
964
- const yt = Et.exports, O = "@vcmap/viewshed", Vt = "2.0.7", bt = "^5.1", J = {
964
+ const yt = Et.exports, O = "@vcmap/viewshed", Vt = "2.0.8", bt = "^5.1", J = {
965
965
  [w.CONE]: "$vcsViewshed",
966
966
  [w.THREESIXTY]: "$vcsViewshedCone"
967
967
  };
968
968
  function Mt(s, e, i) {
969
- const t = A(), o = A(), n = `${i.id}-editor`, a = {
969
+ const t = I(), o = I(), n = `${i.id}-editor`, a = {
970
970
  component: yt,
971
971
  provides: {
972
972
  manager: s
@@ -1002,7 +1002,7 @@ function Mt(s, e, i) {
1002
1002
  ...a,
1003
1003
  id: n,
1004
1004
  parentId: "category-manager",
1005
- slot: Ze.DYNAMIC_LEFT
1005
+ slot: Ze.DYNAMIC_CHILD
1006
1006
  },
1007
1007
  O
1008
1008
  ));
@@ -1216,7 +1216,7 @@ function k() {
1216
1216
  tools: [...Object.values(w)]
1217
1217
  };
1218
1218
  }
1219
- const At = {
1219
+ const It = {
1220
1220
  name: "ViewshedConfigEditor",
1221
1221
  title: "Viewshed Editor",
1222
1222
  components: {
@@ -1240,7 +1240,7 @@ const At = {
1240
1240
  }
1241
1241
  },
1242
1242
  setup(s) {
1243
- const e = A({});
1243
+ const e = I({});
1244
1244
  s.getConfig().then((t) => {
1245
1245
  e.value = Object.assign(k(), t);
1246
1246
  });
@@ -1258,7 +1258,7 @@ const At = {
1258
1258
  };
1259
1259
  }
1260
1260
  };
1261
- var It = function() {
1261
+ var At = function() {
1262
1262
  var e = this, i = e._self._c;
1263
1263
  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) {
1264
1264
  e.$set(e.localConfig, "tools", t);
@@ -1268,8 +1268,8 @@ var It = function() {
1268
1268
  e.$set(e.localConfig, "shadowColor", t);
1269
1269
  }, expression: "localConfig.shadowColor" } })], 1)], 1)], 1)], 1) : e._e()], 1);
1270
1270
  }, Rt = [], $t = /* @__PURE__ */ ve(
1271
- At,
1272
1271
  It,
1272
+ At,
1273
1273
  Rt,
1274
1274
  !1,
1275
1275
  null,
@@ -1298,7 +1298,7 @@ function Bt(s) {
1298
1298
  */
1299
1299
  async initialize(t, o) {
1300
1300
  t.categoryClassRegistry.registerClass(
1301
- this[Ae],
1301
+ this[Ie],
1302
1302
  Z.className,
1303
1303
  Z
1304
1304
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/viewshed",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
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",
@@ -89,7 +89,7 @@ export function setupViewshedWindow(manager, app, collectionComponent) {
89
89
  ...editor,
90
90
  id: windowId,
91
91
  parentId: 'category-manager',
92
- slot: WindowSlot.DYNAMIC_LEFT,
92
+ slot: WindowSlot.DYNAMIC_CHILD,
93
93
  },
94
94
  name,
95
95
  );