vue3-maplibre-gl
Version:
Vue 3 components and composables for MapLibre GL JS - Build interactive maps with ease
59 lines (58 loc) • 2.11 kB
TypeScript
import { Nullable } from '../../types';
import { MaybeRef } from 'vue';
import { Map, LngLatBoundsLike, FitBoundsOptions, CameraForBoundsOptions, LngLatBounds } from 'maplibre-gl';
/**
* Bounds operation status enum for better state management
*/
export declare enum BoundsStatus {
NotSet = "not-set",
Setting = "setting",
Set = "set",
Error = "error"
}
interface FitBoundsProps {
map: MaybeRef<Nullable<Map>>;
options?: FitBoundsOptions;
debug?: boolean;
}
interface FitBoundsActions {
setFitBounds: (boundsVal: LngLatBoundsLike, options?: FitBoundsOptions) => void;
clearBounds: () => void;
getCurrentBounds: () => LngLatBounds | null;
bounds: LngLatBoundsLike | undefined;
boundsStatus: Readonly<BoundsStatus>;
isBoundsSet: boolean;
}
interface CameraForBoundsProps {
map: MaybeRef<Nullable<Map>>;
options?: CameraForBoundsOptions & {
bounds?: LngLatBoundsLike;
};
debug?: boolean;
}
interface CameraForBoundsActions {
cameraForBounds: (boundsVal: LngLatBoundsLike, options?: CameraForBoundsOptions) => void;
clearCamera: () => void;
getCurrentBounds: () => LngLatBounds | null;
bbox: LngLatBoundsLike | undefined;
cameraStatus: Readonly<BoundsStatus>;
isCameraSet: boolean;
}
/**
* Composable for managing map bounds fitting with enhanced error handling and performance
* Provides reactive bounds management with validation and debugging capabilities
*
* @param props - Configuration options for bounds fitting
* @returns Enhanced actions and state for bounds management
*/
export declare function useFitBounds(props: FitBoundsProps): FitBoundsActions;
/**
* Composable for managing camera positioning for bounds with enhanced error handling
* Provides reactive camera management with validation and debugging capabilities
*
* @param props - Configuration options for camera bounds
* @returns Enhanced actions and state for camera management
*/
export declare function useCameraForBounds(props: CameraForBoundsProps): CameraForBoundsActions;
export {};
//# sourceMappingURL=useBounds.d.ts.map