@vcmap/ui 6.3.6 → 6.3.7

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.
Files changed (25) hide show
  1. package/config/base.config.json +22 -3
  2. package/config/concepts-show-case.config.json +4 -0
  3. package/dist/assets/{cesium-13cf3c65.js → cesium-a9fcdef3.js} +64804 -64777
  4. package/dist/assets/cesium.js +1 -1
  5. package/dist/assets/{core-b552e43f.js → core-a6684686.js} +5008 -4996
  6. package/dist/assets/core-workers/panoramaImageWorker.js +1 -1
  7. package/dist/assets/core.js +1 -1
  8. package/dist/assets/ol.js +1 -1
  9. package/dist/assets/{ui-a2ca1d03.js → ui-130549f1.js} +11 -11
  10. package/dist/assets/ui.js +1 -1
  11. package/dist/assets/vue.js +1 -1
  12. package/dist/assets/{vuetify-e536bde6.js → vuetify-6d0e90c9.js} +1 -1
  13. package/dist/assets/vuetify.js +1 -1
  14. package/package.json +2 -2
  15. package/plugins/@vcmap-show-case/tileset-feature-visibility/package.json +5 -0
  16. package/plugins/@vcmap-show-case/tileset-feature-visibility/src/TilesetFeatureVisibilityComponent.vue +349 -0
  17. package/plugins/@vcmap-show-case/tileset-feature-visibility/src/TilesetFeatureVisibilityInteraction.js +66 -0
  18. package/plugins/@vcmap-show-case/tileset-feature-visibility/src/index.js +135 -0
  19. package/plugins/package.json +4 -4
  20. package/src/vuePlugins/vuetify.js +2 -4
  21. /package/dist/assets/core-workers/{panoramaImageWorker.js-1169c1e6.js → panoramaImageWorker.js-1e5adc77.js} +0 -0
  22. /package/dist/assets/{ol-bb6d9ab8.js → ol-15bf8646.js} +0 -0
  23. /package/dist/assets/{ui-a2ca1d03.css → ui-130549f1.css} +0 -0
  24. /package/dist/assets/{vue-1a9cf873.js → vue-d93cd563.js} +0 -0
  25. /package/dist/assets/{vuetify-e536bde6.css → vuetify-6d0e90c9.css} +0 -0
@@ -1 +1 @@
1
- import './panoramaImageWorker.js-1169c1e6.js';
1
+ import './panoramaImageWorker.js-1e5adc77.js';
@@ -1 +1 @@
1
- export * from "./core-b552e43f.js";
1
+ export * from "./core-a6684686.js";
package/dist/assets/ol.js CHANGED
@@ -1 +1 @@
1
- export * from "./ol-bb6d9ab8.js";
1
+ export * from "./ol-15bf8646.js";
@@ -10,17 +10,17 @@ function loadCss(href) {
10
10
  elem.onerror = reject;
11
11
  document.head.appendChild(elem);
12
12
  });
