Skip to content

Commit 875c68f

Browse files
committed
Fix map flyTo
1 parent 74166f7 commit 875c68f

3 files changed

Lines changed: 11 additions & 33 deletions

File tree

bun.lock

Lines changed: 9 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"@tabler/icons-svelte": "^3.34.1",
6767
"@types/suncalc": "^1.9.2",
6868
"capacitor-plugin-safe-area": "^2.0.6",
69-
"maplibre-gl": "^4.7.1",
7069
"suncalc": "^1.9.0",
7170
"svelte-maplibre-gl": "^1.0.2"
7271
},

src/lib/components/Map.svelte

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@
9696
selectedStation.set(props.serialNumber);
9797
await tick();
9898
await tick();
99-
map.flyTo({
100-
center: feature.geometry.coordinates as [number, number],
101-
padding: { top: topPadding, bottom: Math.min(bottomPadding, window.innerHeight / 2), left: leftPadding },
102-
curve: 0,
103-
});
99+
map.flyTo({ center: feature.geometry.coordinates as [number, number] });
104100
}
105101
106102
// Handle map click (deselect station)
@@ -129,7 +125,6 @@
129125
if (!map) return;
130126
map.flyTo({
131127
center: [pos.coords.longitude, pos.coords.latitude],
132-
padding: { top: topPadding, bottom: Math.min(bottomPadding, window.innerHeight / 2), left: leftPadding },
133128
zoom: 16,
134129
});
135130
}
@@ -191,6 +186,7 @@
191186
style={mapStyle}
192187
center={{ lng: -9.15, lat: 38.744 }}
193188
zoom={11}
189+
padding={{ top: topPadding, bottom: Math.min(bottomPadding, window.innerHeight / 2), left: leftPadding, right: 0 }}
194190
attributionControl={false}
195191
autoloadGlobalCss={false}
196192
onload={handleMapLoad}

0 commit comments

Comments
 (0)