UNPKG

vue3-maplibre-gl

Version:

Vue 3 components and composables for MapLibre GL JS - Build interactive maps with ease

57 lines (56 loc) 2.12 kB
import { Nullable } from '../../types'; import { MaybeRef } from 'vue'; import { Map, FitBoundsOptions, PointLike } from 'maplibre-gl'; /** * Screen coordinates fitting status enum for better state management */ export declare enum FitScreenCoordinatesStatus { NotSet = "not-set", Setting = "setting", Set = "set", Error = "error" } /** * Configuration options for screen coordinates fitting */ interface FitScreenCoordinatesProps { map: MaybeRef<Nullable<Map>>; /** Enable debug logging */ debug?: boolean; /** Automatically cleanup resources on unmount */ autoCleanup?: boolean; /** Default options for fitting screen coordinates */ defaultOptions?: Omit<FitBoundsOptions, 'bearing'>; /** Default bearing value */ defaultBearing?: number; } /** * Actions and state for screen coordinates fitting */ interface FitScreenCoordinatesActions { /** Fit the map to screen coordinates */ fitScreenCoordinates: (p0: PointLike, p1: PointLike, options?: Omit<FitBoundsOptions, 'bearing'>, bearing?: number) => void; /** Clear current screen coordinates */ clearCoordinates: () => void; /** Current status */ readonly status: Readonly<FitScreenCoordinatesStatus>; /** Computed state flags */ readonly isCoordinatesSet: boolean; readonly isFitting: boolean; readonly hasError: boolean; } /** * Composable for managing screen coordinates fitting with enhanced error handling * Provides reactive screen coordinates management with validation and debugging capabilities * * @param props - Configuration options for screen coordinates fitting * @returns Enhanced actions and state for screen coordinates management */ export declare function useFitScreenCoordinates(props: FitScreenCoordinatesProps): FitScreenCoordinatesActions; /** * Backward-compatible overload for existing API * @deprecated Use the props-based API for better type safety and features */ export declare function useFitScreenCoordinates(map: MaybeRef<Nullable<Map>>): FitScreenCoordinatesActions; export {}; //# sourceMappingURL=useFitScreenCoordinates.d.ts.map