Skip to content

Commit ef0ef1c

Browse files
authored
Make initialLocation keys optional (#354)
1 parent 26dc16c commit ef0ef1c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

components/src/maplibre/Map/Map.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
import { type Location } from '../types';
1010
11-
import { onMount, onDestroy, type Snippet, getContext, hasContext } from 'svelte';
11+
import { onMount, onDestroy, type Snippet, getContext } from 'svelte';
1212
1313
import { createMapContext, MapContext } from '../context.svelte.js';
1414
import FallbackStyle from './FallbackStyle';
@@ -21,7 +21,7 @@
2121
*/
2222
initialBounds?: LngLatBoundsLike;
2323
maxBounds?: LngLatBoundsLike;
24-
initialLocation?: Location;
24+
initialLocation?: Partial<Location>;
2525
allowPan?: boolean;
2626
allowRotation?: boolean;
2727
allowZoom?: boolean;
@@ -85,7 +85,7 @@
8585
// 2. initialLocation prop
8686
// 3. initialLocation context (notably set by <WithLinkLocation/>)
8787
88-
let contextLocation = getContext('initialLocation');
88+
let contextLocation: Location = getContext('initialLocation');
8989
9090
let initialLocation = $derived({
9191
lat: 51.3,

0 commit comments

Comments
 (0)