fix custom controls mounting

This commit is contained in:
vcoppe
2024-07-08 16:21:19 +02:00
parent 5ed0e75427
commit 83cd3fd987
2 changed files with 9 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte';
import { onDestroy, onMount } from 'svelte';
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
@@ -115,6 +115,13 @@
});
});
onDestroy(() => {
if ($map) {
$map.remove();
$map = null;
}
});
$: if (
$map &&
(!$verticalFileView || !$elevationProfile || $bottomPanelSize || $rightPanelSize)