UNPKG

vue3-maplibre-gl

Version:

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

41 lines (40 loc) 1.8 kB
import { ComputedRef } from 'vue'; import { Map, MapOptions } from 'maplibre-gl'; import { MapCreationStatus } from '../../enums'; import { MaplibreActions, MaplibreMethods } from '../../types'; interface UseMapboxOptions { /** Enable debug logging */ debug?: boolean; /** Automatically cleanup resources on unmount */ autoCleanup?: boolean; } interface UseMapboxReturn extends Omit<MaplibreMethods, 'mapCreationStatus' | 'isMapReady' | 'isMapLoading' | 'hasMapError' | 'mapInstance'> { /** Reactive map instance reference */ readonly mapInstance: ComputedRef<Map | null>; /** Current map creation status */ readonly mapStatus: ComputedRef<MapCreationStatus>; /** Whether the map is ready for operations */ readonly isMapReady: ComputedRef<boolean>; /** Whether the map is currently loading */ readonly isMapLoading: ComputedRef<boolean>; /** Whether the map has encountered an error */ readonly hasMapError: ComputedRef<boolean>; /** Whether a map instance is registered and ready */ readonly isRegistered: ComputedRef<boolean>; /** Register a MapLibre actions instance */ register: (instance: MaplibreActions) => Promise<void>; /** Set map options on the registered instance */ setMapOptions: (options: Partial<MapOptions>) => void; } /** * Composable for managing MapLibre GL Map instances * * Provides reactive state management and a clean API for interacting with MapLibre GL maps. * Handles registration, lifecycle management, and provides reactive access to map state. * * @param options - Configuration options for the composable * @returns Reactive map management interface */ export declare function useMapbox(options?: UseMapboxOptions): UseMapboxReturn; export {}; //# sourceMappingURL=useMapbox.d.ts.map