From c4d83531f83cde2e5d77aa0c0014d4af585575a1 Mon Sep 17 00:00:00 2001 From: Kanahiro Date: Thu, 21 Nov 2024 03:38:43 +0900 Subject: [PATCH] tinyfix --- src/lib/maplibre/controls/CustomControl/Control.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/maplibre/controls/CustomControl/Control.svelte b/src/lib/maplibre/controls/CustomControl/Control.svelte index 9fd6649..5fdd3af 100644 --- a/src/lib/maplibre/controls/CustomControl/Control.svelte +++ b/src/lib/maplibre/controls/CustomControl/Control.svelte @@ -11,12 +11,11 @@ children?: Snippet; } let { position, control, children }: Props = $props(); + if (!control && !children) throw new Error('You must provide either control or children.'); const mapCtx = getMapContext(); if (!mapCtx.map) throw new Error('Map instance is not initialized.'); - if (!control && !children) throw new Error('You must provide either control or children.'); - let el: HTMLDivElement | undefined = $state(undefined); if (children) { control = {