vue3-maplibre-gl
Version:
Vue 3 components and composables for MapLibre GL JS - Build interactive maps with ease
55 lines (54 loc) • 3.05 kB
TypeScript
import { CreateLayerActions, Nullable, SymbolLayerStyle } from '../../types';
import { MaybeRef } from 'vue';
import { Map, SourceSpecification, FilterSpecification, SymbolLayerSpecification, StyleSetterOptions } from 'maplibre-gl';
type Layer = SymbolLayerSpecification;
interface CreateSymbolLayerProps {
map: MaybeRef<Nullable<Map>>;
source: MaybeRef<string | SourceSpecification | object | null>;
id?: string;
beforeId?: string;
filter?: FilterSpecification;
style?: SymbolLayerStyle;
maxzoom?: number;
minzoom?: number;
metadata?: object;
sourceLayer?: string;
debug?: boolean;
register?: (actions: CreateLayerActions<Layer>, map: Map) => void;
}
interface SymbolLayerActions extends CreateLayerActions<Layer> {
setStyle: (styleVal?: SymbolLayerStyle) => void;
setIconOpacity: (opacity: number, options?: StyleSetterOptions) => void;
setIconColor: (color: string, options?: StyleSetterOptions) => void;
setIconHaloColor: (color: string, options?: StyleSetterOptions) => void;
setIconHaloWidth: (width: number, options?: StyleSetterOptions) => void;
setIconHaloBlur: (blur: number, options?: StyleSetterOptions) => void;
setIconImage: (image: string, options?: StyleSetterOptions) => void;
setIconSize: (size: number | string, options?: StyleSetterOptions) => void;
setIconRotate: (rotation: number, options?: StyleSetterOptions) => void;
setIconOffset: (offset: [number, number], options?: StyleSetterOptions) => void;
setIconAnchor: (anchor: string, options?: StyleSetterOptions) => void;
setTextOpacity: (opacity: number, options?: StyleSetterOptions) => void;
setTextColor: (color: string, options?: StyleSetterOptions) => void;
setTextHaloColor: (color: string, options?: StyleSetterOptions) => void;
setTextHaloWidth: (width: number, options?: StyleSetterOptions) => void;
setTextHaloBlur: (blur: number, options?: StyleSetterOptions) => void;
setTextField: (field: string, options?: StyleSetterOptions) => void;
setTextFont: (font: string[], options?: StyleSetterOptions) => void;
setTextSize: (size: number | string, options?: StyleSetterOptions) => void;
setTextRotate: (rotation: number, options?: StyleSetterOptions) => void;
setTextOffset: (offset: [number, number], options?: StyleSetterOptions) => void;
setTextAnchor: (anchor: string, options?: StyleSetterOptions) => void;
setVisibility: (visibility: 'visible' | 'none', options?: StyleSetterOptions) => void;
setSortKey: (sortKey: number, options?: StyleSetterOptions) => void;
}
/**
* Composable for creating and managing MapLibre GL Symbol Layers
* Provides reactive symbol layer with error handling, performance optimizations, and enhanced API
*
* @param props - Configuration options for the symbol layer
* @returns Enhanced actions and state for the symbol layer
*/
export declare function useCreateSymbolLayer(props: CreateSymbolLayerProps): SymbolLayerActions;
export {};
//# sourceMappingURL=useCreateSymbolLayer.d.ts.map