diff --git a/app/components/BasemapAttribution.vue b/app/components/BasemapAttribution.vue index 20d12b482..6c51a0d57 100644 --- a/app/components/BasemapAttribution.vue +++ b/app/components/BasemapAttribution.vue @@ -9,14 +9,18 @@ const basemapStore = useBasemapStore(); {{ basemapStore.attribution }} diff --git a/app/components/Viewer/ContextMenu/ContextMenu.vue b/app/components/Viewer/ContextMenu/ContextMenu.vue index fe31445c2..7c46f56b5 100644 --- a/app/components/Viewer/ContextMenu/ContextMenu.vue +++ b/app/components/Viewer/ContextMenu/ContextMenu.vue @@ -10,6 +10,7 @@ import { provideBatchGroup } from "@ogw_front/composables/batch_style"; import { useEventListener } from "@vueuse/core"; import { useMenuStore } from "@ogw_front/stores/menu"; import { useTreeviewStore } from "@ogw_front/stores/treeview"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; // A position of the context menu in its container, in pixels interface ContextMenuPosition { @@ -35,7 +36,8 @@ const CENTER_BUTTON_SIZE = 52; const CENTER_BUTTON_HALF_SIZE = 26; const menuStore = useMenuStore(); -const treeviewStore = useTreeviewStore(); +const viewerId = useViewerId(); +const treeviewStore = useTreeviewStore(viewerId); const meta_data = computed(() => menuStore.current_meta_data || {}); const isSceneMenu = computed(() => meta_data.value.viewer_object_type === "scene"); @@ -141,7 +143,7 @@ const isOverTreeview = computed(() => { }); const isOverToolbar = computed(() => { - const toolbarEl = document.querySelector(".view-toolbar"); + const toolbarEl = document.querySelector(`[data-viewer-id="${viewerId}"] .view-toolbar`); if (!toolbarEl) { return false; } diff --git a/app/components/Viewer/ContextMenu/ContextMenuItem.vue b/app/components/Viewer/ContextMenu/ContextMenuItem.vue index 90a14f89b..589fe512e 100644 --- a/app/components/Viewer/ContextMenu/ContextMenuItem.vue +++ b/app/components/Viewer/ContextMenu/ContextMenuItem.vue @@ -11,6 +11,7 @@ import { useAdaptiveStyles } from "@ogw_front/composables/use_adaptive_styles"; import { useMenuStore } from "@ogw_front/stores/menu"; import { useTheme } from "vuetify"; import { useTreeviewStore } from "@ogw_front/stores/treeview"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; const CARD_WIDTH = 300; const CARD_HEIGHT = 500; @@ -55,7 +56,8 @@ const TREEVIEW_MARGIN_LEFT = 10; const TREEVIEW_MARGIN_RIGHT = 20; const TREEVIEW_ICON_WIDTH = 48; -const treeviewStore = useTreeviewStore(); +const viewerId = useViewerId(); +const treeviewStore = useTreeviewStore(viewerId); const isOverTreeview = computed(() => { const hasAdditional = treeviewStore.opened_views.some((view) => view.id !== "main"); const hasMain = treeviewStore.opened_views.some((view) => view.id === "main"); @@ -71,7 +73,7 @@ const isOverTreeview = computed(() => { }); const isOverToolbar = computed(() => { - const toolbarEl = document.querySelector(".view-toolbar"); + const toolbarEl = document.querySelector(`[data-viewer-id="${viewerId}"] .view-toolbar`); if (!toolbarEl) { return false; } diff --git a/app/components/Viewer/ContextMenu/InfoCard.vue b/app/components/Viewer/ContextMenu/InfoCard.vue index 7b3f781cd..3bd52f5a0 100644 --- a/app/components/Viewer/ContextMenu/InfoCard.vue +++ b/app/components/Viewer/ContextMenu/InfoCard.vue @@ -13,6 +13,7 @@ import { useCrsStore } from "@ogw_front/stores/crs"; import { useDataStore } from "@ogw_front/stores/data"; import { useLiveDataItem } from "@ogw_front/composables/live_data_item"; import { useMenuStore } from "@ogw_front/stores/menu"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; // The component of a model the context menu is opened on, as the info card shows it interface MeshComponentInfo { @@ -137,6 +138,7 @@ function formatId(id: DataId | ModelComponentId | undefined): string { const formattedId = computed(() => formatId(metaData.data_id)); const crsStore = useCrsStore(); +const viewerId = useViewerId(); // A model component shares the model CRS: the CRS row is only shown for a data const isData = computed( () => metaData.data_id !== undefined && metaData.modelId === undefined, @@ -202,7 +204,7 @@ const liveCrs = computed(() => liveItem.value?.crs ?? metaData.crs); density="compact" size="x-small" class="ml-1" - @click.stop="crsStore.requestCrsEdit(metaData.data_id)" + @click.stop="crsStore.requestCrsEdit(metaData.data_id, viewerId)" /> diff --git a/app/components/Viewer/CrsOverlays.vue b/app/components/Viewer/CrsOverlays.vue index cf80f6089..75c945710 100644 --- a/app/components/Viewer/CrsOverlays.vue +++ b/app/components/Viewer/CrsOverlays.vue @@ -24,6 +24,6 @@ const crsStore = useCrsStore(); data-testid="crsAlignPanel" :escape-function="crsStore.closeCrsAlign" > - + diff --git a/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue b/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue index 4c8c6ce3c..12ab4e780 100644 --- a/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +++ b/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue @@ -22,9 +22,11 @@ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Opti import { useBatchStyleModel } from "@ogw_front/composables/batch_style_model"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue index 21d5da9e5..99e79dba4 100644 --- a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +++ b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue @@ -11,9 +11,11 @@ import ViewerOptionsWidthSlider from "@ogw_front/components/Viewer/Options/Slide import { useBatchStyle } from "@ogw_front/composables/batch_style"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/CellsColoring.vue b/app/components/Viewer/Generic/Mesh/CellsColoring.vue index d99412d94..2957bc8c4 100644 --- a/app/components/Viewer/Generic/Mesh/CellsColoring.vue +++ b/app/components/Viewer/Generic/Mesh/CellsColoring.vue @@ -22,9 +22,11 @@ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Opti import { useBatchStyleModel } from "@ogw_front/composables/batch_style_model"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/CellsOptions.vue b/app/components/Viewer/Generic/Mesh/CellsOptions.vue index 78a1c6912..183daaaea 100644 --- a/app/components/Viewer/Generic/Mesh/CellsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/CellsOptions.vue @@ -8,9 +8,11 @@ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types"; import { useBatchStyle } from "@ogw_front/composables/batch_style"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/EdgesColoring.vue b/app/components/Viewer/Generic/Mesh/EdgesColoring.vue index 26324b6ec..19bd853f6 100644 --- a/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +++ b/app/components/Viewer/Generic/Mesh/EdgesColoring.vue @@ -22,9 +22,11 @@ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Opti import { useBatchStyleModel } from "@ogw_front/composables/batch_style_model"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue index 3223e895a..a4a6249b8 100644 --- a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +++ b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue @@ -10,9 +10,11 @@ import ViewerOptionsWidthSlider from "@ogw_front/components/Viewer/Options/Slide import { useBatchStyle } from "@ogw_front/composables/batch_style"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/PointsOptions.vue b/app/components/Viewer/Generic/Mesh/PointsOptions.vue index e579dda4c..acbc5a4e2 100644 --- a/app/components/Viewer/Generic/Mesh/PointsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PointsOptions.vue @@ -26,9 +26,11 @@ import ViewerOptionsSizeSlider from "@ogw_front/components/Viewer/Options/Slider import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue b/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue index 0b0c2b755..b60f28559 100644 --- a/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +++ b/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue @@ -23,9 +23,11 @@ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Opti import { useBatchStyleModel } from "@ogw_front/composables/batch_style_model"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue b/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue index 4fc78ea3a..51e331922 100644 --- a/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue @@ -9,9 +9,11 @@ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types"; import { useBatchStyle } from "@ogw_front/composables/batch_style"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue b/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue index ecca2edbd..260fb3eb9 100644 --- a/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +++ b/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue @@ -21,9 +21,11 @@ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Opti import { useBatchStyleModel } from "@ogw_front/composables/batch_style_model"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue b/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue index 82e689f4d..856372951 100644 --- a/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue @@ -8,9 +8,11 @@ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types"; import { useBatchStyle } from "@ogw_front/composables/batch_style"; import { useDataStyleStore } from "@ogw_front/stores/data_style"; import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"; +import { useViewerId } from "@ogw_front/composables/viewer_id"; -const dataStyleStore = useDataStyleStore(); -const hybridViewerStore = useHybridViewerStore(); +const viewerId = useViewerId(); +const dataStyleStore = useDataStyleStore(viewerId); +const hybridViewerStore = useHybridViewerStore(viewerId); const { applyBatchStyle } = useBatchStyle(); interface Props { diff --git a/app/components/Viewer/Generic/Model/BlocksOptions.vue b/app/components/Viewer/Generic/Model/BlocksOptions.vue index fdfe03d5d..457daac61 100644 --- a/app/components/Viewer/Generic/Model/BlocksOptions.vue +++ b/app/components/Viewer/Generic/Model/BlocksOptions.vue @@ -1,7 +1,4 @@