From bf9202bec43d018c356e4b08263201efcf24e6d8 Mon Sep 17 00:00:00 2001 From: yileifeng Date: Thu, 7 Nov 2024 08:20:54 -0500 Subject: [PATCH] add configurable option to support teleporting areas of interest outside RAMP container --- StoryRampSchema.json | 13 ++++-- ...000000-0000-0000-0000-000000000000_en.json | 3 +- src/components/panels/interactive-map.vue | 41 ++++++++++++++++--- src/components/story/horizontal-menu.vue | 8 ++-- src/definitions.ts | 5 ++- 5 files changed, 54 insertions(+), 16 deletions(-) diff --git a/StoryRampSchema.json b/StoryRampSchema.json index 357d00d8..ac564986 100644 --- a/StoryRampSchema.json +++ b/StoryRampSchema.json @@ -230,9 +230,10 @@ "default": false }, "teleportGrid": { - "type": "boolean", - "description": "Whether or not to teleport grid outside of RAMP instance.", - "default": false + "type": "string", + "description": "Specifies where to teleport grid outside of RAMP instance.", + "default": "", + "enum": ["", "left", "right"] }, "title": { "type": "string", @@ -272,6 +273,12 @@ "type": "string", "description": "A title that is displayed centered above this map." }, + "teleportAOI": { + "type": "string", + "description": "Specifies where to teleport areas of interest outside of RAMP instance.", + "default": "", + "enum": ["", "left", "right"] + }, "points": { "type": "array", "description": "A list of points of interest.", diff --git a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json index a7bac619..c9ead2df 100644 --- a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json +++ b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json @@ -35,7 +35,7 @@ { "config": "00000000-0000-0000-0000-000000000000/ramp-config/CommunityDirectory.json", "type": "map", - "teleportGrid": true, + "teleportGrid": "left", "scrollguard": true } ], @@ -49,6 +49,7 @@ "type": "interactive-map", "scrollguard": true, "title": "Map Title Test", + "teleportAOI": "right", "points": [ { "title": "Point of Interest A", diff --git a/src/components/panels/interactive-map.vue b/src/components/panels/interactive-map.vue index 8063a6b0..bee4d58c 100644 --- a/src/components/panels/interactive-map.vue +++ b/src/components/panels/interactive-map.vue @@ -1,11 +1,30 @@ @@ -55,7 +74,9 @@ onMounted(() => { const init = async () => { // Find the map component. - mapComponent.value = el.value.children[1]; + mapComponent.value = props.config.teleportAOI + ? el.value.children[0].children[0].children[0] + : el.value.children[0].children[1]; fetch(props.config.config).then((data) => { // parse JSON data @@ -185,6 +206,14 @@ const handlePoint = (id: string, oid: number, layerIndex?: number) => { height: calc(100vh - 4rem) !important; } } + .teleport-container { + .rv-map { + max-height: 50vh; + } + .point-of-interest { + width: 100%; + } + } } :deep(rv-basemap-item .rv-basemap-thumb img) { diff --git a/src/components/story/horizontal-menu.vue b/src/components/story/horizontal-menu.vue index a92fb0c0..047eeae1 100644 --- a/src/components/story/horizontal-menu.vue +++ b/src/components/story/horizontal-menu.vue @@ -7,7 +7,7 @@ @click="scrollToChapter('intro')" v-tippy="{ delay: '200', - placement: 'right', + placement: 'bottom', content: $t('chapters.return'), animateFill: true, animation: 'chapter-menu' @@ -25,7 +25,7 @@ target v-tippy="{ delay: '200', - placement: 'right', + placement: 'bottom', content: $t('chapters.return'), animateFill: true, animation: 'chapter-menu' @@ -44,7 +44,7 @@ @click="scrollToChapter(`${slide.index}-${slide.title.toLowerCase().replaceAll(' ', '-')}`)" v-tippy="{ delay: '200', - placement: 'right', + placement: 'bottom', content: getTitle(slide), animateFill: true, animation: 'chapter-menu' @@ -62,7 +62,7 @@ target v-tippy="{ delay: '200', - placement: 'right', + placement: 'bottom', content: getTitle(slide), animateFill: true, animation: 'chapter-menu' diff --git a/src/definitions.ts b/src/definitions.ts index bdc1aff7..9e441a87 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -164,8 +164,8 @@ export interface MapPanel extends BasePanel { timeSlider?: TimeSliderConfig; title: string; scrollguard: boolean; - teleportGrid?: boolean; - customTemplates: String[]; + teleportGrid?: string; + customTemplates: string[]; } export interface InteractiveMapPanel extends BasePanel { @@ -174,6 +174,7 @@ export interface InteractiveMapPanel extends BasePanel { title: string; scrollguard: boolean; points: PointOfInterest[]; + teleportAOI?: string; } export interface PointOfInterest {