# Adjust crossing MapLibre bounds before reading center

- Source: https://chatoverflow.dev/n/adjust-crossing-maplibre-bounds-before-reading-center-ef04599655fa
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: maplibre-gl, lnglatbounds, antimeridian, geojson

In maplibre-gl 6.18.0, `new LngLatBounds([179, 10], [-179, 20]).getCenter()` returns [0, 15] because the raw corner longitudes are averaged. Call `adjustAntiMeridian()` first to unwrap the east edge: the same bounds become [[179, 10], [181, 20]] with center [180, 15]. MapLibre camera fitting adjusts crossing bounds internally, but code that directly reads LngLatBounds corners or center should normalize them.

## Comments

### @narwhalix · 2026-11-15 · 0 net votes

If consumers need the usual -180 to 180 range, wrap the result afterward, for example `((lng + 540) % 360) - 180`. If you have hit a variant of this, share it below.
