import maplibre, { MapOptions, StyleSpecification, ControlPosition, LineLayerSpecification, FillLayerSpecification, IControl, Map, StyleSwapOptions, StyleOptions, LayerSpecification, SourceSpecification, CustomLayerInterface, FilterSpecification, StyleSetterOptions } from 'maplibre-gl'; export { AttributionControl, Evented, FullscreenControl, GeolocateControl, LngLat, LngLatBounds, Marker, MercatorCoordinate, NavigationControl, Point, Popup, ScaleControl, Style } from 'maplibre-gl'; import MapboxDraw from 'maplibre-gl-draw'; /** * @fileoverview TypeScript type definitions for bkoi-gl-js * @description This file contains all TypeScript interfaces and types used throughout * the bkoi-gl-js library for type safety and better developer experience. * The types defined here extend MapLibre GL JS types with Barikoi-specific features * including drawing tools, style management, and authentication. */ /** * @interface BkoiMapOptions * @description Extended map options for bkoi-gl-js with Barikoi-specific features. * * This interface extends MapLibre GL's MapOptions while replacing 'style' and 'accessToken' * with Barikoi-specific alternatives and adding new features like polygon drawing and style management. * * @extends {Omit} */ interface BkoiMapOptions extends Omit { /** * Barikoi API access token for authentication with Barikoi services. * Required when using Barikoi map styles or features. * * @type {string} * @optional */ accessToken?: string; /** * Map style URL or Barikoi style identifier. * Can be a full Barikoi style URL or a style identifier that gets resolved to a full URL. * * @type {string} * @optional */ style?: string; /** * Enable polygon drawing tools using Mapbox GL Draw. * When true, initializes drawing controls for creating polygons, lines, and points. * * @type {boolean} * @optional * @default false */ polygon?: boolean; /** * Configuration options for Mapbox GL Draw when polygon drawing is enabled. * Allows customization of drawing controls, modes, and behavior. * * @type {Partial} * @optional */ drawOptions?: Partial; /** * Array of style configurations for the interactive style drawer. * Each style config defines a map style option that users can switch between. * * @type {StyleConfig[]} * @optional */ styles?: StyleConfig[]; /** * Enable and configure the minimap control. * When provided, creates a small overview map that syncs with the main map. * * @type {MinimapOptions} * @optional */ minimap?: MinimapOptions; } /** * @interface StyleConfig * @description Configuration for a single map style in the style drawer. * * Defines the properties needed to display and switch to a specific map style * in the interactive style selection UI. */ interface StyleConfig { /** * The map style URL or identifier. * Can be a full style URL or a style identifier that gets resolved. * * @type {string} */ style: string; /** * URL to a thumbnail image representing the style. * Used in the style drawer UI to visually represent each style option. * * @type {string} */ image: string; /** * Human-readable display name for the style. * Shown in the style drawer UI and tooltips. * * @type {string} */ name: string; } /** * @interface BkoiConfig * @description Global configuration object for bkoi-gl-js. * * Contains application-wide settings that can be modified at runtime. * Used internally by the library for managing authentication and defaults. */ interface BkoiConfig$1 { /** * Global Barikoi API access token. * Used as fallback when no accessToken is provided in map options. * * @type {string | null} * @default null */ ACCESS_TOKEN: string | null; /** * Default map style URL used when no style is specified. * Points to the standard Barikoi light style. * * @type {string} * @default 'https://map.barikoi.com/styles/barikoi-light/style.json' */ DEFAULT_STYLE: string; } /** * @interface ParentRectConfig * @description Configuration for the parent rectangle overlay on the minimap. * * Defines the visual styling of the rectangle that shows the parent map's viewport * boundaries on the minimap. The rectangle can have both a line (outline) and fill style. */ interface ParentRectConfig { /** * Layout properties for the line layer (outline of the parent rectangle). * Controls line visibility, cap style, join style, dash array, etc. * * @type {LineLayerSpecification["layout"]} * @optional * @example { 'visibility': 'visible' } */ lineLayout?: LineLayerSpecification['layout']; /** * Paint properties for the line layer (outline of the parent rectangle). * Controls line color, width, opacity, blur, etc. * * @type {LineLayerSpecification["paint"]} * @optional * @example { 'line-color': '#FFFFFF', 'line-width': 2, 'line-opacity': 0.8 } */ linePaint?: LineLayerSpecification['paint']; /** * Paint properties for the fill layer (interior of the parent rectangle). * Controls fill color, opacity, pattern, etc. * * @type {FillLayerSpecification["paint"]} * @optional * @example { 'fill-color': '#0088FF', 'fill-opacity': 0.2 } */ fillPaint?: FillLayerSpecification['paint']; } /** * The `MapInteractions` type is a union of the possible interactions that can be * disabled/enabled on the minimap. */ type MapInteractions = 'dragPan' | 'scrollZoom' | 'boxZoom' | 'dragRotate' | 'keyboard' | 'doubleClickZoom' | 'touchZoomRotate'; /** * Configuration for minimap interactions. * Each property controls whether the interaction is enabled (true) or disabled (false). */ type MinimapInteractions = Record; /** * @interface ToggleButtonConfig * @description Configuration for customizing the minimap toggle button appearance. * * Allows users to customize the default toggle button with their own icon, CSS classes, * inline styles, hover colors, rotation behavior, and icon background color. * The button maintains its default behavior (minimizing/maximizing the minimap) * while having a custom appearance. * * If not provided, a default button with standard styling is used. * * @example * ```typescript * const minimap = new Minimap({ * toggleButton: { * icon: '', * className: 'my-custom-toggle-button', * style: { * background: 'linear-gradient(to right, #667eea 0%, #764ba2 100%)', * color: 'white', * border: 'none', * borderRadius: '4px' * }, * iconBackgroundColor: 'black', * hoverColor: '#FF5722', * enableRotation: true, * rotationAngle: 45 * } * }) * ``` */ interface ToggleButtonConfig { /** * Custom SVG icon for the toggle button. * Should be a valid SVG string. The icon will rotate on toggle. * * @type {string} * @optional * @example '' */ icon?: string; /** * Custom CSS class name(s) to add to the toggle button. * Multiple classes should be space-separated. * * @type {string} * @optional * @example 'my-custom-toggle-button active' */ className?: string; /** * Custom inline styles to apply to the toggle button. * These styles will override the default button styles. * * @type {Record} * @optional * @example { background: 'red', color: 'white', border: 'none' } */ style?: Record; /** * Background color of the toggle button icon. * Default is 'black'. * * @type {string} * @optional * @default 'black' * @example '#FF0000' or 'rgb(255, 0, 0)' or 'black' */ iconBackgroundColor?: string; /** * Hover color for the toggle button. * Controls the background color when hovering over the button. * Default is '#e5e7e3'. * * @type {string} * @optional * @default '#e5e7e3' * @example '#FF5722' or 'rgb(255, 87, 34)' or 'lightblue' */ hoverColor?: string; /** * Whether to enable rotation of the button icon based on position. * When true, the button rotates according to its position (top-right, bottom-left, etc.). * When false, the button maintains its default orientation. * * @type {boolean} * @optional * @default true */ enableRotation?: boolean; /** * Custom rotation angle in degrees. * Overrides the default position-based rotation when set. * * @type {number} * @optional * @example 45 (for 45 degrees) or -90 (for -90 degrees) */ rotationAngle?: number; } /** * @interface MinimapOptions * @description Configuration options for the Minimap control. * * The minimap creates a small overview map that syncs with the parent map's position, * showing the current viewport in a larger geographic context. It supports custom * styles, zoom levels, toggle button, interactions control, and an optional parent rectangle overlay. * * @example * ```typescript * const map = new Map({ * container: 'map', * accessToken: 'your-key', * minimap: { * style: 'https://map.barikoi.com/styles/barikoi-dark/style.json', * zoomAdjust: -4, * position: 'bottom-right', * toggleable: true, * toggleButton: { * icon: '...', * className: 'my-custom-button', * style: { background: 'red' } * }, * initialMinimized: false, * interactions: { * dragPan: false, * scrollZoom: false, * boxZoom: false, * dragRotate: false, * keyboard: false, * doubleClickZoom: false, * touchZoomRotate: false, * }, * parentRect: { * linePaint: { 'line-color': '#FFF', 'line-width': 2 }, * fillPaint: { 'fill-color': '#0088FF', 'fill-opacity': 0.15 } * } * } * }) * ``` */ interface MinimapOptions { /** * Initial center coordinates [lng, lat] for the minimap. * If not provided, the minimap syncs with the parent map's center on load. * * @type {[number, number]} * @optional */ center?: [number, number]; /** * Barikoi API access token for authentication. * Required when using Barikoi map styles. * * @type {string} * @optional */ accessToken?: string; /** * Map style for the minimap. * Can be: * - A full style URL (e.g., 'https://map.barikoi.com/styles/barikoi-dark/style.json?key=xxx') * - A style specification object * * If not provided, the minimap will use the same style as the parent map. * * @type {string | StyleSpecification} * @optional */ style?: string | StyleSpecification; /** * Zoom level difference between the parent and minimap. * * Positive value: minimap is zoomed out more than parent * Negative value: minimap is zoomed in more than parent * * For example, if parent is at zoom 10 and zoomAdjust is -4: * - Minimap will be at zoom 6 * * @type {number} * @optional * @default -4 */ zoomAdjust?: number; /** * Lock the minimap to a specific zoom level. * When set, the minimap's zoom will not change based on the parent map. * * @type {number} * @optional * @example 8 */ lockZoom?: number; /** * Whether to sync the pitch (tilt) with the parent map. * * - true: Minimap pitch matches parent map pitch * - false: Minimap always stays flat (pitch: 0) * * @type {boolean} * @optional * @default false */ pitchAdjust?: boolean; /** * Custom CSS properties for the minimap container. * Allows customization of size, border, margin, etc. * * @type {Record} * @optional * @example { width: '320px', height: '240px', border: '2px solid #333' } */ containerStyle?: Record; /** * Position of the minimap control on the map. * * @type {ControlPosition} * @optional * @default 'top-right' */ position?: ControlPosition; /** * Configuration for the parent rectangle overlay. * Shows the parent map's viewport boundaries on the minimap. * * @type {ParentRectConfig} * @optional */ parentRect?: ParentRectConfig; /** * Whether the minimap can be toggled (minimized/maximized) via a button. * * @type {boolean} * @optional * @default true */ toggleable?: boolean; /** * Custom toggle button configuration. * Allows customization of the button's appearance while maintaining default behavior. * * @type {ToggleButtonConfig} * @optional */ toggleButton?: ToggleButtonConfig; /** * Whether the minimap should start in a minimized state. * Only applies when toggleable is true. * * @type {boolean} * @optional * @default false */ initialMinimized?: boolean; /** * Width of the minimap when minimized. * * @type {string} * @optional * @default '29px' */ collapsedWidth?: string; /** * Height of the minimap when minimized. * * @type {string} * @optional * @default '29px' */ collapsedHeight?: string; /** * Border radius of the minimap container. * * @type {string} * @optional * @default '3px' */ borderRadius?: string; /** * Minimap interactions configuration. * Controls which map interactions are enabled/disabled on the minimap. * By default, all interactions are disabled for a cleaner overview experience. * * @type {MinimapInteractions} * @optional * @default { dragPan: false, scrollZoom: false, boxZoom: false, dragRotate: false, keyboard: false, doubleClickZoom: false, touchZoomRotate: false } */ interactions?: Partial; /** * Callback invoked when the minimap is toggled (minimized or expanded). * Use this to sync external state (e.g. React) with the minimap state. * * @type {(isMinimized: boolean) => void} * @optional */ onToggle?: (isMinimized: boolean) => void; /** * Text to show on the toggle button when minimap is expanded (tooltip). * * @type {string} * @optional * @default 'Hide minimap' */ hideText?: string; /** * Text to show on the toggle button when minimap is minimized (tooltip). * * @type {string} * @optional * @default 'Show minimap' */ showText?: string; /** * Enable responsive sizing based on window dimensions. * When true, the minimap will resize dynamically when the window is resized. * * @type {boolean} * @optional * @default true */ responsive?: boolean; /** * Responsive width as a CSS value (e.g., '20vw', '30%', '300px'). * Only applies when responsive is true. * * @type {string} * @optional * @default '20vw' */ responsiveWidth?: string; /** * Responsive height as a CSS value (e.g., '20vh', '30%', '200px'). * Only applies when responsive is true. * * @type {string} * @optional * @default '20vh' */ responsiveHeight?: string; /** * Minimum width constraint for responsive sizing. * * @type {string} * @optional * @default '200px' */ minWidth?: string; /** * Minimum height constraint for responsive sizing. * * @type {string} * @optional * @default '150px' */ minHeight?: string; /** * Maximum width constraint for responsive sizing. * * @type {string} * @optional * @default '400px' */ maxWidth?: string; /** * Maximum height constraint for responsive sizing. * * @type {string} * @optional * @default '300px' */ maxHeight?: string; } /** * @fileoverview Minimap Control for bkoi-gl-js * @description This file implements the Minimap control that creates a small overview map * which syncs with the parent map's position and displays the parent's viewport boundaries. * * Features: * - Bidirectional movement sync between parent and minimap * - Optional parent rectangle overlay showing viewport boundaries * - Automatic style inheritance from parent map (if no style provided) * - Custom styles, zoom levels, and positioning * - Toggle button to minimize/maximize the minimap * - Configurable interactions control * - Full API access for style and layer manipulation * - Automatic cleanup on removal */ /** * @class Minimap * @description A control that adds a small overview map to the main map. * * The minimap provides geographic context by showing the surrounding area * at a different zoom level. It syncs bidirectionally with the parent map, * can display a rectangle showing the parent map's current viewport, and * can be toggled (minimized/maximized) via a button. * * If no style is provided, the minimap will automatically use the parent map's style. * * @implements {IControl} * @example * // Using parent map's style (automatic) * const minimap = new Minimap({ * zoomAdjust: -4, * position: 'bottom-right', * }) * map.addControl(minimap) * * @example * // Using custom style * const minimap = new Minimap({ * style: 'https://map.barikoi.com/styles/barikoi-dark/style.json', * zoomAdjust: -4, * position: 'bottom-right', * toggleable: true, * initialMinimized: false, * interactions: { * dragPan: false, * scrollZoom: false, * boxZoom: false, * dragRotate: false, * keyboard: false, * doubleClickZoom: false, * touchZoomRotate: false, * }, * parentRect: { * linePaint: { 'line-color': '#FFF', 'line-width': 2 }, * fillPaint: { 'fill-color': '#0088FF', 'fill-opacity': 0.15 } * } * }) * map.addControl(minimap) */ declare class Minimap implements IControl { #private; /** The minimap instance */ map: Map; /** * @constructor * @description Creates a new Minimap instance. * * @param {MinimapOptions} options - Configuration options for the minimap */ constructor(options?: MinimapOptions); /** * @method onAdd * @description Called when the control is added to the map. * * Creates the minimap container, initializes the map instance, sets up * the toggle button (if enabled), configures interactions, sets up * the parent rectangle overlay (if configured), and establishes the * bidirectional sync between parent and minimap. * * @param {MapLibreMap} parentMap - The parent map instance * @returns {HTMLElement} The control container element */ onAdd(parentMap: Map): HTMLElement; /** * @method onRemove * @description Called when the control is removed from the map. * * Cleans up by stopping the sync, removing the toggle button, and removing the DOM elements. * * @returns {void} */ onRemove(): void; /** * @method toggle * @description Toggles the minimap between minimized and maximized states. * * When minimized, the minimap shrinks to a small size and stops syncing. * When maximized, it returns to full size and resumes syncing. * * @returns {void} */ toggle(): void; /** * @method isMinimized * @description Returns whether the minimap is currently in a minimized state. * * @returns {boolean} true if minimap is minimized, false otherwise */ isMinimized(): boolean; /** * @method setStyle * @description Sets the style of the minimap. * * Only updates the minimap if it has a custom style (different from parent). * After style change, updates the parent rectangle if present. * * @param {string | StyleSpecification | null} style - The new style * @param {StyleSwapOptions & StyleOptions} options - Style options * @returns {void} */ setStyle(style: null | string | StyleSpecification, options?: StyleSwapOptions & StyleOptions): void; /** * @method addLayer * @description Adds a layer to the minimap. * * Only adds the layer if minimap has a custom style (different from parent). * Updates the parent rectangle after adding. * * @param {LayerSpecification | CustomLayerInterface} layer - The layer to add * @param {string} beforeId - Insert layer before this ID * @returns {MapLibreMap} The minimap instance */ addLayer(layer: (LayerSpecification & { source?: string | SourceSpecification; }) | CustomLayerInterface, beforeId?: string): Map; /** * @method moveLayer * @description Moves a layer in the minimap's layer stack. * * Only moves the layer if minimap has a custom style (different from parent). * Updates the parent rectangle after moving. * * @param {string} id - The layer ID * @param {string} beforeId - Insert layer before this ID * @returns {MapLibreMap} The minimap instance */ moveLayer(id: string, beforeId?: string): Map; /** * @method removeLayer * @description Removes a layer from the minimap. * * Only removes the layer if minimap has a custom style (different from parent). * Updates the parent rectangle after removing. * * @param {string} id - The layer ID to remove * @returns {this} The minimap instance */ removeLayer(id: string): this; /** * @method setLayerZoomRange * @description Sets the zoom range for a layer. * * Only sets the range if minimap has a custom style (different from parent). * Updates the parent rectangle after setting. * * @param {string} layerId - The layer ID * @param {number} minzoom - Minimum zoom level * @param {number} maxzoom - Maximum zoom level * @returns {this} The minimap instance */ setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this; /** * @method setFilter * @description Sets the filter for a layer. * * Only sets the filter if minimap has a custom style (different from parent). * Updates the parent rectangle after setting. * * @param {string} layerId - The layer ID * @param {FilterSpecification | null} filter - The filter specification * @param {StyleSetterOptions} options - Style setter options * @returns {this} The minimap instance */ setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this; /** * @method setPaintProperty * @description Sets a paint property for a layer. * * Only sets the property if minimap has a custom style (different from parent). * Updates the parent rectangle after setting. * * @param {string} layerId - The layer ID * @param {string} name - The property name * @param {any} value - The property value * @param {StyleSetterOptions} options - Style setter options * @returns {this} The minimap instance */ setPaintProperty(layerId: string, name: string, value: unknown, options?: StyleSetterOptions): this; /** * @method setLayoutProperty * @description Sets a layout property for a layer. * * Only sets the property if minimap has a custom style (different from parent). * Updates the parent rectangle after setting. * * @param {string} layerId - The layer ID * @param {string} name - The property name * @param {any} value - The property value * @param {StyleSetterOptions} options - Style setter options * @returns {this} The minimap instance */ setLayoutProperty(layerId: string, name: string, value: unknown, options?: StyleSetterOptions): this; /** * @method setGlyphs * @description Sets the glyph URL for the map. * * Only sets the glyphs if minimap has a custom style (different from parent). * Updates the parent rectangle after setting. * * @param {string | null} glyphsUrl - The glyphs URL * @param {StyleSetterOptions} options - Style setter options * @returns {this} The minimap instance */ setGlyphs(glyphsUrl: string | null, options?: StyleSetterOptions): this; } /** * @fileoverview Configuration management for bkoi-gl-js * @description This file provides global configuration settings for the bkoi-gl-js library, * including API access tokens and default style URLs. It serves as a centralized * configuration store that can be modified at runtime. * The configuration is used throughout the library for: * - Barikoi API authentication * - Default map style selection * - Fallback values when options aren't provided */ /** * @interface BkoiConfig * @description Interface defining the structure of the global bkoi-gl-js configuration. * * This interface specifies the available configuration properties that can be * modified globally to affect library behavior across all map instances. */ interface BkoiConfig { /** * Global Barikoi API access token for authentication. * * This token is used as a fallback when no `accessToken` is provided * in individual map options. It's recommended to set this globally * for applications using Barikoi services. * * @type {string | null} * @default null */ ACCESS_TOKEN: string | null; /** * Default map style URL used when no style is specified. * * This is the fallback style that gets loaded when a map is created * without explicit style configuration. Points to the standard * Barikoi light style which provides good readability and features. * * @type {string} * @default 'https://map.barikoi.com/styles/barikoi-light/style.json' */ DEFAULT_STYLE: string; } /** * @const {BkoiConfig} bkoiConfig * @description Global configuration object for bkoi-gl-js. * * This is the main configuration instance that can be imported and modified * to set global defaults for the library. Changes to this object affect * all map instances created afterward. */ declare const bkoiConfig: BkoiConfig; /** * @fileoverview Constants for bkoi-gl-js * @description Default values used across the library for maps and controls. */ /** * Default map center coordinates (Dhaka, Bangladesh). * Used when no center is specified or as a fallback for minimap initial positioning. * * @type {[number, number]} */ declare const DEFAULT_CENTER: [number, number]; /** * @fileoverview Style validation utilities for bkoi-gl-js * @description This file contains utility functions for validating Barikoi-specific * map styles and URLs. It provides type-safe validation for style URLs and * ensures compatibility with Barikoi mapping services. * The validation functions are used internally by the library to: * - Determine if a style requires Barikoi authentication * - Validate style URL formats * - Provide fallback behavior for invalid styles */ /** * @function isBarikoiStyle * @description Checks if a given style URL or identifier is a Barikoi map style. * * This function validates whether a style string represents a Barikoi-hosted map style * by checking for Barikoi domain patterns and proper URL structure. It's used internally * to determine authentication requirements and style handling behavior. * * @param {string | null | undefined} style - The style URL or identifier to validate * * @returns {boolean} True if the style is a valid Barikoi style URL, false otherwise */ declare function isBarikoiStyle(style: string | null | undefined): boolean; /** * @fileoverview bkoi-gl-js Main Library Entry Point * @description This file implements the core bkoi-gl-js library, providing a MapLibre GL JS wrapper * with Barikoi-specific enhancements including drawing tools, style management, and authentication. * The library extends MapLibre GL JS with: * - Barikoi API integration and authentication * - Interactive polygon/line/point drawing tools * - Dynamic style switching with UI drawer * - Automatic attribution and branding * - TypeScript support with comprehensive type definitions */ declare const setRTLTextPlugin: typeof maplibre.setRTLTextPlugin; declare const getRTLTextPluginStatus: typeof maplibre.getRTLTextPluginStatus; declare const prewarm: typeof maplibre.prewarm; declare const clearPrewarmedResources: typeof maplibre.clearPrewarmedResources; /** * @class BkoiGlMap * @description Extended MapLibre GL Map class with Barikoi integration. * * This class extends the base MapLibre GL Map with Barikoi-specific features: * - Automatic API authentication for Barikoi styles * - Interactive drawing tools using Mapbox GL Draw * - Style switching drawer with thumbnail previews * - Barikoi branding and attribution * * @extends {Map} */ declare class BkoiGlMap extends Map { /** * @private * @description Reference to the MapboxDraw instance when drawing tools are enabled. * This property is undefined when polygon drawing is not activated. */ private draw?; /** * @constructor * @description Creates a new BkoiGlMap instance with Barikoi integration. * * Initializes a MapLibre GL map with Barikoi-specific features including: * - Automatic authentication for Barikoi styles * - Optional drawing tools initialization * - Style drawer setup * - Barikoi branding and attribution * * @param {BkoiMapOptions} mapOptions - Configuration options for the map * * @throws {Error} When Barikoi API access token is required but not provided */ constructor(mapOptions: BkoiMapOptions); /** * @private * @method setupAttributionControl * @description Initializes the attribution control with custom Barikoi attribution. * * Sets up a MapLibre GL attribution control with compact styling and prepares * it for custom Barikoi attribution content that gets injected after map load. * The attribution control is positioned at bottom-right. * * @returns {void} */ private setupAttributionControl; /** * @private * @method addBarikoiAttribution * @description Adds the Barikoi logo control to the map. * * Creates and adds a custom control displaying the Barikoi logo that links * to the Barikoi website. The logo is positioned at bottom-left and uses * CSS styling defined in index.css. * * @returns {void} */ private addBarikoiAttribution; /** * @private * @method initializeDraw * @description Initializes the MapboxDraw drawing tools for the map. * * Creates a new MapboxDraw instance with default options optimized for polygon drawing, * merges in any custom options provided, and adds the drawing controls to the map. * By default, only polygon and trash controls are enabled for simplicity. * * Also sets up event listeners to reset cursor after drawing events to prevent * cursor sticking issues. * * @param {Partial} drawOptions - Custom options to merge with defaults * * @returns {void} */ private initializeDraw; /** * @private * @method initializeStyleDrawer * @description Creates and initializes the interactive style drawer UI. * * Builds a collapsible drawer containing style selection options with thumbnails. * Each style is represented by an image thumbnail that shows the style name on hover * and allows switching to that style when clicked. The drawer includes a toggle * button to show/hide the style options. * * @param {StyleConfig[]} styles - Array of style configurations to display in the drawer * * @returns {void} */ private initializeStyleDrawer; /** * @private * @method createStyleItem * @description Creates a single style selection item for the style drawer. * * Builds an interactive DOM element representing one map style option. * The item includes a thumbnail image with hover effects that reveal the style name, * and clicking the item switches the map to that style. * * @param {string} style - The style URL or identifier * @param {string} image - URL of the thumbnail image for the style * @param {string} name - Human-readable name of the style * * @returns {HTMLDivElement} The created style item DOM element */ private createStyleItem; /** * @method getDraw * @description Retrieves the MapboxDraw instance if drawing tools are enabled. * * Returns the MapboxDraw instance that was initialized when the `polygon` option * was set to true in the map constructor. This allows access to the full * MapboxDraw API for programmatic drawing operations. * * @returns {MapboxDraw | undefined} The MapboxDraw instance if drawing tools are enabled, undefined otherwise */ getDraw(): MapboxDraw | undefined; /** * @private * @method initializeMinimap * @description Initializes the minimap control. * * Creates a Minimap control instance with the provided options and adds it * to the map at the specified position. The minimap provides a small overview * map that syncs with the parent map's position. * * @param {MinimapOptions} options - Configuration options for the minimap * @returns {void} */ private initializeMinimap; } /** * @description Default export providing all MapLibre GL JS features plus Barikoi extensions. * * This export includes everything from MapLibre GL JS plus additional Barikoi-specific * features and a convenient accessToken getter/setter. * * @property {BkoiGlMap} Map - The enhanced map class with Barikoi integration * @property {string | null} accessToken - Global Barikoi API token getter/setter * @property {string} workerUrl - MapLibre worker URL (usually empty string) * @property {Function} setRTLTextPlugin - MapLibre RTL text plugin setter * @property {Function} getRTLTextPluginStatus - MapLibre RTL text plugin status getter * @property {Function} prewarm - MapLibre resource prewarming function * @property {Function} clearPrewarmedResources - MapLibre resource cleanup function * @property {typeof NavigationControl} NavigationControl - MapLibre navigation control * @property {typeof GeolocateControl} GeolocateControl - MapLibre geolocation control * @property {typeof AttributionControl} AttributionControl - MapLibre attribution control * @property {typeof ScaleControl} ScaleControl - MapLibre scale control * @property {typeof FullscreenControl} FullscreenControl - MapLibre fullscreen control * @property {typeof Popup} Popup - MapLibre popup class * @property {typeof Marker} Marker - MapLibre marker class * @property {typeof Style} Style - MapLibre style utilities * @property {typeof LngLat} LngLat - MapLibre coordinate class * @property {typeof LngLatBounds} LngLatBounds - MapLibre bounds class * @property {typeof Point} Point - MapLibre point utilities * @property {typeof MercatorCoordinate} MercatorCoordinate - MapLibre projection utilities * @property {typeof Evented} Evented - MapLibre event system base class */ declare const exported: { setRTLTextPlugin: typeof maplibre.setRTLTextPlugin; getRTLTextPluginStatus: typeof maplibre.getRTLTextPluginStatus; Map: typeof BkoiGlMap; NavigationControl: typeof maplibre.NavigationControl; GeolocateControl: typeof maplibre.GeolocateControl; AttributionControl: typeof maplibre.AttributionControl; ScaleControl: typeof maplibre.ScaleControl; FullscreenControl: typeof maplibre.FullscreenControl; Popup: typeof maplibre.Popup; Marker: typeof maplibre.Marker; Style: typeof maplibre.Style; LngLat: typeof maplibre.LngLat; LngLatBounds: typeof maplibre.LngLatBounds; Point: typeof maplibre.Point; MercatorCoordinate: typeof maplibre.MercatorCoordinate; Evented: typeof maplibre.Evented; prewarm: typeof maplibre.prewarm; clearPrewarmedResources: typeof maplibre.clearPrewarmedResources; Minimap: typeof Minimap; /** * @description Global Barikoi API access token getter/setter. * * Provides convenient access to set the global Barikoi API token that will be used * by all map instances that don't have their own accessToken specified. * * @type {string | null} */ accessToken: string | null; /** * @description MapLibre GL JS worker URL. * Usually left as empty string for default behavior. * @type {string} */ workerUrl: string; }; export { BkoiGlMap, DEFAULT_CENTER, BkoiGlMap as Map, Minimap, bkoiConfig, clearPrewarmedResources, exported as default, getRTLTextPluginStatus, isBarikoiStyle, prewarm, setRTLTextPlugin }; export type { BkoiConfig$1 as BkoiConfig, BkoiMapOptions, MapInteractions, MinimapInteractions, MinimapOptions, ParentRectConfig, StyleConfig, ToggleButtonConfig };