UNPKG

geojson-map-fit-mercator

Version:

Finds the optimal bearing, zoom and center point for fitting a set of GeoJSON features in a Mapbox GL or LibreMap Mercator map.

31 lines 835 B
import type { Feature, LineString, Polygon } from 'geojson'; export type XY = [number, number]; export type LngLat = [number, number]; export interface mapFitOptions { tileSize?: number; preferredBearing?: number; maxZoom?: number; floatZoom?: boolean; padding?: mapFitPadding; } export interface mapFitPadding { left?: number; right?: number; top?: number; bottom?: number; } export interface mapFitResult { bearing: number; zoom: number; center: LngLat; } export interface rectangleOrientation { shortSide: Feature<LineString> | undefined; longSide: Feature<LineString> | undefined; } export interface boundingOrientation { bearing: number | undefined; orientation: rectangleOrientation; envelope: Feature<Polygon> | undefined; } //# sourceMappingURL=types.d.ts.map