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 = {