13
- } await loadCss('./assets/ui-a2ca1d03.css');await loadCss('./assets/@mdi/font/css/materialdesignicons.min-680621ca.css');var hg = Object.defineProperty;
13
+ } await loadCss('./assets/ui-130549f1.css');await loadCss('./assets/@mdi/font/css/materialdesignicons.min-680621ca.css');var hg = Object.defineProperty;
14
14
  var mg = (t, e, o) => e in t ? hg(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
15
15
  var Re = (t, e, o) => mg(t, typeof e != "symbol" ? e + "" : e, o);
16
- import { FeatureLayer as ea, VcsEvent as et, Viewpoint as tn, PanoramaMap as fo, Extent as Yo, mercatorProjection as kt, MapCollection as vu, Collection as Qa, LayerState as Wi, AbstractInteraction as sr, EventType as io, ModificationKeyType as _u, vectorClusterGroupName as Na, isProvidedClusterFeature as yu, VcsObject as pg, renderTemplate as Pa, VectorProperties as bu, getHeightInfo as gg, isRelativeHeightReference as vg, getGeometryHeight as _g, isAbsoluteHeightReference as yg, cartesianToMercator as Ra, CesiumMap as fn, OpenlayersMap as rr, ObliqueMap as xt, transformToImage as Mh, Projection as qn, getMetersPerDegreeAtCoordinate as bg, ClassRegistry as wu, fromCesiumColor as Nh, VectorStyleItem as Zn, getDefaultVectorStyleItemOptions as Ph, VectorLayer as Eo, maxZIndex as Xa, markVolatile as ta, vcsLayerName as An, originalFeatureSymbol as Au, isProvidedFeature as Rh, hidden as il, alreadyTransformedToImage as wg, panoramaFeature as e1, mercatorToCartesian as Oh, moduleIdSymbol as yt, volatileModuleId as $i, FeatureProviderInteraction as Ag, getFeatureFromPickObject as Sg, startCreateFeatureSession as Ig, GeometryType as In, wgs84Projection as vi, startEditFeaturesSession as Eg, startEditGeometrySession as Cg, isSameOrigin as kg, createFlightVisualization as Su, parseFlightOptionsFromGeoJson as Tg, FlightInstance as Os, exportFlightPathAsGeoJson as xg, exportFlightAsGeoJson as Lg, createFlightPlayer as Vg, createFlightMovie as Mg, parseGeoJSON as Ng, rotationMapControlSymbol as Sc, startRotation as Dh, PanoramaImageSelection as Pg, EventHandler as Rg, deserializeLayer as Og, DataState as Dg, emptyStyle as t1, maxZIndexMin50 as fs, ObliqueViewDirection as Ao, DisplayQualityLevel as al, getStringColor as Ic, parseColor as Ec, PatternType as Ri, getShapeFromOptions as Fg, getDefaultProjection as Oa, getVcsAppById as Bg, getInitForUrl as $g, WMSLayer as Cc, IndexedCollection as hi, makeOverrideCollection as xa, getObjectFromClassRegistry as Fh, isOverrideCollection as Gg, defaultDynamicModuleId as fi, PointerKeyType as n1, BaseOLMap as Ug, VcsApp as Hg, OverrideClassRegistry as sl, destroyCollection as hs, VcsModule as kc, DefaultObliqueCollection as Wg, getImageStyleFromOptions as Bh, anchorFromViewpoint as $h, anchorToViewpoint as Gh, getSplineAndTimesForInstance as Zg, getTextFromOptions as jg, highlighted as Uh, originalStyle as Iu, getStyleOptions as zg, vectorStyleSymbol as Yg, getImageStyleOptions as qg, getTextOptions as Jg, TransformationMode as so, placeGeometryOnSurface as Qg, SessionType as Ho, snapTypes as Xg, is2DLayout as Kg } from "./core-b552e43f.js";
17
- import { renderTemplate as kU } from "./core-b552e43f.js";
18
- import { resolveComponent as b, openBlock as g, createBlock as A, withCtx as v, createVNode as p, createElementBlock as k, Fragment as re, renderList as ge, withModifiers as Me, normalizeClass as pe, createTextVNode as H, toDisplayString as $, createCommentVNode as M, inject as fe, ref as B, onUnmounted as Be, computed as w, reactive as ce, watch as ie, nextTick as xn, toRaw as It, mergeProps as X, createSlots as wt, renderSlot as ne, normalizeProps as Ce, guardReactiveProps as ke, getCurrentInstance as en, shallowRef as Ue, onBeforeMount as Hh, onMounted as Vn, effectScope as Wh, isRef as ho, defineComponent as Ka, h as xo, Text as Zh, onScopeDispose as ev, watchEffect as Eu, toRefs as lr, capitalize as jh, warn as tv, unref as K, provide as mn, camelize as zh, createStaticVNode as nn, createElementVNode as S, resolveDynamicComponent as Lo, withKeys as Qt, useSlots as Yh, isReactive as nv, normalizeStyle as kn, shallowReactive as ov, pushScopeId as cr, popScopeId as ur, readonly as Cu, createApp as iv, toRef as Qe, onBeforeUnmount as es, onUpdated as av, withDirectives as qo, TransitionGroup as ku, Transition as Tu, resolveDirective as dr, vShow as xu, useCssVars as sv, useAttrs as rv, toHandlers as lv, useModel as cv } from "./vue-1a9cf873.js";
19
- import { VListItemTitle as Mn, VListItem as Rt, VList as Qn, VSheet as ht, VTextField as uv, VTooltip as lt, VSvgIcon as dv, VIcon as Ze, VBtn as na, VSpacer as fr, VMenu as Po, VCol as st, VRow as ft, VDivider as Tn, VProgressLinear as fv, VCardText as qh, VCardTitle as Jh, VCard as ki, VDialog as Qh, VExpansionPanel as hv, VExpansionPanelTitle as mv, VExpansionPanelText as pv, VExpansionPanels as Lu, VCheckbox as gv, VDataTableServer as vv, VDataTable as _v, VListItemSubtitle as Vu, VFileInput as yv, VSlider as Xh, VContainer as ct, VToolbarItems as oa, VToolbar as ia, VSnackbar as bv, VSelect as wv, VRadio as Av, VRadioGroup as Sv, VPagination as Iv, VImg as Ev, VCardActions as Cv, VFooter as kv, VApp as Tv, VExpandTransition as xv, VChip as Lv, VTextarea as Vv, VDatePicker as Mv, VColorPicker as Kh, VTab as Nv, VTabs as Pv, VForm as Rv } from "./vuetify-e536bde6.js";
20
- import { Feature as Vo, ol$Feature as Tc, ol$geom$Point as ts, ol$extent$getCenter as Ov, ol$Observable$unByKey as Ji, ol$proj$getTransform as Dv, ol$proj$get as Fv, ol$geom$LineString as Bv, ol$style$Icon as hr, ol$proj$transformExtent as em, ol$geom$Polygon$fromExtent as $v, ol$geom$Polygon as Gv, ol$extent$createOrUpdateFromCoordinates as Uv, ol$style$Circle as Hv, ol$style$Stroke as tm, ol$style$Fill as nm, ol$geom$Circle as Wv, ol$source$Vector as rl, ol$format$WMSCapabilities as Zv, ol$render$toContext as jv, ol$style$Style as zv } from "./ol-bb6d9ab8.js";
21
- import { useTheme as om, createVuetify as Yv, useDisplay as Ct } from "./vuetify-e536bde6.js";
22
- import "./vuetify-e536bde6.js";
23
- import { HeightReference as Ds, Entity as im, Cartesian2 as am, Cartographic as _i, SceneTransforms as qv, Color as ns, Cesium3DTilePointFeature as Jv, Cesium3DTileFeature as Qv, Cartesian3 as Zi, Ray as Xv, Math as yi } from "./cesium-13cf3c65.js";
16
+ import { FeatureLayer as ea, VcsEvent as et, Viewpoint as tn, PanoramaMap as fo, Extent as Yo, mercatorProjection as kt, MapCollection as vu, Collection as Qa, LayerState as Wi, AbstractInteraction as sr, EventType as io, ModificationKeyType as _u, vectorClusterGroupName as Na, isProvidedClusterFeature as yu, VcsObject as pg, renderTemplate as Pa, VectorProperties as bu, getHeightInfo as gg, isRelativeHeightReference as vg, getGeometryHeight as _g, isAbsoluteHeightReference as yg, cartesianToMercator as Ra, CesiumMap as fn, OpenlayersMap as rr, ObliqueMap as xt, transformToImage as Mh, Projection as qn, getMetersPerDegreeAtCoordinate as bg, ClassRegistry as wu, fromCesiumColor as Nh, VectorStyleItem as Zn, getDefaultVectorStyleItemOptions as Ph, VectorLayer as Eo, maxZIndex as Xa, markVolatile as ta, vcsLayerName as An, originalFeatureSymbol as Au, isProvidedFeature as Rh, hidden as il, alreadyTransformedToImage as wg, panoramaFeature as e1, mercatorToCartesian as Oh, moduleIdSymbol as yt, volatileModuleId as $i, FeatureProviderInteraction as Ag, getFeatureFromPickObject as Sg, startCreateFeatureSession as Ig, GeometryType as In, wgs84Projection as vi, startEditFeaturesSession as Eg, startEditGeometrySession as Cg, isSameOrigin as kg, createFlightVisualization as Su, parseFlightOptionsFromGeoJson as Tg, FlightInstance as Os, exportFlightPathAsGeoJson as xg, exportFlightAsGeoJson as Lg, createFlightPlayer as Vg, createFlightMovie as Mg, parseGeoJSON as Ng, rotationMapControlSymbol as Sc, startRotation as Dh, PanoramaImageSelection as Pg, EventHandler as Rg, deserializeLayer as Og, DataState as Dg, emptyStyle as t1, maxZIndexMin50 as fs, ObliqueViewDirection as Ao, DisplayQualityLevel as al, getStringColor as Ic, parseColor as Ec, PatternType as Ri, getShapeFromOptions as Fg, getDefaultProjection as Oa, getVcsAppById as Bg, getInitForUrl as $g, WMSLayer as Cc, IndexedCollection as hi, makeOverrideCollection as xa, getObjectFromClassRegistry as Fh, isOverrideCollection as Gg, defaultDynamicModuleId as fi, PointerKeyType as n1, BaseOLMap as Ug, VcsApp as Hg, OverrideClassRegistry as sl, destroyCollection as hs, VcsModule as kc, DefaultObliqueCollection as Wg, getImageStyleFromOptions as Bh, anchorFromViewpoint as $h, anchorToViewpoint as Gh, getSplineAndTimesForInstance as Zg, getTextFromOptions as jg, highlighted as Uh, originalStyle as Iu, getStyleOptions as zg, vectorStyleSymbol as Yg, getImageStyleOptions as qg, getTextOptions as Jg, TransformationMode as so, placeGeometryOnSurface as Qg, SessionType as Ho, snapTypes as Xg, is2DLayout as Kg } from "./core-a6684686.js";
17
+ import { renderTemplate as kU } from "./core-a6684686.js";
18
+ import { resolveComponent as b, openBlock as g, createBlock as A, withCtx as v, createVNode as p, createElementBlock as k, Fragment as re, renderList as ge, withModifiers as Me, normalizeClass as pe, createTextVNode as H, toDisplayString as $, createCommentVNode as M, inject as fe, ref as B, onUnmounted as Be, computed as w, reactive as ce, watch as ie, nextTick as xn, toRaw as It, mergeProps as X, createSlots as wt, renderSlot as ne, normalizeProps as Ce, guardReactiveProps as ke, getCurrentInstance as en, shallowRef as Ue, onBeforeMount as Hh, onMounted as Vn, effectScope as Wh, isRef as ho, defineComponent as Ka, h as xo, Text as Zh, onScopeDispose as ev, watchEffect as Eu, toRefs as lr, capitalize as jh, warn as tv, unref as K, provide as mn, camelize as zh, createStaticVNode as nn, createElementVNode as S, resolveDynamicComponent as Lo, withKeys as Qt, useSlots as Yh, isReactive as nv, normalizeStyle as kn, shallowReactive as ov, pushScopeId as cr, popScopeId as ur, readonly as Cu, createApp as iv, toRef as Qe, onBeforeUnmount as es, onUpdated as av, withDirectives as qo, TransitionGroup as ku, Transition as Tu, resolveDirective as dr, vShow as xu, useCssVars as sv, useAttrs as rv, toHandlers as lv, useModel as cv } from "./vue-d93cd563.js";
19
+ import { VListItemTitle as Mn, VListItem as Rt, VList as Qn, VSheet as ht, VTextField as uv, VTooltip as lt, VSvgIcon as dv, VIcon as Ze, VBtn as na, VSpacer as fr, VMenu as Po, VCol as st, VRow as ft, VDivider as Tn, VProgressLinear as fv, VCardText as qh, VCardTitle as Jh, VCard as ki, VDialog as Qh, VExpansionPanel as hv, VExpansionPanelTitle as mv, VExpansionPanelText as pv, VExpansionPanels as Lu, VCheckbox as gv, VDataTableServer as vv, VDataTable as _v, VListItemSubtitle as Vu, VFileInput as yv, VSlider as Xh, VContainer as ct, VToolbarItems as oa, VToolbar as ia, VSnackbar as bv, VSelect as wv, VRadio as Av, VRadioGroup as Sv, VPagination as Iv, VImg as Ev, VCardActions as Cv, VFooter as kv, VApp as Tv, VExpandTransition as xv, VChip as Lv, VTextarea as Vv, VDatePicker as Mv, VColorPicker as Kh, VTab as Nv, VTabs as Pv, VForm as Rv } from "./vuetify-6d0e90c9.js";
20
+ import { Feature as Vo, ol$Feature as Tc, ol$geom$Point as ts, ol$extent$getCenter as Ov, ol$Observable$unByKey as Ji, ol$proj$getTransform as Dv, ol$proj$get as Fv, ol$geom$LineString as Bv, ol$style$Icon as hr, ol$proj$transformExtent as em, ol$geom$Polygon$fromExtent as $v, ol$geom$Polygon as Gv, ol$extent$createOrUpdateFromCoordinates as Uv, ol$style$Circle as Hv, ol$style$Stroke as tm, ol$style$Fill as nm, ol$geom$Circle as Wv, ol$source$Vector as rl, ol$format$WMSCapabilities as Zv, ol$render$toContext as jv, ol$style$Style as zv } from "./ol-15bf8646.js";
21
+ import { useTheme as om, createVuetify as Yv, useDisplay as Ct } from "./vuetify-6d0e90c9.js";
22
+ import "./vuetify-6d0e90c9.js";
23
+ import { HeightReference as Ds, Entity as im, Cartesian2 as am, Cartographic as _i, SceneTransforms as qv, Color as ns, Cesium3DTilePointFeature as Jv, Cesium3DTileFeature as Qv, Cartesian3 as Zi, Ray as Xv, Math as yi } from "./cesium-a9fcdef3.js";
24
24
  window.CESIUM_BASE_URL = "./assets/cesium/";
25
25
  const L = (t, e) => {
26
26
  const o = t.__vccOpts || t;
@@ -1520,7 +1520,7 @@ function Y_() {
1520
1520
  }, Kl;
1521
1521
  }
1522
1522
  var q_ = Y_();
1523
- const Nc = "@vcmap/ui", Ls = "6.3.6";
1523
+ const Nc = "@vcmap/ui", Ls = "6.3.7";
1524
1524
  function ri() {
1525
1525
  return _e("plugin-helpers");
1526
1526
  }
@@ -9486,7 +9486,7 @@ function At() {
9486
9486
  function kr() {
9487
9487
  const t = Ct();
9488
9488
  return w(() => {
9489
- const e = t.platform.value.android || t.platform.value.ios || t.platform.value.touch, o = t.height.value <= t.thresholds.value.sm, n = t.height.value < t.width.value;
9489
+ const e = t.platform.value.android || t.platform.value.ios, o = t.height.value <= t.thresholds.value.sm, n = t.height.value < t.width.value;
9490
9490
  return e && n && o;
9491
9491
  });
9492
9492
  }
package/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui-a2ca1d03.js";
1
+ export * from "./ui-130549f1.js";
@@ -1 +1 @@
1
- export * from "./vue-1a9cf873.js";
1
+ export * from "./vue-d93cd563.js";
@@ -10,7 +10,7 @@ function loadCss(href) {
10
10
  elem.onerror = reject;
11
11
  document.head.appendChild(elem);
12
12
  });
13
- } await loadCss('./assets/vuetify-e536bde6.css');import { watch as Q, onScopeDispose as Ze, effectScope as Zl, shallowRef as K, reactive as it, computed as b, watchEffect as Fe, toRefs as Yt, capitalize as Nn, unref as ot, Fragment as ie, isVNode as Rc, Comment as Nc, warn as ja, getCurrentInstance as Hc, ref as j, provide as De, inject as ye, defineComponent as zc, h as Gt, camelize as Ir, toRaw as Be, createVNode as r, mergeProps as O, onBeforeUnmount as Qe, readonly as Ql, onMounted as Ye, onDeactivated as _r, onActivated as Wc, nextTick as we, TransitionGroup as Jl, Transition as jt, isRef as Tn, toRef as $, onBeforeMount as ra, withDirectives as $e, resolveDirective as gt, vShow as Ct, onUpdated as jc, Text as Uc, resolveDynamicComponent as Yc, markRaw as Gc, Teleport as Kc, cloneVNode as qc, createTextVNode as Tt, onUnmounted as Tr, onBeforeUpdate as Xc, withModifiers as Tl, toDisplayString as Zc, vModelText as Qc, resolveComponent as Jc, render as Ar } from "./vue-1a9cf873.js";
13
+ } await loadCss('./assets/vuetify-6d0e90c9.css');import { watch as Q, onScopeDispose as Ze, effectScope as Zl, shallowRef as K, reactive as it, computed as b, watchEffect as Fe, toRefs as Yt, capitalize as Nn, unref as ot, Fragment as ie, isVNode as Rc, Comment as Nc, warn as ja, getCurrentInstance as Hc, ref as j, provide as De, inject as ye, defineComponent as zc, h as Gt, camelize as Ir, toRaw as Be, createVNode as r, mergeProps as O, onBeforeUnmount as Qe, readonly as Ql, onMounted as Ye, onDeactivated as _r, onActivated as Wc, nextTick as we, TransitionGroup as Jl, Transition as jt, isRef as Tn, toRef as $, onBeforeMount as ra, withDirectives as $e, resolveDirective as gt, vShow as Ct, onUpdated as jc, Text as Uc, resolveDynamicComponent as Yc, markRaw as Gc, Teleport as Kc, cloneVNode as qc, createTextVNode as Tt, onUnmounted as Tr, onBeforeUpdate as Xc, withModifiers as Tl, toDisplayString as Zc, vModelText as Qc, resolveComponent as Jc, render as Ar } from "./vue-d93cd563.js";
14
14
  function rt(e, n) {
15
15
  let t;
16
16
  function a() {
@@ -1 +1 @@
1
- export * from "./vuetify-e536bde6.js";
1
+ export * from "./vuetify-6d0e90c9.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "6.3.6",
3
+ "version": "6.3.7",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@vcmap-cesium/engine": "^11.0.5",
58
- "@vcmap/core": "^6.3.5",
58
+ "@vcmap/core": "^6.3.7",
59
59
  "ol": "^10.4.0",
60
60
  "vue": "~3.4.38",
61
61
  "vuetify": "~3.7.14"
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@vcmap-show-case/tileset-feature-visibility",
3
+ "version": "1.0.0",
4
+ "mapVersion": "^6.0"
5
+ }
@@ -0,0 +1,349 @@
1
+ <template>
2
+ <v-sheet>
3
+ <VcsFormSection heading="Tileset Layer" expandable start-open>
4
+ <v-container class="py-0 px-1">
5
+ <v-row no-gutters>
6
+ <v-col>
7
+ <VcsLabel html-for="layer-select">Layer</VcsLabel>
8
+ </v-col>
9
+ <v-col>
10
+ <VcsSelect
11
+ id="layer-select"
12
+ :items="layerItems"
13
+ v-model="selectedLayerName"
14
+ placeholder="Select a CesiumTilesetLayer"
15
+ />
16
+ </v-col>
17
+ </v-row>
18
+ </v-container>
19
+ </VcsFormSection>
20
+
21
+ <VcsFormSection heading="Interaction" expandable start-open>
22
+ <v-container class="py-1 px-2">
23
+ <v-row no-gutters class="align-center">
24
+ <v-col>
25
+ Click to highlight, Ctrl+Click to hide, Shift+Click to hide globally
26
+ </v-col>
27
+ </v-row>
28
+ <v-row no-gutters class="mt-2">
29
+ <v-col>
30
+ <VcsFormButton
31
+ :variant="interactionActive ? 'filled' : 'outlined'"
32
+ :disabled="!selectedLayerName"
33
+ @click="toggleInteraction"
34
+ >
35
+ {{
36
+ interactionActive
37
+ ? 'Deactivate Interaction'
38
+ : 'Activate Interaction'
39
+ }}
40
+ </VcsFormButton>
41
+ </v-col>
42
+ </v-row>
43
+ </v-container>
44
+ </VcsFormSection>
45
+
46
+ <VcsFormSection
47
+ v-if="highlightedIds.length > 0"
48
+ heading="Highlighted Features"
49
+ expandable
50
+ start-open
51
+ :header-actions="highlightedHeaderActions"
52
+ >
53
+ <VcsList :items="highlightedListItems" :show-title="false" />
54
+ </VcsFormSection>
55
+
56
+ <VcsFormSection
57
+ v-if="globallyHiddenIds.length > 0"
58
+ heading="Globally Hidden Features"
59
+ expandable
60
+ start-open
61
+ :header-actions="globallyHiddenHeaderActions"
62
+ >
63
+ <VcsList :items="globallyHiddenListItems" :show-title="false" />
64
+ </VcsFormSection>
65
+
66
+ <VcsFormSection
67
+ v-if="hiddenIds.length > 0"
68
+ heading="Hidden Features"
69
+ expandable
70
+ start-open
71
+ :header-actions="hiddenHeaderActions"
72
+ >
73
+ <VcsList :items="hiddenListItems" :show-title="false" />
74
+ </VcsFormSection>
75
+ </v-sheet>
76
+ </template>
77
+
78
+ <script>
79
+ import { computed, inject, onUnmounted, ref, watch } from 'vue';
80
+ import {
81
+ CesiumTilesetLayer,
82
+ I3SLayer,
83
+ VectorLayer,
84
+ VectorTileLayer,
85
+ } from '@vcmap/core';
86
+ import {
87
+ VcsFormButton,
88
+ VcsFormSection,
89
+ VcsList,
90
+ VcsLabel,
91
+ VcsSelect,
92
+ } from '@vcmap/ui';
93
+ import { VSheet, VContainer, VRow, VCol } from 'vuetify/components';
94
+ import { name } from '../package.json';
95
+
96
+ export const windowId = 'tileset-feature-visibility-window';
97
+
98
+ export default {
99
+ name: 'TilesetFeatureVisibilityComponent',
100
+ components: {
101
+ VSheet,
102
+ VContainer,
103
+ VRow,
104
+ VCol,
105
+ VcsFormButton,
106
+ VcsFormSection,
107
+ VcsList,
108
+ VcsLabel,
109
+ VcsSelect,
110
+ },
111
+ setup() {
112
+ /** @type {import('@vcmap/ui').VcsUiApp} */
113
+ const app = inject('vcsApp');
114
+ const plugin = app.plugins.getByKey(name);
115
+
116
+ const selectedLayerName = ref(null);
117
+ const interactionActive = ref(false);
118
+ const highlightedIds = ref([]);
119
+ const hiddenIds = ref([]);
120
+ const { globallyHiddenIds } = plugin;
121
+
122
+ let visibilityListener = null;
123
+
124
+ function buildLayerItems() {
125
+ return [...app.layers]
126
+ .filter(
127
+ (l) =>
128
+ l instanceof CesiumTilesetLayer ||
129
+ l instanceof I3SLayer ||
130
+ l instanceof VectorLayer ||
131
+ l instanceof VectorTileLayer,
132
+ )
133
+ .map((l) => ({ title: l.properties.title || l.name, value: l.name }));
134
+ }
135
+
136
+ const layerItems = ref(buildLayerItems());
137
+ const layerListeners = [
138
+ app.layers.added.addEventListener(() => {
139
+ layerItems.value = buildLayerItems();
140
+ }),
141
+ app.layers.removed.addEventListener(() => {
142
+ layerItems.value = buildLayerItems();
143
+ }),
144
+ ];
145
+
146
+ /** @returns {import('@vcmap/core').CesiumTilesetLayer|null} */
147
+ function getSelectedLayer() {
148
+ if (!selectedLayerName.value) return null;
149
+ return /** @type {import('@vcmap/core').CesiumTilesetLayer} */ (
150
+ app.layers.getByKey(selectedLayerName.value)
151
+ );
152
+ }
153
+
154
+ function syncVisibilityState() {
155
+ const layer = getSelectedLayer();
156
+ if (!layer) {
157
+ highlightedIds.value = [];
158
+ hiddenIds.value = [];
159
+ return;
160
+ }
161
+ highlightedIds.value = Object.keys(
162
+ layer.featureVisibility.highlightedObjects,
163
+ );
164
+ hiddenIds.value = Object.keys(layer.featureVisibility.hiddenObjects);
165
+ }
166
+
167
+ watch(selectedLayerName, () => {
168
+ // Deactivate interaction when layer changes
169
+ if (interactionActive.value) {
170
+ plugin.deactivateInteraction();
171
+ interactionActive.value = false;
172
+ }
173
+
174
+ // Remove old listener
175
+ if (visibilityListener) {
176
+ visibilityListener();
177
+ visibilityListener = null;
178
+ }
179
+
180
+ // Set up new listener
181
+ const layer = getSelectedLayer();
182
+ if (layer) {
183
+ visibilityListener = layer.featureVisibility.changed.addEventListener(
184
+ () => {
185
+ syncVisibilityState();
186
+ },
187
+ );
188
+ syncVisibilityState();
189
+ } else {
190
+ highlightedIds.value = [];
191
+ hiddenIds.value = [];
192
+ }
193
+ });
194
+
195
+ function toggleInteraction() {
196
+ if (!selectedLayerName.value) return;
197
+ if (interactionActive.value) {
198
+ plugin.deactivateInteraction();
199
+ interactionActive.value = false;
200
+ } else {
201
+ const layer = getSelectedLayer();
202
+ if (layer) {
203
+ plugin.activateInteraction(layer, () => {
204
+ // Called when the interaction is forcefully removed by another tool
205
+ interactionActive.value = false;
206
+ });
207
+ interactionActive.value = true;
208
+ }
209
+ }
210
+ }
211
+
212
+ function showAllFeatures() {
213
+ const layer = getSelectedLayer();
214
+ if (layer) {
215
+ layer.featureVisibility.clearHiddenObjects();
216
+ }
217
+ }
218
+
219
+ function clearHighlights() {
220
+ const layer = getSelectedLayer();
221
+ if (layer) {
222
+ layer.featureVisibility.clearHighlighting();
223
+ }
224
+ }
225
+
226
+ function unhighlightFeature(id) {
227
+ const layer = getSelectedLayer();
228
+ if (layer) {
229
+ layer.featureVisibility.unHighlight([id]);
230
+ }
231
+ }
232
+
233
+ function showFeature(id) {
234
+ const layer = getSelectedLayer();
235
+ if (layer) {
236
+ layer.featureVisibility.showObjects([id]);
237
+ }
238
+ }
239
+
240
+ function globalShowObject(id) {
241
+ plugin.globalShowObject(id);
242
+ }
243
+
244
+ function clearGloballyHidden() {
245
+ plugin.clearGloballyHidden();
246
+ }
247
+
248
+ const highlightedListItems = computed(() =>
249
+ highlightedIds.value.map((id) => ({
250
+ name: id,
251
+ title: id,
252
+ actions: [
253
+ {
254
+ name: 'unhighlight',
255
+ icon: 'mdi-eye-off-outline',
256
+ tooltip: 'Unhighlight feature',
257
+ callback: () => unhighlightFeature(id),
258
+ },
259
+ ],
260
+ })),
261
+ );
262
+
263
+ const hiddenListItems = computed(() =>
264
+ hiddenIds.value.map((id) => ({
265
+ name: id,
266
+ title: id,
267
+ actions: [
268
+ {
269
+ name: 'show',
270
+ icon: 'mdi-eye-outline',
271
+ tooltip: 'Show feature',
272
+ callback: () => showFeature(id),
273
+ },
274
+ ],
275
+ })),
276
+ );
277
+
278
+ const globallyHiddenListItems = computed(() =>
279
+ globallyHiddenIds.value.map((id) => ({
280
+ name: id,
281
+ title: id,
282
+ actions: [
283
+ {
284
+ name: 'globalShow',
285
+ icon: 'mdi-eye-outline',
286
+ tooltip: 'Show feature globally',
287
+ callback: () => globalShowObject(id),
288
+ },
289
+ ],
290
+ })),
291
+ );
292
+
293
+ const highlightedHeaderActions = computed(() => [
294
+ {
295
+ name: 'clearHighlights',
296
+ icon: 'mdi-close-circle-outline',
297
+ tooltip: 'Clear All Highlights',
298
+ callback: clearHighlights,
299
+ },
300
+ ]);
301
+
302
+ const hiddenHeaderActions = computed(() => [
303
+ {
304
+ name: 'showAllHidden',
305
+ icon: 'mdi-eye-outline',
306
+ tooltip: 'Show All Hidden Features',
307
+ callback: showAllFeatures,
308
+ },
309
+ ]);
310
+
311
+ const globallyHiddenHeaderActions = computed(() => [
312
+ {
313
+ name: 'clearGloballyHidden',
314
+ icon: 'mdi-eye-outline',
315
+ tooltip: 'Show All Globally Hidden',
316
+ callback: clearGloballyHidden,
317
+ },
318
+ ]);
319
+
320
+ onUnmounted(() => {
321
+ layerListeners.forEach((cb) => cb());
322
+ if (visibilityListener) {
323
+ visibilityListener();
324
+ visibilityListener = null;
325
+ }
326
+ if (interactionActive.value) {
327
+ plugin.deactivateInteraction();
328
+ interactionActive.value = false;
329
+ }
330
+ });
331
+
332
+ return {
333
+ layerItems,
334
+ selectedLayerName,
335
+ interactionActive,
336
+ highlightedIds,
337
+ hiddenIds,
338
+ globallyHiddenIds,
339
+ toggleInteraction,
340
+ highlightedListItems,
341
+ hiddenListItems,
342
+ globallyHiddenListItems,
343
+ highlightedHeaderActions,
344
+ hiddenHeaderActions,
345
+ globallyHiddenHeaderActions,
346
+ };
347
+ },
348
+ };
349
+ </script>
@@ -0,0 +1,66 @@
1
+ import {
2
+ AbstractInteraction,
3
+ EventType,
4
+ ModificationKeyType,
5
+ vcsLayerName,
6
+ VectorStyleItem,
7
+ } from '@vcmap/core';
8
+
9
+ /** @type {import('@vcmap/core').VectorStyleItem} */
10
+ const defaultHighlightStyle = new VectorStyleItem({
11
+ fill: { color: [255, 215, 0, 0.8] },
12
+ });
13
+
14
+ /**
15
+ * Interaction that allows highlighting and hiding features of a CesiumTilesetLayer.
16
+ * - Click on a feature: toggle highlight
17
+ * - Ctrl/Cmd + Click on a feature: hide the feature via featureVisibility
18
+ * - Shift + Click on a feature: hide the feature globally via globalHider
19
+ */
20
+ export default class TilesetFeatureVisibilityInteraction extends AbstractInteraction {
21
+ /**
22
+ * @param {import('@vcmap/core').CesiumTilesetLayer} layer
23
+ * @param {function(string):void} globalHideCallback - called with the feature id when globally hiding
24
+ */
25
+ constructor(layer, globalHideCallback) {
26
+ super(EventType.CLICK, ModificationKeyType.ALL);
27
+ /** @type {import('@vcmap/core').CesiumTilesetLayer} */
28
+ this._layer = layer;
29
+ /** @type {function(string):void} */
30
+ this._globalHideCallback = globalHideCallback;
31
+ }
32
+
33
+ /**
34
+ * @param {import('@vcmap/core').InteractionEvent} event
35
+ * @returns {Promise<import('@vcmap/core').InteractionEvent>}
36
+ */
37
+ pipe(event) {
38
+ const { feature } = event;
39
+ if (feature && feature[vcsLayerName] === this._layer.name) {
40
+ const id = String(feature.getId());
41
+ const { featureVisibility } = this._layer;
42
+
43
+ if (event.key === ModificationKeyType.CTRL) {
44
+ // Ctrl/Cmd + Click: hide the feature via featureVisibility
45
+ featureVisibility.hideObjects([id]);
46
+ event.stopPropagation = true;
47
+ } else if (event.key === ModificationKeyType.SHIFT) {
48
+ // Shift + Click: hide the feature globally via globalHider
49
+ this._globalHideCallback(id);
50
+ event.stopPropagation = true;
51
+ } else if (event.key === ModificationKeyType.NONE) {
52
+ // Click: toggle highlight
53
+ if (featureVisibility.highlightedObjects[id]) {
54
+ featureVisibility.unHighlight([id]);
55
+ } else {
56
+ const highlightStyle =
57
+ this._layer.highlightStyle ?? defaultHighlightStyle;
58
+ featureVisibility.highlight({ [id]: highlightStyle });
59
+ }
60
+ event.stopPropagation = true;
61
+ }
62
+ }
63
+
64
+ return Promise.resolve(event);
65
+ }
66
+ }
@@ -0,0 +1,135 @@
1
+ import { ref } from 'vue';
2
+ import { ButtonLocation, createToggleAction, WindowSlot } from '@vcmap/ui';
3
+ import { name, version, mapVersion } from '../package.json';
4
+ import TilesetFeatureVisibilityComponent, {
5
+ windowId,
6
+ } from './TilesetFeatureVisibilityComponent.vue';
7
+ import TilesetFeatureVisibilityInteraction from './TilesetFeatureVisibilityInteraction.js';
8
+
9
+ export default function tilesetFeatureVisibilityPlugin() {
10
+ /** @type {(() => number)|null} */
11
+ let removeInteraction = null;
12
+ /** @type {TilesetFeatureVisibilityInteraction|null} */
13
+ let interaction = null;
14
+ /** @type {import('@vcmap/ui').VcsUiApp|null} */
15
+ let vcsApp = null;
16
+ /** @type {import('vue').Ref<string[]>} */
17
+ const globallyHiddenIds = ref([]);
18
+
19
+ return {
20
+ get name() {
21
+ return name;
22
+ },
23
+ get version() {
24
+ return version;
25
+ },
26
+ get mapVersion() {
27
+ return mapVersion;
28
+ },
29
+
30
+ /**
31
+ * Activate the tileset feature visibility interaction for the given layer.
32
+ * @param {import('@vcmap/core').CesiumTilesetLayer} layer
33
+ * @param {function():void} [onRemoved] - called if the interaction is forcefully removed
34
+ */
35
+ activateInteraction(layer, onRemoved) {
36
+ if (removeInteraction) {
37
+ removeInteraction();
38
+ removeInteraction = null;
39
+ }
40
+ interaction = new TilesetFeatureVisibilityInteraction(layer, (id) => {
41
+ vcsApp.layers.globalHider.hideObjects([id]);
42
+ if (!globallyHiddenIds.value.includes(id)) {
43
+ globallyHiddenIds.value = [...globallyHiddenIds.value, id];
44
+ }
45
+ });
46
+ removeInteraction = vcsApp.maps.eventHandler.addExclusiveInteraction(
47
+ interaction,
48
+ () => {
49
+ interaction = null;
50
+ removeInteraction = null;
51
+ onRemoved?.();
52
+ },
53
+ undefined,
54
+ name,
55
+ );
56
+ },
57
+
58
+ /**
59
+ * Deactivate the tileset feature visibility interaction.
60
+ */
61
+ deactivateInteraction() {
62
+ if (removeInteraction) {
63
+ removeInteraction();
64
+ removeInteraction = null;
65
+ }
66
+ interaction = null;
67
+ },
68
+
69
+ /**
70
+ * Show a feature that was globally hidden by this plugin.
71
+ * @param {string} id
72
+ */
73
+ globalShowObject(id) {
74
+ vcsApp.layers.globalHider.showObjects([id]);
75
+ globallyHiddenIds.value = globallyHiddenIds.value.filter((i) => i !== id);
76
+ },
77
+
78
+ /**
79
+ * Show all features that were globally hidden by this plugin.
80
+ */
81
+ clearGloballyHidden() {
82
+ const ids = [...globallyHiddenIds.value];
83
+ vcsApp.layers.globalHider.showObjects(ids);
84
+ globallyHiddenIds.value = [];
85
+ },
86
+
87
+ /**
88
+ * Reactive ref of feature ids globally hidden by this plugin.
89
+ * @type {import('vue').Ref<string[]>}
90
+ */
91
+ get globallyHiddenIds() {
92
+ return globallyHiddenIds;
93
+ },
94
+
95
+ /**
96
+ * @param {import('@vcmap/ui').VcsUiApp} app
97
+ */
98
+ initialize(app) {
99
+ vcsApp = app;
100
+
101
+ const { action, destroy } = createToggleAction(
102
+ {
103
+ name: 'Tileset Feature Visibility',
104
+ title: 'Tileset Feature Visibility',
105
+ icon: 'mdi-layers-search',
106
+ },
107
+ {
108
+ id: windowId,
109
+ state: {
110
+ headerTitle: 'Tileset Feature Visibility',
111
+ headerIcon: 'mdi-layers-search',
112
+ },
113
+ component: TilesetFeatureVisibilityComponent,
114
+ slot: WindowSlot.DYNAMIC_LEFT,
115
+ },
116
+ app.windowManager,
117
+ name,
118
+ );
119
+
120
+ app.navbarManager.add(
121
+ { id: 'tileset-feature-visibility', action },
122
+ name,
123
+ ButtonLocation.TOOL,
124
+ );
125
+
126
+ this._destroy = destroy;
127
+ },
128
+
129
+ destroy() {
130
+ this.deactivateInteraction();
131
+ this.clearGloballyHidden();
132
+ this._destroy?.();
133
+ },
134
+ };
135
+ }