map

map.flyToBounds

flyToBounds(bbox: GeoBounds, options?: FlyToBoundsOptions): Promise<void>

Animate the camera to fit a geographic bounding box.

Planar: computes a tile zoom level that fits the bbox into the current viewport (with optional padding), then delegates to flyTo.

Spherical: Phase 1 falls back to flyTo(center, { zoomLevel: 8 }). Precise spherical bbox-to-camera math is a Phase 2 enhancement.

The padding-to-degree conversion uses the current _mapSize (defaults to 10 scene units). Hosts that call enableMap({ mapSize: ... }) with a non-default size will see padding scaled accordingly.

Edge cases:

  • Zero-area bbox → high zoom, clamped to a sensible maximum.
  • Antimeridian-crossing bbox (east < west) → not supported in Phase 1. Behavior may produce a wrong center but will not throw.
bboxGeoBounds
optionsFlyToBoundsOptions

Returns: Promise<void>