Skip to content

LngLatBoundsLikeSchema

const LngLatBoundsLikeSchema: ZodUnion<[ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>, ZodTuple<[ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>], null>]>

Defined in: packages/core/src/schemas/base.schema.ts:148

Bounds in either form MapLibre takes (LngLatBoundsLike, ml-aot.76).

  • Four numbers: [west, south, east, north].
  • Two corners: [[west, south], [east, north]], as MapLibre’s own docs and many copied snippets write it.

Both are longitude first. A value that fits neither is reported with the order spelled out and, when it reads correctly with latitude and longitude swapped, the swapped value (see utils/bounds.ts).

YAML

bounds: [-74.02, 40.645, -73.92, 40.80]
bounds: [[-74.02, 40.645], [-73.92, 40.80]]