import { type GeoJsonBbox, type GeoJsonGeometry, type GeoJsonPosition } from "@trackunit/geo-json-utils"; import type { FitBoundsOptions, MapApi } from "../../core/types"; /** * Compute a bounding box from an array of positions. * Returns null if the array is empty. * * @param positions - Array of [longitude, latitude] positions * @returns GeoJsonBbox as [minLon, minLat, maxLon, maxLat] or null */ export declare const computeBoundsFromPositions: (positions: ReadonlyArray) => GeoJsonBbox | null; /** * For a GeoJSON bbox `[minLon, minLat, maxLon, maxLat]`, returns the **larger** * of the east–west extent and the north–south extent, in **degrees**. * * Used when choosing `fitBounds` padding so padding follows the longer geographic * axis (a very thin box still gets a sensible scale). */ export declare const maxLongitudeLatitudeSpanDegrees: (bbox: GeoJsonBbox) => number; /** * Compute dynamic fitBounds options based on the geographic span of a bounding box. * Smaller shapes get more padding and a maxZoom cap to avoid over-zooming; * larger shapes get less padding. */ export declare const computeFitPadding: (maxSpanDegrees: number) => FitBoundsOptions; /** * Compute bounds from a geometry and fit the map viewport with span-based dynamic padding. * No-op if the geometry yields no positions (e.g. empty GeometryCollection). */ export declare const fitFeatureBounds: (api: MapApi, geometry: GeoJsonGeometry) => void; /** * Merge multiple bounding boxes into one that encompasses all of them. * Ignores null entries. Returns null if all inputs are null. */ export declare const mergeBounds: (boxes: ReadonlyArray) => GeoJsonBbox | null;