vue3-maplibre-gl
Version:
Vue 3 components and composables for MapLibre GL JS - Build interactive maps with ease
80 lines (79 loc) • 2.77 kB
TypeScript
import { Nullable } from '../../types';
import { MaybeRef } from 'vue';
import { Map, AnimationOptions, PointLike, LngLatLike, CameraOptions } from 'maplibre-gl';
/**
* Pan animation status enum for better state management
*/
export declare enum PanStatus {
NotStarted = "not-started",
Panning = "panning",
Completed = "completed",
Error = "error"
}
interface PanByProps {
map: MaybeRef<Nullable<Map>>;
offset?: PointLike;
options?: AnimationOptions;
debug?: boolean;
autoPan?: boolean;
}
interface PanByActions {
panBy: (offset: PointLike, options?: AnimationOptions) => Promise<void>;
stopPanning: () => void;
getCurrentCamera: () => CameraOptions | null;
validatePanOffset: (offset: PointLike) => boolean;
panStatus: Readonly<PanStatus>;
isPanning: boolean;
panCount: number;
}
interface PanToProps {
map: MaybeRef<Nullable<Map>>;
lnglat?: LngLatLike;
options?: AnimationOptions;
debug?: boolean;
autoPan?: boolean;
}
interface PanToActions {
panTo: (lnglat: LngLatLike, options?: AnimationOptions) => Promise<void>;
stopPanning: () => void;
getCurrentCamera: () => CameraOptions | null;
validatePanTarget: (lnglat: LngLatLike) => boolean;
panStatus: Readonly<PanStatus>;
isPanning: boolean;
}
/**
* Composable for managing map panning by offset with enhanced error handling
* Provides reactive pan-by functionality with validation and debugging capabilities
*
* @param props - Configuration options for pan-by functionality
* @returns Enhanced actions and state for pan-by operations
*/
export declare function usePanBy(props: PanByProps): PanByActions;
/**
* Legacy overload for backward compatibility
* @deprecated Use the new props-based interface for better type safety and features
*/
export declare function usePanBy(map: MaybeRef<Nullable<Map>>, options?: AnimationOptions & {
offset: PointLike;
}): {
panBy: (offsetVal: PointLike, options?: AnimationOptions) => void;
};
/**
* Composable for managing map panning to coordinates with enhanced error handling
* Provides reactive pan-to functionality with validation and debugging capabilities
*
* @param props - Configuration options for pan-to functionality
* @returns Enhanced actions and state for pan-to operations
*/
export declare function usePanTo(props: PanToProps): PanToActions;
/**
* Legacy overload for backward compatibility
* @deprecated Use the new props-based interface for better type safety and features
*/
export declare function usePanTo(map: MaybeRef<Nullable<Map>>, options?: AnimationOptions & {
lnglat: LngLatLike;
}): {
panTo: (offsetVal: LngLatLike, options?: AnimationOptions) => void;
};
export {};
//# sourceMappingURL=usePan.d.ts.map