From 8ac95dc6a9e1ceb19ad0da871a8d564a0f3c09a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Thu, 11 Aug 2022 23:08:25 +0200 Subject: [PATCH] [wip] Add option to enable markers on Globe2 --- src/components/organisms/InteractiveGlobe2.svelte | 4 ++++ src/modules/globe2/index.ts | 2 ++ src/modules/globe2/pane.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/components/organisms/InteractiveGlobe2.svelte b/src/components/organisms/InteractiveGlobe2.svelte index 2e733b4..69e5282 100644 --- a/src/components/organisms/InteractiveGlobe2.svelte +++ b/src/components/organisms/InteractiveGlobe2.svelte @@ -11,6 +11,9 @@ // Components import Image from '$components/atoms/Image.svelte' + export let type: string = undefined + export let enableMarkers: boolean = true + let innerWidth: number let globeParentEl: HTMLElement, globeEl: HTMLElement let globe: any @@ -41,6 +44,7 @@ autoRotate: true, speed: 0.003, rotationStart: randomContinent.rotation, + enableMarkers, markers, pane: import.meta.env.DEV, }) diff --git a/src/modules/globe2/index.ts b/src/modules/globe2/index.ts index fbfbea5..9b95ce4 100644 --- a/src/modules/globe2/index.ts +++ b/src/modules/globe2/index.ts @@ -19,6 +19,7 @@ export class Globe { this.params = { autoRotate: options.autoRotate, speed: options.speed, + enableMarkers: options.enableMarkers, zoom: 1.305, } @@ -279,6 +280,7 @@ type Options = { autoRotate: boolean speed: number rotationStart?: number + enableMarkers?: boolean markers?: any[] pane?: boolean } diff --git a/src/modules/globe2/pane.ts b/src/modules/globe2/pane.ts index 48e98c3..7c9fce9 100644 --- a/src/modules/globe2/pane.ts +++ b/src/modules/globe2/pane.ts @@ -15,4 +15,7 @@ export const createPane = (ctx: any) => { max: 0.025, step: 0.00025, }) + ctx.pane.addInput(ctx.params, 'enableMarkers', { + label: 'Enable markers', + }) } \ No newline at end of file