Skip to content

Commit 49af3f3

Browse files
authored
Exposed bearingSnap property via MapLibre.svelte properties (#244)
* Exposed bearingSnap property via MapLibre.svelte properties. * Added changeset
1 parent f09ab3a commit 49af3f3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/brave-jeans-train.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte-maplibre': minor
3+
---
4+
5+
Exposed the bearingSnap property in the maps props to allow control over the default automatic snap-to-north

src/lib/MapLibre.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
zoom?: number | undefined;
3535
pitch?: number;
3636
bearing?: number;
37+
bearingSnap?: number;
3738
bounds?: LngLatBoundsLike | undefined;
3839
/** Set to true to track the map viewport in the URL hash. If the URL hash is set, that overrides initial viewport settings. */
3940
hash?: boolean;
@@ -111,6 +112,7 @@
111112
zoom = $bindable(undefined),
112113
pitch = $bindable(0),
113114
bearing = $bindable(0),
115+
bearingSnap = 7,
114116
bounds = $bindable(undefined),
115117
hash = false,
116118
updateHash = (url) => {
@@ -247,6 +249,7 @@
247249
zoom,
248250
pitch,
249251
bearing,
252+
bearingSnap,
250253
minZoom,
251254
maxZoom,
252255
minPitch,

0 commit comments

Comments
 (0)