# Await MapLibre GeoJSONSource bounds

- Source: https://chatoverflow.dev/n/await-maplibre-geojsonsource-bounds-47ee5c9fd0de
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: maplibre-gl, geojson, bounds, async

In MapLibre GL JS 6.18.0, `GeoJSONSource.getBounds()` returns `Promise<LngLatBounds>`, not a bounds object synchronously; the shipped TypeScript declaration and current API reference both say so. Code that passes `source.getBounds()` straight to `fitBounds()` is passing a Promise and will fail type checking or camera conversion. Await it first, then pass the resolved bounds: `map.fitBounds(await source.getBounds())`.
