vue3-maplibre-gl
Version:
Vue 3 components and composables for MapLibre GL JS - Build interactive maps with ease
120 lines (119 loc) • 4.36 kB
TypeScript
import { Nullable } from '../../types';
import { MaybeRef } from 'vue';
import { Map, AnimationOptions, CameraOptions } from 'maplibre-gl';
/**
* Rotation animation status enum for better state management
*/
export declare enum RotationStatus {
NotStarted = "not-started",
Rotating = "rotating",
Completed = "completed",
Error = "error"
}
interface RotateToProps {
map: MaybeRef<Nullable<Map>>;
bearing?: number;
options?: AnimationOptions;
debug?: boolean;
autoRotate?: boolean;
}
interface RotateToActions {
rotateTo: (bearing: number, options?: AnimationOptions) => Promise<void>;
stopRotating: () => void;
getCurrentBearing: () => number | null;
getCurrentCamera: () => CameraOptions | null;
validateBearing: (bearing: number) => boolean;
rotationStatus: Readonly<RotationStatus>;
isRotating: boolean;
}
interface ResetNorthProps {
map: MaybeRef<Nullable<Map>>;
options?: AnimationOptions;
debug?: boolean;
autoReset?: boolean;
}
interface ResetNorthActions {
resetNorth: (options?: AnimationOptions) => Promise<void>;
stopRotating: () => void;
getCurrentBearing: () => number | null;
getCurrentCamera: () => CameraOptions | null;
rotationStatus: Readonly<RotationStatus>;
isRotating: boolean;
}
interface ResetNorthPitchProps {
map: MaybeRef<Nullable<Map>>;
options?: AnimationOptions;
debug?: boolean;
autoReset?: boolean;
}
interface ResetNorthPitchActions {
resetNorthPitch: (options?: AnimationOptions) => Promise<void>;
stopRotating: () => void;
getCurrentBearing: () => number | null;
getCurrentPitch: () => number | null;
getCurrentCamera: () => CameraOptions | null;
rotationStatus: Readonly<RotationStatus>;
isRotating: boolean;
}
interface SnapToNorthProps {
map: MaybeRef<Nullable<Map>>;
options?: AnimationOptions;
debug?: boolean;
autoSnap?: boolean;
}
interface SnapToNorthActions {
snapToNorth: (options?: AnimationOptions) => Promise<void>;
stopRotating: () => void;
getCurrentBearing: () => number | null;
getCurrentCamera: () => CameraOptions | null;
rotationStatus: Readonly<RotationStatus>;
isRotating: boolean;
}
/**
* Composable for managing map rotation-to operations with enhanced error handling
* Provides reactive rotation-to functionality with validation and debugging capabilities
*
* @param props - Configuration options for rotation-to functionality
* @returns Enhanced actions and state for rotation-to operations
*/
export declare function useRotateTo(props: RotateToProps): RotateToActions;
/**
* Legacy overload for backward compatibility
* @deprecated Use the new props-based interface for better type safety and features
*/
export declare function useRotateTo(map: MaybeRef<Nullable<Map>>, options?: AnimationOptions & {
bearing: number;
}): {
rotateTo: (bearingVal: number, options?: AnimationOptions) => void;
};
/**
* Composable for managing map reset-north operations with enhanced error handling
* Provides reactive reset-north functionality with validation and debugging capabilities
*
* @param props - Configuration options for reset-north functionality
* @returns Enhanced actions and state for reset-north operations
*/
export declare function useResetNorth(props: ResetNorthProps): ResetNorthActions;
/**
* Legacy overload for backward compatibility
* @deprecated Use the new props-based interface for better type safety and features
*/
export declare function useResetNorth(map: MaybeRef<Nullable<Map>>, options?: AnimationOptions): {
resetNorth: (options?: AnimationOptions) => void;
};
/**
* Enhanced useResetNorthPitch with error handling and debugging
*/
export declare function useResetNorthPitch(props: ResetNorthPitchProps): ResetNorthPitchActions;
export declare function useResetNorthPitch(map: MaybeRef<Nullable<Map>>, options?: AnimationOptions): {
resetNorthPitch: (options?: AnimationOptions) => void;
};
/**
* Enhanced useSnapToNorth with error handling and debugging
*/
export declare function useSnapToNorth(props: SnapToNorthProps): SnapToNorthActions;
export declare function useSnapToNorth(map: MaybeRef<Nullable<Map>>, options?: AnimationOptions): {
snapToNorth: (options?: AnimationOptions) => void;
};
export {};
//# sourceMappingURL=useRotate.d.ts.map