@geoql/v-maplibre 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["$slots","VMap"],"sources":["../src/utils/injects.ts","../src/layers/deckgl/_shared/useDeckOverlay.ts","../src/utils/symbols.ts","../src/controls/attribution/VControlAttribution.vue","../src/controls/fullscreen/VControlFullscreen.vue","../src/controls/geolocate/events.ts","../src/controls/geolocate/VControlGeolocate.vue","../src/controls/navigation/VControlNavigation.vue","../src/controls/scale/VControlScale.vue","../src/controls/lidar/events.ts","../src/controls/lidar/VControlLidar.vue","../src/controls/_shared/useMapControl.ts","../src/controls/layer/VControlLayer.vue","../src/controls/layer/VControlLayerGroup.vue","../src/controls/legend/VControlLegend.vue","../src/layers/maplibre/canvas/VLayerMaplibreCanvas.vue","../src/layers/maplibre/geojson/VLayerMaplibreGeojson.vue","../src/layers/maplibre/image/VLayerMaplibreImage.vue","../src/layers/maplibre/raster/VLayerMaplibreRaster.vue","../src/constants/events/layer.ts","../src/constants/events/map.ts","../src/constants/events/marker.ts","../src/constants/events/popup.ts","../src/layers/maplibre/vector/VLayerMaplibreVector.vue","../src/layers/maplibre/video/VLayerMaplibreVideo.vue","../src/layers/maplibre/pmtile/VLayerMaplibrePmtile.vue","../src/layers/maplibre/custom/cluster/VLayerMaplibreCluster.vue","../src/layers/maplibre/custom/route/VLayerMaplibreRoute.vue","../src/layers/maplibre/custom/isochrone/VLayerMaplibreIsochrone.vue","../src/layers/maplibre/custom/starfield/VLayerMaplibreStarfield.vue","../src/layers/deckgl/scatterplot/VLayerDeckglScatterplot.vue","../src/layers/deckgl/arc/VLayerDeckglArc.vue","../src/layers/deckgl/geojson/VLayerDeckglGeojson.vue","../src/layers/deckgl/path/VLayerDeckglPath.vue","../src/layers/deckgl/line/VLayerDeckglLine.vue","../src/layers/deckgl/polygon/VLayerDeckglPolygon.vue","../src/layers/deckgl/solid-polygon/VLayerDeckglSolidPolygon.vue","../src/layers/deckgl/icon/VLayerDeckglIcon.vue","../src/layers/deckgl/text/VLayerDeckglText.vue","../src/layers/deckgl/column/VLayerDeckglColumn.vue","../src/layers/deckgl/bitmap/VLayerDeckglBitmap.vue","../src/layers/deckgl/grid-cell/VLayerDeckglGridCell.vue","../src/layers/deckgl/point-cloud/VLayerDeckglPointCloud.vue","../src/layers/deckgl/heatmap/VLayerDeckglHeatmap.vue","../src/layers/deckgl/hexagon/VLayerDeckglHexagon.vue","../src/layers/deckgl/grid/VLayerDeckglGrid.vue","../src/layers/deckgl/contour/VLayerDeckglContour.vue","../src/layers/deckgl/screen-grid/VLayerDeckglScreenGrid.vue","../src/layers/deckgl/trips/VLayerDeckglTrips.vue","../src/layers/deckgl/h3-hexagon/VLayerDeckglH3Hexagon.vue","../src/layers/deckgl/h3-cluster/VLayerDeckglH3Cluster.vue","../src/layers/deckgl/mvt/VLayerDeckglMVT.vue","../src/layers/deckgl/tile/VLayerDeckglTile.vue","../src/layers/deckgl/tile-3d/VLayerDeckglTile3D.vue","../src/layers/deckgl/terrain/VLayerDeckglTerrain.vue","../src/layers/deckgl/great-circle/VLayerDeckglGreatCircle.vue","../src/layers/deckgl/s2/VLayerDeckglS2.vue","../src/layers/deckgl/geohash/VLayerDeckglGeohash.vue","../src/layers/deckgl/quadkey/VLayerDeckglQuadkey.vue","../src/layers/deckgl/wms/VLayerDeckglWMS.vue","../src/layers/deckgl/simple-mesh/VLayerDeckglSimpleMesh.vue","../src/layers/deckgl/scenegraph/VLayerDeckglScenegraph.vue","../src/layers/deckgl/cog/VLayerDeckglCOG.vue","../src/layers/deckgl/mosaic/VLayerDeckglMosaic.vue","../src/layers/deckgl/multi-cog/VLayerDeckglMultiCOG.vue","../src/layers/deckgl/zarr/VLayerDeckglZarr.vue","../src/layers/deckgl/wind-particle/VLayerDeckglWindParticle.vue","../src/layers/deckgl/generic/VLayerDeckgl.vue","../src/map/VMap.vue","../src/popups/VPopup.vue","../src/markers/VMarker.vue","../src/index.ts"],"sourcesContent":["import type { InjectionKey } from 'vue';\nimport { inject } from 'vue';\n\n/**\n * Dependency injection 🥳\n * @param {InjectionKey} key - The key to inject\n * @param {string | undefined} fallback - The fallback value\n * @returns {undefined} - The value\n */\nexport function injectStrict<T>(key: InjectionKey<T>, fallback?: T): T {\n const resolved = inject(key, fallback);\n if (!resolved) {\n throw new Error(`Could not resolve ${key.description}`);\n }\n return resolved;\n}\n","import {\n inject,\n provide,\n ref,\n shallowRef,\n onUnmounted,\n watch,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport type { MapboxOverlay } from '@deck.gl/mapbox';\nimport type { Map, MapMouseEvent } from 'maplibre-gl';\n\nexport const DeckOverlayKey: InjectionKey<ShallowRef<MapboxOverlay | null>> =\n Symbol('DeckOverlay');\n\nexport const DeckLayersKey: InjectionKey<{\n addLayer: (layer: unknown) => void;\n removeLayer: (layerId: string) => void;\n updateLayer: (layerId: string, layer: unknown) => void;\n getLayers: () => unknown[];\n}> = Symbol('DeckLayers');\n\ninterface UseDeckOverlayOptions {\n interleaved?: boolean;\n}\n\ninterface UseDeckOverlayReturn {\n overlay: ShallowRef<MapboxOverlay | null>;\n layers: Ref<unknown[]>;\n isInitialized: Ref<boolean>;\n initOverlay: () => Promise<void>;\n addLayer: (layer: unknown) => void;\n removeLayer: (layerId: string) => void;\n updateLayer: (layerId: string, layer: unknown) => void;\n getLayers: () => unknown[];\n}\n\nexport function useDeckOverlay(\n map: Ref<Map | null>,\n options: UseDeckOverlayOptions = {},\n): UseDeckOverlayReturn {\n const { interleaved = false } = options;\n\n const existingOverlay = inject(DeckOverlayKey, null);\n const existingLayersRegistry = inject(DeckLayersKey, null);\n\n if (existingOverlay && existingLayersRegistry) {\n return {\n overlay: existingOverlay,\n isInitialized: ref(true),\n layers: ref([]),\n initOverlay: () => Promise.resolve(),\n ...existingLayersRegistry,\n };\n }\n\n const overlay = shallowRef<MapboxOverlay | null>(null);\n const layers = ref<unknown[]>([]);\n const isInitialized = ref(false);\n let initPromise: Promise<void> | null = null;\n let clickHandler: ((e: MapMouseEvent) => void) | null = null;\n\n /**\n * Workaround for deck.gl MapboxOverlay click events not reaching layer onClick\n * callbacks. The built-in path (_onPointerDown → _onEvent → getLastPickedObject)\n * fails to dispatch clicks. We register our own MapLibre click handler that uses\n * overlay.pickObject() for a fresh GPU pick and dispatches to the layer's onClick.\n */\n function registerClickHandler(mapInstance: Map): void {\n clickHandler = (e: MapMouseEvent) => {\n if (!overlay.value) return;\n const info = overlay.value.pickObject({\n x: e.point.x,\n y: e.point.y,\n radius: 5,\n });\n if (!info?.layer) return;\n\n const layerProps = info.layer.props as Record<string, unknown>;\n const onClick = layerProps.onClick as\n | ((i: unknown, ev: unknown) => boolean | void)\n | undefined;\n if (onClick) {\n onClick(info, e);\n }\n };\n mapInstance.on('click', clickHandler);\n }\n\n function removeClickHandler(mapInstance: Map | null): void {\n if (clickHandler && mapInstance) {\n mapInstance.off('click', clickHandler);\n }\n clickHandler = null;\n }\n\n const initOverlay = (): Promise<void> => {\n const mapInstance = map.value;\n if (!mapInstance) return Promise.resolve();\n if (overlay.value) return Promise.resolve();\n if (initPromise) return initPromise;\n\n initPromise = import('@deck.gl/mapbox')\n .then(({ MapboxOverlay }) => {\n if (overlay.value) return;\n\n overlay.value = new MapboxOverlay({\n interleaved,\n layers: [],\n });\n\n mapInstance.addControl(overlay.value);\n registerClickHandler(mapInstance);\n isInitialized.value = true;\n })\n .catch((error) => {\n console.error('[deck.gl] Error initializing overlay:', error);\n initPromise = null;\n });\n\n return initPromise;\n };\n\n const getLayerId = (layer: unknown): string => {\n return (layer as { id: string }).id;\n };\n\n const syncLayers = () => {\n if (overlay.value) {\n overlay.value.setProps({ layers: layers.value as never });\n }\n };\n\n const addLayer = (layer: unknown): void => {\n const layerId = getLayerId(layer);\n const existingIndex = layers.value.findIndex(\n (l) => getLayerId(l) === layerId,\n );\n\n if (existingIndex >= 0) {\n layers.value = [\n ...layers.value.slice(0, existingIndex),\n layer,\n ...layers.value.slice(existingIndex + 1),\n ];\n } else {\n layers.value = [...layers.value, layer];\n }\n\n if (overlay.value) {\n syncLayers();\n } else {\n initOverlay().then(syncLayers);\n }\n };\n\n const removeLayer = (layerId: string): void => {\n layers.value = layers.value.filter((l) => getLayerId(l) !== layerId);\n syncLayers();\n };\n\n const updateLayer = (layerId: string, newLayer: unknown): void => {\n const index = layers.value.findIndex((l) => getLayerId(l) === layerId);\n if (index >= 0) {\n layers.value = [\n ...layers.value.slice(0, index),\n newLayer,\n ...layers.value.slice(index + 1),\n ];\n syncLayers();\n } else {\n addLayer(newLayer);\n }\n };\n\n const getLayers = (): unknown[] => {\n return [...layers.value];\n };\n\n watch(\n map,\n (mapInstance) => {\n if (mapInstance && !overlay.value) {\n if (mapInstance.isStyleLoaded()) {\n initOverlay();\n } else {\n mapInstance.once('style.load', () => {\n initOverlay();\n });\n }\n }\n },\n { immediate: true },\n );\n\n provide(DeckOverlayKey, overlay);\n provide(DeckLayersKey, {\n addLayer,\n removeLayer,\n updateLayer,\n getLayers,\n });\n\n onUnmounted(() => {\n removeClickHandler(map.value);\n if (overlay.value && map.value) {\n try {\n map.value.removeControl(overlay.value);\n overlay.value.finalize();\n } catch (error) {\n console.error('[deck.gl] Error cleaning up overlay:', error);\n }\n }\n overlay.value = null;\n layers.value = [];\n isInitialized.value = false;\n initPromise = null;\n });\n\n return {\n overlay,\n layers,\n isInitialized,\n initOverlay,\n addLayer,\n removeLayer,\n updateLayer,\n getLayers,\n };\n}\n\nexport function useDeckLayers() {\n const registry = inject(DeckLayersKey, null);\n const overlay = inject(DeckOverlayKey, null);\n\n if (!registry) {\n throw new Error(\n '[deck.gl] useDeckLayers must be used within a component that has initialized useDeckOverlay',\n );\n }\n\n return {\n ...registry,\n overlay,\n };\n}\n","import type { Map } from 'maplibre-gl';\nimport type { Protocol } from 'pmtiles';\nimport type { InjectionKey, Ref } from 'vue';\n\nconst MapKey: InjectionKey<Ref<Map | null>> = Symbol('Map');\nconst PMTileProtocolKey: InjectionKey<Protocol | null> = Symbol('Protocol');\n\nexport { MapKey, PMTileProtocolKey };\nexport {\n DeckOverlayKey,\n DeckLayersKey,\n} from '../layers/deckgl/_shared/useDeckOverlay';\n","<script setup lang=\"ts\">\n import { AttributionControl } from 'maplibre-gl';\n import { onMounted, useSlots } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import type { AttributionControlOptions, ControlPosition } from './types';\n\n const defaultOptions: AttributionControlOptions = {\n compact: false,\n customAttribution: undefined,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: AttributionControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'bottom-right',\n },\n );\n\n const slots = useSlots();\n\n const map = injectStrict(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n let options = defaultOptions;\n if (props.options) {\n options = {\n ...props.options,\n };\n }\n if (slots && slots.default?.()) {\n options.customAttribution = slots.default()[0]!\n .children as unknown as string;\n }\n const control = new AttributionControl(options);\n map.value!.addControl(control, props.position);\n };\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { FullscreenControl } from 'maplibre-gl';\n import { onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import type { ControlPosition, FullscreenControlOptions } from './types';\n\n const defaultOptions: FullscreenControlOptions = {\n container: undefined,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: FullscreenControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'top-left',\n },\n );\n\n const map = injectStrict(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new FullscreenControl(props.options || defaultOptions);\n map.value!.addControl(control, props.position);\n };\n</script>\n","export const geolocateControlEvents: string[] = [\n 'geolocate',\n 'error',\n 'outofmaxbounds',\n 'trackuserlocationstart',\n 'trackuserlocationend',\n];\n","<script setup lang=\"ts\">\n import { GeolocateControl } from 'maplibre-gl';\n import { onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { geolocateControlEvents as events } from './events';\n import type { ControlPosition, GeolocateControlOptions } from './types';\n\n const defaultOptions: GeolocateControlOptions = {\n fitBoundsOptions: {\n linear: false,\n offset: [0, 0],\n maxZoom: 22,\n },\n positionOptions: {\n enableHighAccuracy: true,\n maximumAge: 0,\n timeout: 6000,\n },\n trackUserLocation: true,\n showAccuracyCircle: true,\n showUserLocation: true,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: GeolocateControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'top-left',\n },\n );\n\n const emit = defineEmits(events);\n\n const map = injectStrict(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new GeolocateControl(props.options || defaultOptions);\n map.value!.addControl(control, props.position);\n events.forEach((event: string) => {\n control.on(event, () => {\n emit(event);\n });\n });\n };\n</script>\n","<script setup lang=\"ts\">\n import { NavigationControl } from 'maplibre-gl';\n import { onMounted, inject } from 'vue';\n import { MapKey } from '../../utils';\n import type { ControlPosition, NavigationOptions } from './types';\n\n const defaultOptions: NavigationOptions = {\n showCompass: true,\n showZoom: true,\n visualizePitch: true,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: NavigationOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'top-left',\n },\n );\n\n const map = inject(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new NavigationControl(props.options || defaultOptions);\n map!.value!.addControl(control, props.position);\n };\n</script>\n","<script setup lang=\"ts\">\n import { onMounted, inject } from 'vue';\n import { ScaleControl } from 'maplibre-gl';\n import { MapKey } from '../../utils';\n import type { ControlPosition, ScaleControlOptions } from './types';\n\n const defaultOptions: ScaleControlOptions = {\n maxWidth: 100,\n unit: 'metric',\n };\n\n const props = withDefaults(\n defineProps<{\n options?: ScaleControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'bottom-left',\n },\n );\n\n const map = inject(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new ScaleControl(props.options || defaultOptions);\n map?.value!.addControl(control, props.position);\n };\n</script>\n\n<template>\n <slot></slot>\n</template>\n","export const lidarControlEvents: string[] = [\n 'load',\n 'loadstart',\n 'loaderror',\n 'unload',\n 'statechange',\n 'stylechange',\n 'collapse',\n 'expand',\n 'streamingstart',\n 'streamingstop',\n 'streamingprogress',\n 'budgetreached',\n];\n","<script setup lang=\"ts\">\n import { onMounted, onUnmounted, ref } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { lidarControlEvents as events } from './events';\n import type {\n ControlPosition,\n LidarControlOptions,\n ColorScheme,\n ColormapName,\n ColorRangeConfig,\n PointCloudInfo,\n StreamingLoaderOptions,\n CopcLoadingMode,\n } from './types';\n\n const defaultOptions: LidarControlOptions = {\n collapsed: true,\n pointSize: 2,\n colorScheme: 'elevation',\n pickable: false,\n autoZoom: true,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: LidarControlOptions;\n position?: ControlPosition;\n defaultUrl?: string;\n }>(),\n {\n options: undefined,\n position: 'top-right',\n defaultUrl: undefined,\n },\n );\n\n const emit = defineEmits(events);\n\n const map = injectStrict(MapKey);\n\n interface LidarControlInstance {\n on: (event: string, handler: (data?: unknown) => void) => void;\n off: (event: string, handler: (data?: unknown) => void) => void;\n loadPointCloud: (\n source: string | File | ArrayBuffer,\n options?: { loadingMode?: CopcLoadingMode },\n ) => Promise<PointCloudInfo>;\n loadPointCloudStreaming: (\n source: string | File | ArrayBuffer,\n options?: StreamingLoaderOptions,\n ) => Promise<PointCloudInfo>;\n loadPointCloudEptStreaming: (\n eptUrl: string,\n options?: StreamingLoaderOptions,\n ) => Promise<PointCloudInfo>;\n unloadPointCloud: (id?: string) => void;\n flyToPointCloud: (id?: string) => void;\n setPointSize: (size: number) => void;\n setOpacity: (opacity: number) => void;\n setColorScheme: (scheme: ColorScheme) => void;\n setColormap: (colormap: ColormapName) => void;\n getColormap: () => ColormapName;\n setColorRange: (config: ColorRangeConfig) => void;\n getColorRange: () => ColorRangeConfig;\n setUsePercentile: (use: boolean) => void;\n getUsePercentile: () => boolean;\n setPickable: (pickable: boolean) => void;\n setElevationRange: (min: number, max: number) => void;\n clearElevationRange: () => void;\n setPointBudget: (budget: number) => void;\n setZOffset: (offset: number) => void;\n setZOffsetEnabled: (enabled: boolean) => void;\n getZOffset: () => number;\n setTerrain: (enabled: boolean) => void;\n getTerrain: () => boolean;\n setPickInfoFields: (fields?: string[]) => void;\n getPickInfoFields: () => string[] | undefined;\n setClassificationVisibility: (code: number, visible: boolean) => void;\n showAllClassifications: () => void;\n hideAllClassifications: () => void;\n getHiddenClassifications: () => number[];\n getAvailableClassifications: () => number[];\n toggle: () => void;\n expand: () => void;\n collapse: () => void;\n getState: () => unknown;\n getPointClouds: () => PointCloudInfo[];\n stopStreaming: (id?: string) => void;\n isStreaming: (id?: string) => boolean;\n getStreamingProgress: () => unknown;\n getMap: () => unknown;\n getPanelElement: () => HTMLElement | null;\n }\n\n const control = ref<LidarControlInstance | null>(null);\n\n onMounted(async () => {\n await addControl();\n });\n\n onUnmounted(() => {\n if (control.value && map.value) {\n map.value.removeControl(control.value as unknown as maplibregl.IControl);\n control.value = null;\n }\n });\n\n const addControl = async (): Promise<void> => {\n const { LidarControl } = await import('maplibre-gl-lidar');\n\n control.value = new LidarControl(\n props.options || defaultOptions,\n ) as unknown as LidarControlInstance;\n\n map.value!.addControl(\n control.value as unknown as maplibregl.IControl,\n props.position,\n );\n\n events.forEach((event: string) => {\n control.value!.on(event, (data?: unknown) => {\n emit(event, data);\n });\n });\n\n if (props.defaultUrl) {\n control.value.loadPointCloud(props.defaultUrl);\n }\n };\n\n defineExpose({\n loadPointCloud: (\n source: string | File | ArrayBuffer,\n options?: { loadingMode?: CopcLoadingMode },\n ) => control.value?.loadPointCloud(source, options),\n loadPointCloudStreaming: (\n source: string | File | ArrayBuffer,\n options?: StreamingLoaderOptions,\n ) => control.value?.loadPointCloudStreaming(source, options),\n loadPointCloudEptStreaming: (\n eptUrl: string,\n options?: StreamingLoaderOptions,\n ) => control.value?.loadPointCloudEptStreaming(eptUrl, options),\n unloadPointCloud: (id?: string) => control.value?.unloadPointCloud(id),\n flyToPointCloud: (id?: string) => control.value?.flyToPointCloud(id),\n setPointSize: (size: number) => control.value?.setPointSize(size),\n setColorScheme: (scheme: ColorScheme) =>\n control.value?.setColorScheme(scheme),\n setColormap: (colormap: ColormapName) =>\n control.value?.setColormap(colormap),\n getColormap: () => control.value?.getColormap(),\n setColorRange: (config: ColorRangeConfig) =>\n control.value?.setColorRange(config),\n getColorRange: () => control.value?.getColorRange(),\n setOpacity: (opacity: number) => control.value?.setOpacity(opacity),\n setPickable: (pickable: boolean) => control.value?.setPickable(pickable),\n setUsePercentile: (use: boolean) => control.value?.setUsePercentile(use),\n getUsePercentile: () => control.value?.getUsePercentile(),\n setElevationRange: (min: number, max: number) =>\n control.value?.setElevationRange(min, max),\n clearElevationRange: () => control.value?.clearElevationRange(),\n setPointBudget: (budget: number) => control.value?.setPointBudget(budget),\n setZOffset: (offset: number) => control.value?.setZOffset(offset),\n setZOffsetEnabled: (enabled: boolean) =>\n control.value?.setZOffsetEnabled(enabled),\n getZOffset: () => control.value?.getZOffset(),\n setTerrain: (enabled: boolean) => control.value?.setTerrain(enabled),\n getTerrain: () => control.value?.getTerrain(),\n setPickInfoFields: (fields?: string[]) =>\n control.value?.setPickInfoFields(fields),\n getPickInfoFields: () => control.value?.getPickInfoFields(),\n setClassificationVisibility: (code: number, visible: boolean) =>\n control.value?.setClassificationVisibility(code, visible),\n showAllClassifications: () => control.value?.showAllClassifications(),\n hideAllClassifications: () => control.value?.hideAllClassifications(),\n getHiddenClassifications: () => control.value?.getHiddenClassifications(),\n getAvailableClassifications: () =>\n control.value?.getAvailableClassifications(),\n toggle: () => control.value?.toggle(),\n expand: () => control.value?.expand(),\n collapse: () => control.value?.collapse(),\n getState: () => control.value?.getState(),\n getPointClouds: () => control.value?.getPointClouds(),\n stopStreaming: (id?: string) => control.value?.stopStreaming(id),\n isStreaming: (id?: string) => control.value?.isStreaming(id),\n getStreamingProgress: () => control.value?.getStreamingProgress(),\n getMap: () => control.value?.getMap(),\n getPanelElement: () => control.value?.getPanelElement(),\n getControl: () => control.value,\n });\n</script>\n","import {\n onMounted,\n onUnmounted,\n onUpdated,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport type { Map, IControl, ControlPosition } from 'maplibre-gl';\n\n/**\n * Register a Vue component as a MapLibre IControl for proper control stacking.\n *\n * @param map - Ref to the MapLibre map instance\n * @param containerRef - Ref to the component's root HTMLElement\n * @param position - Control position ('top-left' | 'top-right' | 'bottom-left' | 'bottom-right')\n */\nexport function useMapControl(\n map: ShallowRef<Map | null> | Ref<Map | null>,\n containerRef: Ref<HTMLElement | null>,\n position: ControlPosition,\n): void {\n let control: IControl | null = null;\n let isAdded = false;\n\n /**\n * Re-add the maplibregl-ctrl class if Vue's :class reconciliation removed it.\n * Vue overwrites the class attribute when dynamic :class bindings update,\n * which drops imperatively-added classes like maplibregl-ctrl.\n */\n const ensureControlClass = () => {\n if (\n isAdded &&\n containerRef.value &&\n !containerRef.value.classList.contains('maplibregl-ctrl')\n ) {\n containerRef.value.classList.add('maplibregl-ctrl');\n }\n };\n\n onMounted(() => {\n if (!map.value || !containerRef.value) return;\n\n control = {\n onAdd: (): HTMLElement => {\n containerRef.value?.classList.add('maplibregl-ctrl');\n return containerRef.value!;\n },\n onRemove: (): void => {},\n };\n\n map.value.addControl(control, position);\n isAdded = true;\n });\n\n onUpdated(() => {\n ensureControlClass();\n });\n\n onUnmounted(() => {\n if (map.value && control) {\n try {\n map.value.removeControl(control);\n } catch {\n // Control may already be removed if map was destroyed\n }\n }\n });\n}\n","<script setup lang=\"ts\">\n import { ref, watch, inject, onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { DeckLayersKey } from '../../layers/deckgl/_shared/useDeckOverlay';\n import { useMapControl } from '../_shared';\n import type { ControlPosition, LayerType } from './types';\n\n const props = withDefaults(\n defineProps<{\n layerId: string;\n position?: ControlPosition;\n visible?: boolean;\n opacity?: number;\n title?: string;\n layerType?: LayerType;\n }>(),\n {\n position: 'top-right',\n visible: true,\n opacity: 1,\n title: 'Layer Control',\n layerType: undefined,\n },\n );\n\n const emit = defineEmits<{\n 'visibility-change': [visible: boolean];\n 'opacity-change': [opacity: number];\n 'update:visible': [visible: boolean];\n 'update:opacity': [opacity: number];\n }>();\n\n const map = injectStrict(MapKey);\n const deckLayers = inject(DeckLayersKey, null);\n const containerRef = ref<HTMLElement | null>(null);\n const isVisible = ref(props.visible);\n const currentOpacity = ref(props.opacity);\n\n useMapControl(map, containerRef, props.position);\n\n // Function to detect layer type (called fresh each time, not cached)\n const getLayerType = (): LayerType | null => {\n if (props.layerType) return props.layerType;\n if (!map.value) return null;\n const maplibreLayer = map.value.getLayer(props.layerId);\n if (maplibreLayer) return 'maplibre';\n if (deckLayers) {\n const layers = deckLayers.getLayers();\n const deckLayer = (layers as Array<{ id: string }>).find(\n (l) => l.id === props.layerId,\n );\n if (deckLayer) return 'deckgl';\n }\n return null;\n };\n\n const getOpacityProperty = (): string | null => {\n if (!map.value || getLayerType() !== 'maplibre') return null;\n\n const layer = map.value.getLayer(props.layerId);\n if (!layer) return null;\n\n switch (layer.type) {\n case 'fill':\n return 'fill-opacity';\n case 'line':\n return 'line-opacity';\n case 'circle':\n return 'circle-opacity';\n case 'symbol':\n return 'icon-opacity';\n default:\n return null;\n }\n };\n\n const updateVisibility = (visible: boolean) => {\n const layerType = getLayerType();\n\n if (layerType === 'maplibre') {\n if (!map.value) return;\n const layer = map.value.getLayer(props.layerId);\n if (!layer) {\n console.warn(`MapLibre layer not found: ${props.layerId}`);\n return;\n }\n map.value.setLayoutProperty(\n props.layerId,\n 'visibility',\n visible ? 'visible' : 'none',\n );\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `deck.gl overlay not available for layer: ${props.layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === props.layerId);\n if (!existingLayer) {\n console.warn(`deck.gl layer not found: ${props.layerId}`);\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ visible });\n deckLayers.updateLayer(props.layerId, updatedLayer);\n }\n } else {\n console.warn(`Layer not found in MapLibre or deck.gl: ${props.layerId}`);\n return;\n }\n\n emit('visibility-change', visible);\n emit('update:visible', visible);\n };\n\n const updateOpacity = (opacity: number) => {\n const layerType = getLayerType();\n\n if (layerType === 'maplibre') {\n const opacityProp = getOpacityProperty();\n if (!map.value || !opacityProp) return;\n const layer = map.value.getLayer(props.layerId);\n if (!layer) {\n console.warn(`MapLibre layer not found: ${props.layerId}`);\n return;\n }\n map.value.setPaintProperty(props.layerId, opacityProp, opacity);\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `deck.gl overlay not available for layer: ${props.layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === props.layerId);\n if (!existingLayer) {\n console.warn(`deck.gl layer not found: ${props.layerId}`);\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ opacity });\n deckLayers.updateLayer(props.layerId, updatedLayer);\n }\n } else {\n console.warn(`Layer not found in MapLibre or deck.gl: ${props.layerId}`);\n return;\n }\n\n emit('opacity-change', opacity);\n emit('update:opacity', opacity);\n };\n\n const toggleVisibility = () => {\n isVisible.value = !isVisible.value;\n };\n\n const handleOpacityInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n currentOpacity.value = Number(target.value) / 100;\n };\n\n watch(isVisible, (newValue) => {\n updateVisibility(newValue);\n });\n\n watch(currentOpacity, (newValue) => {\n updateOpacity(newValue);\n });\n\n watch(\n () => props.visible,\n (newValue) => {\n isVisible.value = newValue;\n },\n );\n\n watch(\n () => props.opacity,\n (newValue) => {\n currentOpacity.value = newValue;\n },\n );\n\n // Wait for layer to be available, then apply initial settings\n onMounted(() => {\n let applied = false;\n\n const checkAndApply = () => {\n if (applied) return true;\n // Use function directly to get fresh result (not cached computed)\n const layerType = getLayerType();\n if (layerType) {\n applied = true;\n updateVisibility(isVisible.value);\n updateOpacity(currentOpacity.value);\n return true;\n }\n return false;\n };\n\n // Try immediately\n if (checkAndApply()) return;\n\n // If layer not found, retry with increasing intervals\n // Total wait: ~10 seconds (enough for data fetching)\n const delays = [100, 200, 300, 500, 500, 1000, 1000, 1000, 2000, 3000];\n let index = 0;\n\n const retry = () => {\n if (checkAndApply() || index >= delays.length) return;\n setTimeout(() => {\n index++;\n retry();\n }, delays[index]);\n };\n\n retry();\n });\n</script>\n\n<template>\n <div ref=\"containerRef\" class=\"v-layer-control\">\n <div class=\"v-layer-control-header\">\n <span class=\"v-layer-control-title\">{{ title }}</span>\n <button\n type=\"button\"\n class=\"v-layer-control-toggle\"\n :class=\"{ 'is-hidden': !isVisible }\"\n :aria-pressed=\"isVisible\"\n :title=\"isVisible ? 'Hide layer' : 'Show layer'\"\n @click=\"toggleVisibility\"\n >\n <svg\n v-if=\"isVisible\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M8 3C4.5 3 1.5 5.5 0.5 8C1.5 10.5 4.5 13 8 13C11.5 13 14.5 10.5 15.5 8C14.5 5.5 11.5 3 8 3Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"2.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n />\n </svg>\n <svg v-else width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M2 2L14 14M6.5 6.5C5.9 7.1 5.5 7.9 5.5 8.8C5.5 10.4 6.9 11.5 8 11.5C8.9 11.5 9.7 11.1 10.3 10.5M8 3C4.5 3 1.5 5.5 0.5 8C1 9.2 1.8 10.3 2.8 11.2M13.2 11.2C14.2 10.3 15 9.2 15.5 8C14.5 5.5 11.5 3 8 3\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"v-layer-control-slider-row\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n :value=\"Math.round(currentOpacity * 100)\"\n class=\"v-layer-control-slider\"\n :disabled=\"!isVisible\"\n @input=\"handleOpacityInput\"\n />\n <span class=\"v-layer-control-value\"\n >{{ Math.round(currentOpacity * 100) }}%</span\n >\n </div>\n\n <slot></slot>\n </div>\n</template>\n\n<style>\n .v-layer-control {\n min-width: 140px;\n max-width: 280px;\n margin: 10px;\n background: var(--color-card, #fff);\n border-radius: var(--radius, 0.5rem);\n border: 1px solid var(--color-border, #e5e7eb);\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n sans-serif;\n font-size: 12px;\n overflow: hidden;\n padding: 8px 10px;\n /* Required: MapLibre control containers have pointer-events:none */\n pointer-events: auto;\n }\n\n .v-layer-control-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 8px;\n }\n\n .v-layer-control-title {\n font-weight: 500;\n font-size: 11px;\n color: var(--color-card-foreground, #111827);\n line-height: 1.2;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n .v-layer-control-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n border: none;\n border-radius: calc(var(--radius, 0.5rem) - 2px);\n background: transparent;\n color: var(--color-foreground, #374151);\n cursor: pointer;\n transition:\n background 0.15s ease,\n color 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-layer-control-toggle svg {\n width: 14px;\n height: 14px;\n }\n\n .v-layer-control-toggle:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-layer-control-toggle.is-hidden {\n color: var(--color-muted-foreground, #9ca3af);\n }\n\n .v-layer-control-toggle:focus {\n outline: none;\n }\n\n .v-layer-control-toggle:focus-visible {\n outline: 2px solid var(--color-primary, #3b82f6);\n outline-offset: -2px;\n }\n\n .v-layer-control-slider-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .v-layer-control-slider {\n flex: 1;\n height: 3px;\n border-radius: 2px;\n background: var(--color-secondary, #e5e7eb);\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n }\n\n .v-layer-control-slider:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .v-layer-control-value {\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n font-variant-numeric: tabular-nums;\n min-width: 28px;\n text-align: right;\n }\n\n .v-layer-control-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-control-slider::-moz-range-thumb {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-control-slider:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-control-slider:disabled::-moz-range-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-control-slider:focus {\n outline: none;\n }\n\n .v-layer-control-slider:focus::-webkit-slider-thumb {\n box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--color-primary, #3b82f6) 20%, transparent);\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref, watch, inject, onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { DeckLayersKey } from '../../layers/deckgl/_shared/useDeckOverlay';\n import { useMapControl } from '../_shared';\n import type { ControlPosition, LayerType } from './types';\n\n export interface LayerConfig {\n id: string;\n title: string;\n visible?: boolean;\n opacity?: number;\n type?: LayerType;\n }\n\n const props = withDefaults(\n defineProps<{\n layers: LayerConfig[];\n position?: ControlPosition;\n title?: string;\n collapsible?: boolean;\n collapsed?: boolean;\n }>(),\n {\n position: 'top-right',\n title: 'Layers',\n collapsible: true,\n collapsed: false,\n },\n );\n\n const emit = defineEmits<{\n 'visibility-change': [data: { layerId: string; visible: boolean }];\n 'opacity-change': [data: { layerId: string; opacity: number }];\n 'update:layers': [layers: LayerConfig[]];\n }>();\n\n const map = injectStrict(MapKey);\n const deckLayers = inject(DeckLayersKey, null);\n const containerRef = ref<HTMLElement | null>(null);\n const isCollapsed = ref(props.collapsed);\n\n const layerStates = ref<Map<string, { visible: boolean; opacity: number }>>(\n new Map(),\n );\n\n useMapControl(map, containerRef, props.position);\n\n const initLayerStates = () => {\n for (const layer of props.layers) {\n layerStates.value.set(layer.id, {\n visible: layer.visible ?? true,\n opacity: layer.opacity ?? 1,\n });\n }\n };\n\n const getLayerType = (\n layerId: string,\n configType?: LayerType,\n ): LayerType | null => {\n if (configType) return configType;\n if (!map.value) return null;\n\n const maplibreLayer = map.value.getLayer(layerId);\n if (maplibreLayer) return 'maplibre';\n\n if (deckLayers) {\n const layers = deckLayers.getLayers();\n const deckLayer = (layers as Array<{ id: string }>).find(\n (l) => l.id === layerId,\n );\n if (deckLayer) return 'deckgl';\n }\n return null;\n };\n\n const getOpacityProperty = (layerId: string): string | null => {\n if (!map.value) return null;\n const layer = map.value.getLayer(layerId);\n if (!layer) return null;\n\n const layerType = layer.type;\n switch (layerType) {\n case 'fill':\n return 'fill-opacity';\n case 'line':\n return 'line-opacity';\n case 'circle':\n return 'circle-opacity';\n case 'symbol':\n return 'icon-opacity';\n case 'raster':\n return 'raster-opacity';\n default:\n return null;\n }\n };\n\n const updateVisibility = (\n layerId: string,\n visible: boolean,\n configType?: LayerType,\n ) => {\n const layerType = getLayerType(layerId, configType);\n\n if (layerType === 'maplibre') {\n if (!map.value) return;\n const layer = map.value.getLayer(layerId);\n if (!layer) {\n console.warn(\n `[VControlLayerGroup] MapLibre layer not found: ${layerId}`,\n );\n return;\n }\n map.value.setLayoutProperty(\n layerId,\n 'visibility',\n visible ? 'visible' : 'none',\n );\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `[VControlLayerGroup] deck.gl overlay not available for layer: ${layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === layerId);\n if (!existingLayer) {\n console.warn(\n `[VControlLayerGroup] deck.gl layer not found: ${layerId}`,\n );\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ visible });\n deckLayers.updateLayer(layerId, updatedLayer);\n }\n } else {\n console.warn(`[VControlLayerGroup] Layer not found: ${layerId}`);\n return;\n }\n\n emit('visibility-change', { layerId, visible });\n };\n\n const updateOpacity = (\n layerId: string,\n opacity: number,\n configType?: LayerType,\n ) => {\n const layerType = getLayerType(layerId, configType);\n\n if (layerType === 'maplibre') {\n const opacityProp = getOpacityProperty(layerId);\n if (!map.value || !opacityProp) return;\n const layer = map.value.getLayer(layerId);\n if (!layer) {\n console.warn(\n `[VControlLayerGroup] MapLibre layer not found: ${layerId}`,\n );\n return;\n }\n map.value.setPaintProperty(layerId, opacityProp, opacity);\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `[VControlLayerGroup] deck.gl overlay not available for layer: ${layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === layerId);\n if (!existingLayer) {\n console.warn(\n `[VControlLayerGroup] deck.gl layer not found: ${layerId}`,\n );\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ opacity });\n deckLayers.updateLayer(layerId, updatedLayer);\n }\n } else {\n console.warn(`[VControlLayerGroup] Layer not found: ${layerId}`);\n return;\n }\n\n emit('opacity-change', { layerId, opacity });\n };\n\n const toggleVisibility = (layer: LayerConfig) => {\n const state = layerStates.value.get(layer.id);\n if (!state) return;\n\n const newVisible = !state.visible;\n state.visible = newVisible;\n updateVisibility(layer.id, newVisible, layer.type);\n };\n\n const handleOpacityInput = (layer: LayerConfig, event: Event) => {\n const target = event.target as HTMLInputElement;\n const opacity = Number(target.value) / 100;\n\n const state = layerStates.value.get(layer.id);\n if (!state) return;\n\n state.opacity = opacity;\n updateOpacity(layer.id, opacity, layer.type);\n };\n\n const getState = (layerId: string) => {\n return layerStates.value.get(layerId) ?? { visible: true, opacity: 1 };\n };\n\n const toggleCollapse = () => {\n if (props.collapsible) {\n isCollapsed.value = !isCollapsed.value;\n }\n };\n\n watch(\n () => props.layers,\n () => {\n initLayerStates();\n },\n { deep: true },\n );\n\n watch(\n () => props.collapsed,\n (newValue) => {\n isCollapsed.value = newValue;\n },\n );\n\n onMounted(() => {\n initLayerStates();\n // Apply initial states\n for (const layer of props.layers) {\n const state = getState(layer.id);\n updateVisibility(layer.id, state.visible, layer.type);\n updateOpacity(layer.id, state.opacity, layer.type);\n }\n });\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"v-layer-group maplibregl-ctrl\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n >\n <button\n v-if=\"collapsible\"\n type=\"button\"\n class=\"v-layer-group-header\"\n @click=\"toggleCollapse\"\n >\n <span class=\"v-layer-group-title\">{{ title }}</span>\n <svg\n class=\"v-layer-group-chevron\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n >\n <path\n d=\"M3 5L7 9L11 5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <div v-else class=\"v-layer-group-header is-static\">\n <span class=\"v-layer-group-title\">{{ title }}</span>\n </div>\n\n <div v-if=\"!isCollapsed\" class=\"v-layer-group-content\">\n <div v-for=\"layer in layers\" :key=\"layer.id\" class=\"v-layer-group-item\">\n <div class=\"v-layer-group-item-header\">\n <span class=\"v-layer-group-item-title\">{{ layer.title }}</span>\n <button\n type=\"button\"\n class=\"v-layer-group-toggle\"\n :class=\"{ 'is-hidden': !getState(layer.id).visible }\"\n :aria-pressed=\"getState(layer.id).visible\"\n :title=\"getState(layer.id).visible ? 'Hide layer' : 'Show layer'\"\n @click=\"toggleVisibility(layer)\"\n >\n <svg\n v-if=\"getState(layer.id).visible\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M8 3C4.5 3 1.5 5.5 0.5 8C1.5 10.5 4.5 13 8 13C11.5 13 14.5 10.5 15.5 8C14.5 5.5 11.5 3 8 3Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"2.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n />\n </svg>\n <svg v-else width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M2 2L14 14M6.5 6.5C5.9 7.1 5.5 7.9 5.5 8.8C5.5 10.4 6.9 11.5 8 11.5C8.9 11.5 9.7 11.1 10.3 10.5M8 3C4.5 3 1.5 5.5 0.5 8C1 9.2 1.8 10.3 2.8 11.2M13.2 11.2C14.2 10.3 15 9.2 15.5 8C14.5 5.5 11.5 3 8 3\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n <div class=\"v-layer-group-slider-row\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n :value=\"Math.round(getState(layer.id).opacity * 100)\"\n class=\"v-layer-group-slider\"\n :disabled=\"!getState(layer.id).visible\"\n @input=\"handleOpacityInput(layer, $event)\"\n />\n <span class=\"v-layer-group-value\"\n >{{ Math.round(getState(layer.id).opacity * 100) }}%</span\n >\n </div>\n </div>\n </div>\n\n <slot></slot>\n </div>\n</template>\n\n<style>\n .v-layer-group {\n min-width: 140px;\n max-width: 280px;\n margin: 10px;\n background: var(--color-card, #fff);\n border-radius: var(--radius, 0.5rem);\n border: 1px solid var(--color-border, #e5e7eb);\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n sans-serif;\n font-size: 12px;\n overflow: hidden;\n /* Required: MapLibre control containers have pointer-events:none */\n pointer-events: auto;\n }\n\n .v-layer-group-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n width: 100%;\n min-height: 36px;\n padding: 8px 10px;\n border: none;\n border-bottom: 1px solid var(--color-border, #e5e7eb);\n background: transparent;\n cursor: pointer;\n text-align: left;\n line-height: 1;\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n }\n\n .v-layer-group-header.is-static {\n cursor: default;\n }\n\n .v-layer-group-header:not(.is-static):hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-layer-group-header:focus {\n outline: none;\n }\n\n .v-layer-group-header:focus-visible {\n outline: 2px solid var(--color-primary, #3b82f6);\n outline-offset: -2px;\n }\n\n .v-layer-group.is-collapsed .v-layer-group-header {\n border-bottom: none;\n }\n\n .v-layer-group-title {\n font-weight: 500;\n font-size: 11px;\n color: var(--color-card-foreground, #111827);\n line-height: 1.2;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n .v-layer-group-chevron {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n color: var(--color-muted-foreground, #6b7280);\n transition: transform 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-layer-group-chevron.is-collapsed {\n transform: rotate(-90deg);\n }\n\n .v-layer-group-content {\n display: flex;\n flex-direction: column;\n }\n\n .v-layer-group-item {\n padding: 6px 10px 8px;\n border-bottom: 1px solid var(--color-border, #e5e7eb);\n }\n\n .v-layer-group-item:last-child {\n border-bottom: none;\n }\n\n .v-layer-group-item-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 6px;\n }\n\n .v-layer-group-item-title {\n font-weight: 500;\n font-size: 11px;\n color: var(--color-foreground, #374151);\n line-height: 1.2;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n .v-layer-group-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n border: none;\n border-radius: calc(var(--radius, 0.5rem) - 2px);\n background: transparent;\n color: var(--color-foreground, #374151);\n cursor: pointer;\n transition:\n background 0.15s ease,\n color 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-layer-group-toggle svg {\n width: 14px;\n height: 14px;\n }\n\n .v-layer-group-toggle:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-layer-group-toggle.is-hidden {\n color: var(--color-muted-foreground, #9ca3af);\n }\n\n .v-layer-group-slider-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .v-layer-group-slider {\n flex: 1;\n height: 3px;\n border-radius: 2px;\n background: var(--color-secondary, #e5e7eb);\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n }\n\n .v-layer-group-slider:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .v-layer-group-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-group-slider::-moz-range-thumb {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-group-slider:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-group-slider:disabled::-moz-range-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-group-slider:focus {\n outline: none;\n }\n\n .v-layer-group-slider:focus::-webkit-slider-thumb {\n box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--color-primary, #3b82f6) 20%, transparent);\n }\n\n .v-layer-group-value {\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n font-variant-numeric: tabular-nums;\n min-width: 28px;\n text-align: right;\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref, watch, computed, inject, onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { DeckLayersKey } from '../../layers/deckgl/_shared/useDeckOverlay';\n import { useMapControl } from '../_shared';\n import type {\n ControlPosition,\n LegendType,\n CategoryLegendItem,\n GradientLegendItem,\n SizeLegendItem,\n TableLegendItem,\n LegendItem,\n FilterState,\n ExpressionValue,\n DeckLayerWithExtensions,\n } from './types';\n\n const props = withDefaults(\n defineProps<{\n layerIds: string[];\n type?: LegendType;\n items?: LegendItem[];\n position?: ControlPosition;\n property?: string;\n autoGenerate?: boolean;\n title?: string;\n collapsed?: boolean;\n interactive?: boolean;\n }>(),\n {\n type: 'category',\n position: 'top-right',\n autoGenerate: false,\n title: 'Legend',\n collapsed: false,\n interactive: true,\n },\n );\n\n const emit = defineEmits<{\n 'item-click': [data: { item: LegendItem; index: number; visible: boolean }];\n 'filter-change': [data: { filter: FilterState; layerIds: string[] }];\n 'update:filter': [filter: FilterState];\n }>();\n\n const map = injectStrict(MapKey);\n const deckLayers = inject(DeckLayersKey, null);\n const containerRef = ref<HTMLElement | null>(null);\n const isCollapsed = ref(props.collapsed);\n const categoryItemVisibility = ref<Map<string | number, boolean>>(new Map());\n const generatedItems = ref<LegendItem[]>([]);\n\n useMapControl(map, containerRef, props.position);\n\n const parseMatchExpression = (\n expression: ExpressionValue[],\n ): CategoryLegendItem[] => {\n const items: CategoryLegendItem[] = [];\n const defaultColor = expression[expression.length - 1] as string;\n\n for (let i = 2; i < expression.length - 1; i += 2) {\n const value = expression[i];\n const color = expression[i + 1] as string;\n\n if (Array.isArray(value)) {\n for (const v of value) {\n items.push({\n value: v as string | number,\n label: String(v),\n color,\n visible: true,\n });\n }\n } else {\n items.push({\n value: value as string | number,\n label: String(value),\n color,\n visible: true,\n });\n }\n }\n\n if (items.length > 0 && defaultColor && typeof defaultColor === 'string') {\n items.push({\n value: '__default__',\n label: 'Other',\n color: defaultColor,\n visible: true,\n });\n }\n\n return items;\n };\n\n const parseStepExpression = (\n expression: ExpressionValue[],\n ): GradientLegendItem | null => {\n const colors: string[] = [];\n const stops: number[] = [];\n\n const defaultColor = expression[2] as string;\n colors.push(defaultColor);\n\n for (let i = 3; i < expression.length; i += 2) {\n const stop = expression[i] as number;\n const color = expression[i + 1] as string;\n stops.push(stop);\n colors.push(color);\n }\n\n if (stops.length === 0) return null;\n\n return {\n min: stops[0],\n max: stops[stops.length - 1],\n colors,\n stops,\n };\n };\n\n const parseInterpolateExpression = (\n expression: ExpressionValue[],\n ): GradientLegendItem | null => {\n const colors: string[] = [];\n const stops: number[] = [];\n\n const startIndex = expression[1] && Array.isArray(expression[1]) ? 3 : 3;\n\n for (let i = startIndex; i < expression.length; i += 2) {\n const stop = expression[i] as number;\n const color = expression[i + 1] as string;\n stops.push(stop);\n colors.push(color);\n }\n\n if (stops.length < 2) return null;\n\n return {\n min: stops[0],\n max: stops[stops.length - 1],\n colors,\n stops,\n };\n };\n\n const generateLegendFromPaint = (): LegendItem[] => {\n if (!props.autoGenerate || !props.property || !map.value) return [];\n\n const layerId = props.layerIds[0];\n if (!layerId) return [];\n\n const layer = map.value.getLayer(layerId);\n if (!layer) {\n console.warn(`[VControlLegend] Layer not found: ${layerId}`);\n return [];\n }\n\n const paintValue = map.value.getPaintProperty(layerId, props.property);\n if (!paintValue || !Array.isArray(paintValue)) {\n console.warn(\n `[VControlLegend] Paint property \"${props.property}\" not found or not an expression`,\n );\n return [];\n }\n\n const expressionType = paintValue[0];\n\n if (expressionType === 'match') {\n return parseMatchExpression(paintValue as ExpressionValue[]);\n }\n\n if (expressionType === 'step') {\n const gradient = parseStepExpression(paintValue as ExpressionValue[]);\n return gradient ? [gradient] : [];\n }\n\n if (\n expressionType === 'interpolate' ||\n expressionType === 'interpolate-hcl' ||\n expressionType === 'interpolate-lab'\n ) {\n const gradient = parseInterpolateExpression(\n paintValue as ExpressionValue[],\n );\n return gradient ? [gradient] : [];\n }\n\n console.warn(\n `[VControlLegend] Unsupported expression type: ${expressionType}`,\n );\n return [];\n };\n\n const effectiveItems = computed((): LegendItem[] => {\n if (props.items && props.items.length > 0) {\n return props.items;\n }\n return generatedItems.value;\n });\n\n const categoryItems = computed(() => {\n if (props.type !== 'category') return [];\n return effectiveItems.value.filter(\n (item): item is CategoryLegendItem =>\n 'value' in item && 'color' in item && 'label' in item,\n );\n });\n\n const gradientItem = computed(() => {\n if (props.type !== 'gradient') return null;\n const items = effectiveItems.value;\n if (items.length === 0) return null;\n const first = items[0];\n if ('min' in first && 'max' in first && 'colors' in first) {\n return first as GradientLegendItem;\n }\n return null;\n });\n\n const sizeItems = computed(() => {\n if (props.type !== 'size') return [];\n return effectiveItems.value.filter(\n (item): item is SizeLegendItem => 'size' in item && 'value' in item,\n );\n });\n\n const tableItems = computed((): TableLegendItem[] => {\n if (props.type !== 'table') return [];\n return effectiveItems.value\n .filter(\n (item): item is TableLegendItem =>\n 'label' in item &&\n 'color' in item &&\n 'value' in item &&\n !('size' in item) &&\n !('visible' in item),\n )\n .sort((a, b) => b.value - a.value);\n });\n\n const formatTableValue = (item: TableLegendItem): string => {\n if (item.formattedValue) return item.formattedValue;\n return `${item.value}${item.unit ?? ''}`;\n };\n\n const filterState = computed((): FilterState => {\n const visibleValues = Array.from(categoryItemVisibility.value.entries())\n .filter(([, visible]) => visible)\n .map(([value]) => value);\n return { visibleValues };\n });\n\n const gradientStyle = computed(() => {\n if (!gradientItem.value) return '';\n const colorStops = gradientItem.value.colors.join(', ');\n return `linear-gradient(to right, ${colorStops})`;\n });\n\n const initVisibility = () => {\n if (props.type === 'category') {\n for (const item of categoryItems.value) {\n categoryItemVisibility.value.set(item.value, item.visible ?? true);\n }\n }\n };\n\n const applyFilterToMapLibreLayers = () => {\n if (!map.value || !props.property || props.type !== 'category') return;\n\n const visibleValues = filterState.value.visibleValues.filter(\n (v) => v !== '__default__',\n );\n const allValues = categoryItems.value\n .map((item) => item.value)\n .filter((v) => v !== '__default__');\n const allVisible = visibleValues.length === allValues.length;\n\n for (const layerId of props.layerIds) {\n const layer = map.value.getLayer(layerId);\n if (!layer) continue;\n\n if (allVisible) {\n map.value.setFilter(layerId, null);\n } else if (visibleValues.length === 0) {\n map.value.setFilter(layerId, ['==', ['get', '_never_match_'], true]);\n } else {\n const paintValue = map.value.getPaintProperty(layerId, props.property);\n if (!paintValue || !Array.isArray(paintValue)) continue;\n\n const inputExpr = paintValue[1];\n let propertyName: string | null = null;\n\n if (Array.isArray(inputExpr) && inputExpr[0] === 'get') {\n propertyName = inputExpr[1] as string;\n }\n\n if (propertyName) {\n map.value.setFilter(layerId, [\n 'in',\n ['get', propertyName],\n ['literal', visibleValues],\n ]);\n }\n }\n }\n };\n\n const applyFilterToDeckglLayers = () => {\n if (!deckLayers || props.type !== 'category') return;\n\n const visibleValues = filterState.value.visibleValues.filter(\n (v) => v !== '__default__',\n );\n const allValues = categoryItems.value\n .map((item) => item.value)\n .filter((v) => v !== '__default__');\n const allVisible = visibleValues.length === allValues.length;\n\n const layers = deckLayers.getLayers() as DeckLayerWithExtensions[];\n\n for (const layerId of props.layerIds) {\n if (map.value?.getLayer(layerId)) continue;\n\n const deckLayer = layers.find((l) => l.id === layerId);\n if (!deckLayer) continue;\n\n const hasDataFilterExtension = deckLayer.props?.extensions?.some(\n (ext) => ext?.constructor?.name === 'DataFilterExtension',\n );\n\n if (!hasDataFilterExtension) {\n console.warn(\n `[VControlLegend] deck.gl layer \"${layerId}\" requires DataFilterExtension for filtering. ` +\n 'Add DataFilterExtension to layer extensions and configure getFilterValue accessor.',\n );\n continue;\n }\n\n if (typeof deckLayer.clone !== 'function') continue;\n\n if (allVisible) {\n const updatedLayer = deckLayer.clone({\n filterRange: [-Infinity, Infinity],\n });\n deckLayers.updateLayer(layerId, updatedLayer);\n } else if (visibleValues.length === 0) {\n const updatedLayer = deckLayer.clone({\n filterRange: [Infinity, Infinity],\n });\n deckLayers.updateLayer(layerId, updatedLayer);\n } else {\n const valueIndices = visibleValues\n .map((v) => categoryItems.value.findIndex((item) => item.value === v))\n .filter((i) => i >= 0);\n\n if (valueIndices.length > 0) {\n const minIndex = Math.min(...valueIndices);\n const maxIndex = Math.max(...valueIndices);\n const updatedLayer = deckLayer.clone({\n filterRange: [minIndex - 0.5, maxIndex + 0.5],\n });\n deckLayers.updateLayer(layerId, updatedLayer);\n }\n }\n }\n };\n\n const toggleItem = (item: CategoryLegendItem, index: number) => {\n if (!props.interactive) return;\n\n const currentVisible = categoryItemVisibility.value.get(item.value) ?? true;\n const newVisible = !currentVisible;\n categoryItemVisibility.value.set(item.value, newVisible);\n\n applyFilterToMapLibreLayers();\n applyFilterToDeckglLayers();\n\n emit('item-click', { item, index, visible: newVisible });\n emit('filter-change', {\n filter: filterState.value,\n layerIds: props.layerIds,\n });\n emit('update:filter', filterState.value);\n };\n\n const isItemVisible = (item: CategoryLegendItem) => {\n return categoryItemVisibility.value.get(item.value) ?? true;\n };\n\n const toggleCollapse = () => {\n isCollapsed.value = !isCollapsed.value;\n };\n\n watch(\n () => props.items,\n () => {\n initVisibility();\n },\n { deep: true },\n );\n\n watch(\n () => props.collapsed,\n (newValue) => {\n isCollapsed.value = newValue;\n },\n );\n\n onMounted(() => {\n if (props.autoGenerate) {\n generatedItems.value = generateLegendFromPaint();\n }\n initVisibility();\n });\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"v-legend-control\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n >\n <button\n type=\"button\"\n class=\"v-legend-control-header\"\n @click=\"toggleCollapse\"\n >\n <span class=\"v-legend-control-title\">{{ title }}</span>\n <svg\n class=\"v-legend-control-chevron\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n >\n <path\n d=\"M3 5L7 9L11 5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <div v-if=\"!isCollapsed\" class=\"v-legend-control-content\">\n <template v-if=\"type === 'category'\">\n <button\n v-for=\"(item, index) in categoryItems\"\n :key=\"item.value\"\n type=\"button\"\n class=\"v-legend-control-item\"\n :class=\"{\n 'is-interactive': interactive,\n 'is-hidden': !isItemVisible(item),\n }\"\n :disabled=\"!interactive\"\n @click=\"toggleItem(item, index)\"\n >\n <span\n class=\"v-legend-control-swatch\"\n :style=\"{ backgroundColor: item.color }\"\n ></span>\n <span class=\"v-legend-control-label\">{{ item.label }}</span>\n <span v-if=\"item.count !== undefined\" class=\"v-legend-control-count\">\n {{ item.count }}\n </span>\n </button>\n </template>\n\n <template v-else-if=\"type === 'gradient' && gradientItem\">\n <div\n class=\"v-legend-control-gradient\"\n :style=\"{ background: gradientStyle }\"\n ></div>\n <div class=\"v-legend-control-gradient-labels\">\n <span>{{ gradientItem.minLabel ?? gradientItem.min }}</span>\n <span>{{ gradientItem.maxLabel ?? gradientItem.max }}</span>\n </div>\n </template>\n\n <template v-else-if=\"type === 'size'\">\n <div\n v-for=\"item in sizeItems\"\n :key=\"item.value\"\n class=\"v-legend-control-size-item\"\n >\n <div class=\"v-legend-control-size-circle-wrap\">\n <div\n class=\"v-legend-control-size-circle\"\n :style=\"{\n width: `${Math.min(item.size, 20)}px`,\n height: `${Math.min(item.size, 20)}px`,\n }\"\n ></div>\n </div>\n <span class=\"v-legend-control-label\">{{ item.label }}</span>\n </div>\n </template>\n\n <template v-else-if=\"type === 'table'\">\n <div class=\"v-legend-control-table\">\n <div\n v-for=\"item in tableItems\"\n :key=\"item.label\"\n class=\"v-legend-control-table-row\"\n :title=\"item.description\"\n >\n <span\n class=\"v-legend-control-swatch\"\n :style=\"{ backgroundColor: item.color }\"\n ></span>\n <span class=\"v-legend-control-table-label\">{{ item.label }}</span>\n <span class=\"v-legend-control-table-value\">\n {{ formatTableValue(item) }}\n </span>\n </div>\n </div>\n </template>\n </div>\n\n <slot></slot>\n </div>\n</template>\n\n<style>\n .v-legend-control {\n min-width: 140px;\n max-width: 200px;\n margin: 10px;\n background: var(--color-card, #fff);\n border-radius: var(--radius, 0.5rem);\n border: 1px solid var(--color-border, #e5e7eb);\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n sans-serif;\n font-size: 12px;\n overflow: hidden;\n /* Required: MapLibre control containers have pointer-events:none */\n pointer-events: auto;\n }\n\n .v-legend-control-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n min-height: 44px;\n padding: 8px 10px;\n border: none;\n border-bottom: 1px solid var(--color-border, #e5e7eb);\n background: transparent;\n cursor: pointer;\n text-align: left;\n line-height: 1;\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n }\n\n .v-legend-control.is-collapsed .v-legend-control-header {\n border-bottom: none;\n }\n\n .v-legend-control-header:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-legend-control-title {\n font-weight: 500;\n font-size: 13px;\n color: var(--color-card-foreground, #111827);\n line-height: 1;\n }\n\n .v-legend-control-chevron {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n color: var(--color-muted-foreground, #6b7280);\n transition: transform 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-legend-control-chevron.is-collapsed {\n transform: rotate(-90deg);\n }\n\n .v-legend-control-content {\n padding: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .v-legend-control-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 6px 8px;\n border: none;\n border-radius: calc(var(--radius, 0.5rem) - 4px);\n background: transparent;\n text-align: left;\n transition:\n background 0.1s ease,\n opacity 0.1s ease;\n }\n\n .v-legend-control-item.is-interactive {\n cursor: pointer;\n }\n\n .v-legend-control-item.is-interactive:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-legend-control-item.is-hidden {\n opacity: 0.4;\n }\n\n .v-legend-control-item.is-hidden .v-legend-control-label {\n text-decoration: line-through;\n }\n\n .v-legend-control-item:disabled {\n cursor: default;\n }\n\n .v-legend-control-swatch {\n width: 12px;\n height: 12px;\n border-radius: 3px;\n flex-shrink: 0;\n box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);\n }\n\n .v-legend-control-label {\n flex: 1;\n font-size: 11px;\n font-weight: 500;\n color: var(--color-foreground, #374151);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .v-legend-control-count {\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n background: var(--color-secondary, #f3f4f6);\n padding: 1px 5px;\n border-radius: 8px;\n }\n\n .v-legend-control-gradient {\n height: 12px;\n border-radius: 3px;\n margin: 6px 8px 4px;\n }\n\n .v-legend-control-gradient-labels {\n display: flex;\n justify-content: space-between;\n padding: 0 8px 6px;\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n }\n\n .v-legend-control-size-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n }\n\n .v-legend-control-size-circle-wrap {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .v-legend-control-size-circle {\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);\n }\n\n .v-legend-control-table {\n max-height: 300px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 1px;\n }\n\n .v-legend-control-table-row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n border-radius: calc(var(--radius, 0.5rem) - 4px);\n }\n\n .v-legend-control-table-row:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-legend-control-table-label {\n flex: 1;\n font-size: 11px;\n font-weight: 500;\n color: var(--color-foreground, #374151);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .v-legend-control-table-value {\n font-size: 10px;\n font-weight: 600;\n color: var(--color-muted-foreground, #6b7280);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n }\n\n .v-legend-control:has(.v-legend-control-table) {\n max-width: 280px;\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n CanvasSourceSpecification,\n LayerSpecification,\n Map,\n } from 'maplibre-gl';\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = withDefaults(\n defineProps<{\n source: CanvasSourceSpecification;\n layer: LayerSpecification;\n sourceId?: string;\n layerId?: string;\n before?: string;\n }>(),\n {\n sourceId: 'maplibre.gl-canvas-source',\n layerId: 'maplibre.gl-canvas-layer',\n before: '',\n },\n );\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding Canvas layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // For canvas sources, we need to remove and re-add both source and layer\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n mapInstance.addLayer(layerSpec, props.before);\n } catch (error) {\n console.error('Error updating Canvas source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Canvas layer:', error);\n }\n };\n\n // Watchers\n watch(() => props.source, updateSource, { deep: true });\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n addLayer();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up Canvas layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<!-- web/app/lib/v-mapbox/layers/maplibre/geojson/VLayerMaplibreGeojson.vue -->\n<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch, nextTick } from 'vue';\n import type {\n GeoJSONSource,\n GeoJSONSourceSpecification,\n LayerSpecification,\n Map,\n MapLayerMouseEvent,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../utils';\n\n interface LayerClick {\n features: GeoJSON.Feature[];\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n sourceId: string;\n layerId: string;\n source: GeoJSONSourceSpecification;\n layer: LayerSpecification;\n before?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sourceId: 'maplibre-gl-geojson-source',\n layerId: 'maplibre-gl-geojson-layer',\n before: '',\n });\n\n const emit = defineEmits<{\n 'on-click': [event: LayerClick];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper to check if data is valid GeoJSON with features\n const hasValidData = (\n data: string | GeoJSON.GeoJSON | undefined,\n ): boolean => {\n if (!data || typeof data === 'string') return false;\n if (data && typeof data === 'object' && 'type' in data) {\n if (data.type === 'FeatureCollection' && 'features' in data) {\n return data.features.length > 0;\n }\n // Also valid for single Feature or Geometry\n return (\n data.type === 'Feature' ||\n data.type === 'Point' ||\n data.type === 'LineString' ||\n data.type === 'Polygon' ||\n data.type === 'MultiPoint' ||\n data.type === 'MultiLineString' ||\n data.type === 'MultiPolygon'\n );\n }\n return false;\n };\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n const instance = map.value || null;\n return instance;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) {\n return;\n }\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) {\n return;\n }\n\n // For clustering support, wait for valid data before adding source/layer\n if (!hasValidData(props.source.data)) {\n console.log(\n `[${props.layerId}] Waiting for valid data before adding layer`,\n );\n return;\n }\n\n try {\n // Only add source if it doesn't exist\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n\n // Only add layer if it doesn't exist\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding GeoJSON layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as\n | GeoJSONSource\n | undefined;\n\n if (source && 'setData' in source) {\n // CRITICAL FIX: Only update data if source doesn't have clustering\n // or if this is the first/primary layer for this source\n const existingLayers = mapInstance\n .getStyle()\n .layers.filter(\n (l) =>\n l.type !== 'background' &&\n 'source' in l &&\n l.source === props.sourceId,\n );\n\n // Only update data if this is the first layer using this source\n // This prevents breaking clustering when multiple layers share a source\n if (\n existingLayers.length === 0 ||\n existingLayers[0]?.id === props.layerId\n ) {\n source.setData(props.source.data);\n }\n } else if (!source) {\n // If source doesn't exist, try to add the layer\n addLayer();\n }\n } catch (error) {\n console.error('Error updating GeoJSON source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n // Update paint properties\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n // Update layout properties\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n } else {\n // If layer doesn't exist, try to add it\n addLayer();\n }\n } catch (error) {\n console.error('Error updating GeoJSON layer:', error);\n }\n };\n\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance) {\n return;\n }\n\n try {\n // Add click handler for the specific layer\n mapInstance.on('click', props.layerId, (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('on-click', {\n features: e.features,\n coordinates: e.lngLat,\n });\n }\n });\n\n // Add hover effect to verify interactivity\n mapInstance.on('mouseenter', props.layerId, () => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n });\n\n mapInstance.on('mouseleave', props.layerId, () => {\n mapInstance.getCanvas().style.cursor = '';\n });\n } catch (error) {\n console.error('Error in setupLayerEvents:', error);\n }\n };\n\n // Track if layer has been initialized to prevent duplicate setup\n const initialized = ref(false);\n\n // Initialize layer - single entry point to prevent race conditions\n const initializeLayer = async () => {\n if (initialized.value) return;\n\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n if (!hasValidData(props.source.data)) return;\n\n // Use nextTick to ensure Vue has finished setup\n await nextTick();\n\n // Double-check conditions after nextTick\n if (initialized.value) return;\n if (!mapInstance.isStyleLoaded()) return;\n\n addLayer();\n setupLayerEvents(mapInstance);\n initialized.value = true;\n };\n\n // Watch loaded state - MUST be defined BEFORE watch(map) to catch immediate changes\n watch(loaded, (value) => {\n if (value) {\n initializeLayer();\n }\n });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n // Check if style is already loaded\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n // Also try to initialize directly in case watch(loaded) already fired\n initializeLayer();\n }\n }\n },\n { immediate: true },\n );\n\n // Watchers for updates after initialization\n watch(\n () => props.source,\n (newSource, oldSource) => {\n // Wait for valid data before doing anything\n if (!hasValidData(newSource?.data)) {\n return;\n }\n\n // Only update if the data actually changed\n if (JSON.stringify(newSource.data) !== JSON.stringify(oldSource?.data)) {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n // If source doesn't exist yet, add the whole layer\n if (!mapInstance.getSource(props.sourceId)) {\n addLayer();\n if (!initialized.value) {\n setupLayerEvents(mapInstance);\n initialized.value = true;\n }\n } else {\n // Source exists, just update data\n updateSource();\n }\n }\n }\n },\n { deep: true },\n );\n\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for visibility changes\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer && newVisibility === 'visible') {\n // Add layer if it doesn't exist and should be visible\n if (hasValidData(props.source.data)) {\n addLayer();\n }\n } else if (hasLayer) {\n // Update visibility of existing layer\n try {\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n } catch (error) {\n console.error(\n `Error updating visibility for ${props.layerId}:`,\n error,\n );\n }\n }\n },\n { immediate: true },\n );\n\n // Lifecycle hooks\n onMounted(() => {\n // Use nextTick to ensure all watchers are set up\n nextTick(() => {\n initializeLayer();\n });\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Remove layer\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n\n // Only remove source if no other layers are using it\n const layersUsingSource = mapInstance\n .getStyle()\n .layers.filter(\n (l) =>\n l.type !== 'background' &&\n 'source' in l &&\n l.source === props.sourceId,\n );\n\n if (\n layersUsingSource.length === 0 &&\n mapInstance.getSource(props.sourceId)\n ) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up GeoJSON layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type {\n LayerSpecification as AnyLayer,\n ImageSourceSpecification as ImageSourceRaw,\n ImageSource,\n Map,\n } from 'maplibre-gl';\n import type { PropType, Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps({\n sourceId: {\n type: String,\n default: 'maplibre.gl-image-source',\n required: true,\n },\n layerId: {\n type: String,\n default: 'maplibre.gl-image-layer',\n required: true,\n },\n source: {\n type: Object as PropType<ImageSourceRaw>,\n required: true,\n },\n layer: {\n type: Object as PropType<AnyLayer>,\n default: () => ({}),\n required: true,\n },\n before: {\n type: String,\n default: '',\n required: false,\n },\n });\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding Image layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as ImageSource;\n if (source) {\n // For image sources, we need to update coordinates and url\n if (source.updateImage) {\n source.updateImage({\n url: props.source.url,\n coordinates: props.source.coordinates,\n });\n } else {\n // If updateImage is not available, remove and re-add the source and layer\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n }\n }\n } catch (error) {\n console.error('Error updating Image source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Image layer:', error);\n }\n };\n\n // Watchers\n watch(() => props.source, updateSource, { deep: true });\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n addLayer();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up Image layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type {\n RasterSourceSpecification,\n RasterLayerSpecification,\n Map,\n } from 'maplibre-gl';\n import type { Ref } from 'vue';\n import { onMounted, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps<{\n sourceId: string;\n source: RasterSourceSpecification;\n layerId: string;\n layer: RasterLayerSpecification;\n before?: string;\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n // Always add with proper ordering\n mapInstance.addLayer(props.layer, props.before);\n\n // Set initial visibility\n if (props.layer.layout?.visibility) {\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n props.layer.layout.visibility,\n );\n }\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Store the current beforeId since we'll need to reuse it\n const beforeId = props.before;\n\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n mapInstance.removeSource(props.sourceId);\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n type: 'raster',\n source: props.sourceId,\n } as RasterLayerSpecification;\n\n // Explicitly check if the beforeId layer exists before adding\n if (beforeId && mapInstance.getLayer(beforeId)) {\n mapInstance.addLayer(layerSpec, beforeId);\n } else {\n mapInstance.addLayer(layerSpec);\n }\n } catch (error) {\n console.error('Error updating Raster source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n // Update paint properties\n const paint = props.layer.paint || {};\n Object.entries(paint).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n\n // Update layout properties\n const layout = props.layer.layout || {};\n Object.entries(layout).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Raster layer:', error);\n }\n };\n\n // Watchers\n watch(\n () => props.source.tiles?.[0], // Usually raster sources have a single tile URL\n (newTileUrl, oldTileUrl) => {\n if (newTileUrl !== oldTileUrl) {\n updateSource();\n }\n },\n );\n watch(() => props.layer, updateLayer, { deep: true });\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer) {\n // Add layer with proper ordering\n try {\n mapInstance.addLayer(props.layer, props.before);\n } catch (error) {\n console.error(`[${props.layerId}] Error adding layer:`, error);\n }\n } else {\n try {\n // Update visibility\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n\n // If becoming visible, ensure proper layer ordering\n if (newVisibility === 'visible' && props.before) {\n mapInstance.moveLayer(props.layerId, props.before);\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error updating visibility:`, error);\n }\n }\n },\n { immediate: true },\n );\n watch(\n () => props.before,\n (newBefore) => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.getLayer(props.layerId)) return;\n\n // Only move layer if it's visible\n if (props.layer.layout?.visibility === 'visible') {\n try {\n console.log(`[${props.layerId}] Moving layer before:`, newBefore);\n mapInstance.moveLayer(props.layerId, newBefore);\n } catch (error) {\n console.error(`[${props.layerId}] Error moving layer:`, error);\n }\n }\n },\n );\n\n // Also add logging for source and layer setup\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) {\n return;\n }\n try {\n addLayer();\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","import type { MapLayerEventType } from 'maplibre-gl';\n\nexport const mapLayerEvents: Array<keyof MapLayerEventType> = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mouseup',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'contextmenu',\n 'touchstart',\n 'touchend',\n 'touchcancel',\n];\n","import type { MapEventType } from 'maplibre-gl';\n\nexport const mapEvents: Array<keyof MapEventType> = [\n 'error',\n 'load',\n 'idle',\n 'remove',\n 'render',\n 'resize',\n 'webglcontextlost',\n 'webglcontextrestored',\n 'dataloading',\n 'data',\n 'tiledataloading',\n 'sourcedataloading',\n 'styledataloading',\n 'sourcedata',\n 'styledata',\n 'boxzoomcancel',\n 'boxzoomstart',\n 'boxzoomend',\n 'touchcancel',\n 'touchmove',\n 'touchend',\n 'touchstart',\n 'click',\n 'contextmenu',\n 'dblclick',\n 'mousemove',\n 'mouseup',\n 'mousedown',\n 'mouseout',\n 'mouseover',\n 'movestart',\n 'move',\n 'moveend',\n 'zoomstart',\n 'zoom',\n 'zoomend',\n 'rotatestart',\n 'rotate',\n 'rotateend',\n 'dragstart',\n 'drag',\n 'dragend',\n 'pitchstart',\n 'pitch',\n 'pitchend',\n 'wheel',\n];\n","export const markerMapEvents = ['dragstart', 'drag', 'dragend'];\nexport const markerDOMEvents = ['click', 'mouseenter', 'mouseleave'];\n","export const popupEvents = ['open', 'close'] as Array<'open' | 'close'>;\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, ref, watch } from 'vue';\n import type {\n Map,\n VectorSourceSpecification,\n LayerSpecification,\n } from 'maplibre-gl';\n import { mapLayerEvents } from '../../../constants/events';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps<{\n sourceId: string;\n source: VectorSourceSpecification;\n layerId: string;\n layer: LayerSpecification;\n before?: string;\n }>();\n const emit = defineEmits([...mapLayerEvents]);\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n // Always get a fresh beforeId when adding a layer\n if (props.layer.layout?.visibility === 'visible') {\n mapInstance.addLayer(props.layer, props.before);\n } else {\n // For hidden layers, just add them without worrying about order\n mapInstance.addLayer(props.layer);\n }\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n };\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const existingSource = mapInstance.getSource(props.sourceId);\n // Only update source if it has actually changed\n if (\n existingSource &&\n JSON.stringify(existingSource.serialize()) !==\n JSON.stringify(props.source)\n ) {\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n mapInstance.removeSource(props.sourceId);\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error updating vector source:', error);\n }\n };\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n // Get current paint and layout properties\n const currentLayer = mapInstance.getLayer(props.layerId);\n const currentPaint = (currentLayer?.paint || {}) as Record<\n string,\n unknown\n >;\n const currentLayout = (currentLayer?.layout || {}) as Record<\n string,\n unknown\n >;\n\n // Only update properties that have changed\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n if (JSON.stringify(currentPaint[key]) !== JSON.stringify(value)) {\n mapInstance.setPaintProperty(props.layerId, key, value);\n }\n });\n\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n if (JSON.stringify(currentLayout[key]) !== JSON.stringify(value)) {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n }\n });\n }\n } catch (error) {\n console.error('Error updating vector layer:', error);\n }\n };\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n try {\n mapLayerEvents.forEach((eventName) => {\n mapInstance.on(eventName, props.layerId, (e) => {\n if (eventName === 'mousemove') {\n mapInstance.getCanvas().style.cursor = 'pointer';\n }\n if (eventName === 'mouseleave') {\n mapInstance.getCanvas().style.cursor = '';\n }\n emit(eventName, e);\n });\n });\n } catch (error) {\n console.error('Error setting up layer events:', error);\n }\n };\n\n // Watchers\n watch(\n map,\n (newMap, oldMap) => {\n if (newMap && newMap !== oldMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n watch(loaded, (value) => {\n if (value) {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n addLayer();\n setupLayerEvents(mapInstance);\n }\n });\n watch(\n () => JSON.stringify(props.source.tiles),\n (newTiles, oldTiles) => {\n if (newTiles !== oldTiles) {\n updateSource();\n }\n },\n );\n watch(\n () => ({\n paint: props.layer.paint,\n // Watch layout changes but exclude visibility since it's handled separately\n layout: props.layer.layout\n ? { ...props.layer.layout, visibility: undefined }\n : undefined,\n }),\n (newValue, oldValue) => {\n if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {\n updateLayer();\n }\n },\n { deep: true },\n );\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer) {\n // Add layer if it doesn't exist\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n mapInstance.addLayer(props.layer, props.before);\n } catch (error) {\n console.error(`[${props.layerId}] Error adding layer:`, error);\n }\n } else {\n try {\n // Update visibility\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n\n // If becoming visible, ensure proper layer order\n if (newVisibility === 'visible' && props.before) {\n // Small timeout to ensure target layer is ready\n setTimeout(() => {\n mapInstance.moveLayer(props.layerId, props.before);\n }, 0);\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error updating visibility:`, error);\n }\n }\n },\n { immediate: true },\n );\n watch(\n () => props.before,\n (newBefore) => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.getLayer(props.layerId)) return;\n\n // Only move visible layers\n if (props.layer.layout?.visibility === 'visible') {\n try {\n mapInstance.moveLayer(props.layerId, newBefore);\n } catch (error) {\n console.error(\n `Error reordering vector layer ${props.layerId}:`,\n error,\n );\n }\n }\n },\n );\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer) {\n // Only add layer if it doesn't exist\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n mapInstance.addLayer(props.layer, props.before);\n } catch (error) {\n console.error(`[${props.layerId}] Error adding layer:`, error);\n }\n } else {\n // Just update visibility if layer exists\n try {\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n } catch (error) {\n console.error(`[${props.layerId}] Error updating visibility:`, error);\n }\n }\n },\n { immediate: true },\n );\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) {\n return;\n }\n try {\n addLayer();\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type {\n LayerSpecification as AnyLayer,\n VideoSourceSpecification,\n VideoSource,\n Map,\n } from 'maplibre-gl';\n import type { PropType, Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps({\n sourceId: {\n type: String,\n default: 'maplibre.gl-video-source',\n required: true,\n },\n layerId: {\n type: String,\n default: 'maplibre.gl-video-layer',\n required: true,\n },\n source: {\n type: Object as PropType<VideoSourceSpecification>,\n required: true,\n },\n layer: {\n type: Object as PropType<AnyLayer>,\n default: () => ({}),\n required: true,\n },\n before: {\n type: String,\n default: '',\n required: false,\n },\n });\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding Video layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as VideoSource;\n if (source) {\n // For video sources, we need to remove and re-add since there's no direct update method\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n\n // Additional video-specific operations if needed\n if (source.getVideo) {\n const videoElement = source.getVideo();\n if (videoElement) {\n // Handle video element updates if needed\n videoElement.play().catch((error) => {\n console.error('Error playing video:', error);\n });\n }\n }\n }\n } catch (error) {\n console.error('Error updating Video source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Video layer:', error);\n }\n };\n\n // Watchers\n watch(() => props.source, updateSource, { deep: true });\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n addLayer();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as VideoSource;\n if (source?.getVideo) {\n const videoElement = source.getVideo();\n if (videoElement) {\n // Stop and cleanup video if needed\n videoElement.pause();\n videoElement.remove();\n }\n }\n\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up Video layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { PMTiles } from 'pmtiles';\n import { inject, onMounted, ref } from 'vue';\n import type { PropType } from 'vue';\n import type {\n RasterLayerSpecification,\n RasterSourceSpecification,\n } from 'maplibre-gl';\n import VLayerMaplibreRaster from '../raster/VLayerMaplibreRaster.vue';\n import { PMTileProtocolKey } from '../../../utils/symbols';\n\n const props = defineProps({\n sourceId: {\n type: String,\n default: 'maplibre.gl-pmtile-source',\n required: true,\n },\n layerId: {\n type: String,\n default: 'maplibre.gl-pmtile-layer',\n required: true,\n },\n url: {\n type: String,\n required: true,\n },\n layer: {\n type: Object as PropType<RasterLayerSpecification>,\n default: () => ({}),\n required: true,\n },\n before: {\n type: String,\n default: '',\n required: false,\n },\n });\n\n const protocol = inject(PMTileProtocolKey);\n if (!protocol) {\n throw new Error('Protocol not provided');\n }\n\n const source = ref<RasterSourceSpecification>({\n type: 'raster',\n url: `pmtiles://${props.url}`,\n tileSize: 512,\n volatile: true,\n });\n onMounted(async () => {\n const p = new PMTiles(props.url);\n protocol.add(p);\n // Optional: You could fetch the header here if you need metadata\n // const header = await p.getHeader();\n });\n</script>\n\n<template>\n <VLayerMaplibreRaster\n :source-id=\"sourceId\"\n :layer-id=\"layerId\"\n :source=\"source\"\n :layer=\"{\n ...layer,\n type: 'raster',\n }\"\n :before=\"before\"\n ></VLayerMaplibreRaster>\n</template>\n","<!-- web/app/lib/v-mapbox/layers/maplibre/cluster/VLayerMaplibreCluster.vue -->\n<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch, computed } from 'vue';\n import type {\n GeoJSONSource,\n GeoJSONSourceSpecification,\n CircleLayerSpecification,\n SymbolLayerSpecification,\n Map,\n MapLayerMouseEvent,\n DataDrivenPropertyValueSpecification,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface LayerClick {\n features: GeoJSON.Feature[];\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n sourceId: string;\n baseLayerId: string;\n source: GeoJSONSourceSpecification;\n visibility?: boolean;\n clusterPaint?: {\n colors?: string[];\n radii?: number[];\n breakpoints?: number[];\n };\n unclusteredPaint?: {\n color?: DataDrivenPropertyValueSpecification<string>;\n radius?: number;\n };\n textPaint?: {\n color?: string;\n font?: string[];\n size?: number;\n };\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sourceId: 'cluster-source',\n baseLayerId: 'cluster',\n visibility: true,\n clusterPaint: () => ({\n colors: ['#51bbd6', '#f1f075', '#f28cb1'],\n radii: [20, 30, 40],\n breakpoints: [100, 750],\n }),\n unclusteredPaint: () => ({\n color: '#51bbd6',\n radius: 6,\n }),\n textPaint: () => ({\n color: '#ffffff',\n font: ['DIN Offc Pro Medium', 'Arial Unicode MS Bold'],\n size: 12,\n }),\n });\n\n const emit = defineEmits<{\n 'cluster-click': [event: LayerClick];\n 'point-click': [event: LayerClick];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Layer IDs\n const clustersLayerId = computed(() => `${props.baseLayerId}-clusters`);\n const clusterCountLayerId = computed(\n () => `${props.baseLayerId}-cluster-count`,\n );\n const unclusteredLayerId = computed(\n () => `${props.baseLayerId}-unclustered-point`,\n );\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Helper to check if data is valid GeoJSON with features\n const hasValidData = (data: string | GeoJSON.GeoJSON): boolean => {\n if (typeof data === 'string') return false;\n if (data && typeof data === 'object' && 'type' in data) {\n if (data.type === 'FeatureCollection' && 'features' in data) {\n return data.features.length > 0;\n }\n }\n return false;\n };\n\n // Add all cluster-related layers at once\n const addClusterLayers = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) {\n return;\n }\n\n try {\n // 1. Add source if it doesn't exist\n if (!mapInstance.getSource(props.sourceId)) {\n console.log(`Adding clustered source: ${props.sourceId}`);\n mapInstance.addSource(props.sourceId, {\n ...props.source,\n cluster: true,\n clusterMaxZoom: 14,\n clusterRadius: 50,\n });\n } else {\n // If source exists, update its data\n const source = mapInstance.getSource(props.sourceId) as GeoJSONSource;\n if (source && 'setData' in source) {\n source.setData(props.source.data);\n }\n }\n\n // 2. Add clusters layer\n if (!mapInstance.getLayer(clustersLayerId.value)) {\n console.log(`Adding clusters layer: ${clustersLayerId.value}`);\n mapInstance.addLayer({\n id: clustersLayerId.value,\n type: 'circle',\n source: props.sourceId,\n filter: ['has', 'point_count'],\n paint: {\n 'circle-color': [\n 'step',\n ['get', 'point_count'],\n props.clusterPaint.colors![0]!,\n props.clusterPaint.breakpoints![0]!,\n props.clusterPaint.colors![1]!,\n props.clusterPaint.breakpoints![1]!,\n props.clusterPaint.colors![2]!,\n ],\n 'circle-radius': [\n 'step',\n ['get', 'point_count'],\n props.clusterPaint.radii![0]!,\n props.clusterPaint.breakpoints![0]!,\n props.clusterPaint.radii![1]!,\n props.clusterPaint.breakpoints![1]!,\n props.clusterPaint.radii![2]!,\n ],\n 'circle-stroke-width': 2,\n 'circle-stroke-color': '#ffffff',\n 'circle-opacity': 0.9,\n },\n layout: {\n visibility: props.visibility ? 'visible' : 'none',\n },\n } as CircleLayerSpecification);\n }\n\n // 3. Add cluster count text layer\n if (!mapInstance.getLayer(clusterCountLayerId.value)) {\n console.log(`Adding cluster count layer: ${clusterCountLayerId.value}`);\n mapInstance.addLayer({\n id: clusterCountLayerId.value,\n type: 'symbol',\n source: props.sourceId,\n filter: ['has', 'point_count'],\n layout: {\n 'text-field': '{point_count_abbreviated}',\n 'text-font': props.textPaint.font!,\n 'text-size': props.textPaint.size!,\n visibility: props.visibility ? 'visible' : 'none',\n },\n paint: {\n 'text-color': props.textPaint.color!,\n },\n } as SymbolLayerSpecification);\n }\n\n // 4. Add unclustered points layer\n if (!mapInstance.getLayer(unclusteredLayerId.value)) {\n console.log(\n `Adding unclustered points layer: ${unclusteredLayerId.value}`,\n );\n mapInstance.addLayer({\n id: unclusteredLayerId.value,\n type: 'circle',\n source: props.sourceId,\n filter: ['!', ['has', 'point_count']],\n paint: {\n 'circle-color': props.unclusteredPaint.color!,\n 'circle-radius': props.unclusteredPaint.radius!,\n 'circle-stroke-width': 2,\n 'circle-stroke-color': '#ffffff',\n 'circle-opacity': 0.95,\n },\n layout: {\n visibility: props.visibility ? 'visible' : 'none',\n },\n } as CircleLayerSpecification);\n }\n\n console.log(`All cluster layers added for ${props.baseLayerId}`);\n\n // Setup click handlers after layers are added\n setupLayerEvents(mapInstance);\n } catch (error) {\n console.error('Error adding cluster layers:', error);\n }\n };\n\n // Update source data\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as\n | GeoJSONSource\n | undefined;\n if (source && 'setData' in source) {\n console.log(`Updating source ${props.sourceId} with data`);\n source.setData(props.source.data);\n\n // After updating data, ensure all layers are properly added\n // This fixes the issue where layers might not render correctly with initial empty data\n setTimeout(() => {\n // Re-add layers if they're missing (this won't duplicate them)\n addClusterLayers();\n }, 100);\n } else if (!source) {\n // Source doesn't exist, add all layers\n addClusterLayers();\n }\n } catch (error) {\n console.error('Error updating source:', error);\n }\n };\n\n // Update visibility for all layers\n const updateVisibility = (visible: boolean): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const visibility = visible ? 'visible' : 'none';\n\n [\n clustersLayerId.value,\n clusterCountLayerId.value,\n unclusteredLayerId.value,\n ].forEach((layerId) => {\n if (mapInstance.getLayer(layerId)) {\n mapInstance.setLayoutProperty(layerId, 'visibility', visibility);\n }\n });\n };\n\n // Setup click handlers for layers\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n try {\n // Click handler for clusters\n mapInstance.on(\n 'click',\n clustersLayerId.value,\n (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('cluster-click', {\n features: e.features,\n coordinates: e.lngLat,\n });\n }\n },\n );\n\n // Click handler for individual points\n mapInstance.on(\n 'click',\n unclusteredLayerId.value,\n (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('point-click', {\n features: e.features,\n coordinates: e.lngLat,\n });\n }\n },\n );\n\n // Add hover effects\n [clustersLayerId.value, unclusteredLayerId.value].forEach((layerId) => {\n mapInstance.on('mouseenter', layerId, () => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n });\n\n mapInstance.on('mouseleave', layerId, () => {\n mapInstance.getCanvas().style.cursor = '';\n });\n });\n } catch (error) {\n console.error('Error setting up layer events:', error);\n }\n };\n\n // Setup map\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const checkStyleLoaded = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(checkStyleLoaded, 200);\n } else {\n loaded.value = true;\n // Only add layers if we have data\n if (hasValidData(props.source.data)) {\n addClusterLayers();\n }\n }\n };\n checkStyleLoaded();\n });\n\n // If style is already loaded\n if (mapInstance.isStyleLoaded()) {\n loaded.value = true;\n // Only add layers if we have data\n if (hasValidData(props.source.data)) {\n addClusterLayers();\n }\n }\n };\n\n // Watchers\n watch(\n () => props.source.data,\n (newData) => {\n // Only proceed if we have actual data\n if (hasValidData(newData)) {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n // First time with data - add all layers\n if (!mapInstance.getSource(props.sourceId)) {\n addClusterLayers();\n } else {\n // Source exists, just update data\n updateSource();\n }\n }\n }\n },\n { deep: true, immediate: true },\n );\n\n watch(() => props.visibility, updateVisibility);\n\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Lifecycle\n onMounted(() => {\n const mapInstance = getMapInstance();\n // Only add layers if map is ready AND we have data\n if (mapInstance?.isStyleLoaded() && hasValidData(props.source.data)) {\n addClusterLayers();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Remove click handlers\n [clustersLayerId.value, unclusteredLayerId.value].forEach((layerId) => {\n mapInstance.off('click', layerId, () => {});\n mapInstance.off('mouseenter', layerId, () => {});\n mapInstance.off('mouseleave', layerId, () => {});\n });\n\n // Remove all layers\n [\n clustersLayerId.value,\n clusterCountLayerId.value,\n unclusteredLayerId.value,\n ].forEach((layerId) => {\n if (mapInstance.getLayer(layerId)) {\n mapInstance.removeLayer(layerId);\n }\n });\n\n // Remove source\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up cluster layers:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch, computed } from 'vue';\n import type {\n GeoJSONSource,\n Map,\n MapLayerMouseEvent,\n LineLayerSpecification,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface RouteClick {\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n /** Unique identifier for the route */\n id?: string;\n /** Array of [longitude, latitude] coordinate pairs defining the route */\n coordinates: [number, number][];\n /** Line color as CSS color value */\n color?: string;\n /** Line width in pixels */\n width?: number;\n /** Line opacity (0-1) */\n opacity?: number;\n /** Line cap style */\n lineCap?: 'butt' | 'round' | 'square';\n /** Line join style */\n lineJoin?: 'bevel' | 'round' | 'miter';\n /** Whether the route is visible */\n visible?: boolean;\n /** Whether the route is interactive (shows pointer cursor on hover) */\n interactive?: boolean;\n /** Render this layer before the specified layer */\n before?: string;\n /** Line dash array for dashed lines */\n dashArray?: number[];\n /** Line blur in pixels */\n blur?: number;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n id: () => `route-${Math.random().toString(36).slice(2, 9)}`,\n color: '#4285F4',\n width: 4,\n opacity: 1,\n lineCap: 'round',\n lineJoin: 'round',\n visible: true,\n interactive: true,\n before: '',\n blur: 0,\n });\n\n const emit = defineEmits<{\n click: [event: RouteClick];\n mouseenter: [];\n mouseleave: [];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n const sourceId = computed(() => `${props.id}-source`);\n const layerId = computed(() => `${props.id}-layer`);\n\n // Create GeoJSON data from coordinates\n const geojsonData = computed(\n (): GeoJSON.FeatureCollection<GeoJSON.LineString> => ({\n type: 'FeatureCollection',\n features:\n props.coordinates.length >= 2\n ? [\n {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: props.coordinates,\n },\n },\n ]\n : [],\n }),\n );\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup map style load listener\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n // Don't add if no valid coordinates\n if (props.coordinates.length < 2) return;\n\n try {\n // Only add source if it doesn't exist\n if (!mapInstance.getSource(sourceId.value)) {\n mapInstance.addSource(sourceId.value, {\n type: 'geojson',\n data: geojsonData.value,\n });\n }\n\n // Only add layer if it doesn't exist\n if (!mapInstance.getLayer(layerId.value)) {\n const layerSpec: LineLayerSpecification = {\n id: layerId.value,\n type: 'line',\n source: sourceId.value,\n layout: {\n 'line-cap': props.lineCap,\n 'line-join': props.lineJoin,\n visibility: props.visible ? 'visible' : 'none',\n },\n paint: {\n 'line-color': props.color,\n 'line-width': props.width,\n 'line-opacity': props.opacity,\n ...(props.blur > 0 && { 'line-blur': props.blur }),\n ...(props.dashArray && { 'line-dasharray': props.dashArray }),\n },\n };\n\n mapInstance.addLayer(layerSpec, props.before || undefined);\n }\n } catch (error) {\n console.error('Error adding route layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(sourceId.value) as\n | GeoJSONSource\n | undefined;\n\n if (source && 'setData' in source) {\n source.setData(geojsonData.value);\n } else if (!source && props.coordinates.length >= 2) {\n addLayer();\n }\n } catch (error) {\n console.error('Error updating route source:', error);\n }\n };\n\n const updateLayerStyle = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.getLayer(layerId.value)) return;\n\n try {\n // Update paint properties\n mapInstance.setPaintProperty(layerId.value, 'line-color', props.color);\n mapInstance.setPaintProperty(layerId.value, 'line-width', props.width);\n mapInstance.setPaintProperty(\n layerId.value,\n 'line-opacity',\n props.opacity,\n );\n\n if (props.blur > 0) {\n mapInstance.setPaintProperty(layerId.value, 'line-blur', props.blur);\n }\n if (props.dashArray) {\n mapInstance.setPaintProperty(\n layerId.value,\n 'line-dasharray',\n props.dashArray,\n );\n }\n\n // Update layout properties\n mapInstance.setLayoutProperty(layerId.value, 'line-cap', props.lineCap);\n mapInstance.setLayoutProperty(layerId.value, 'line-join', props.lineJoin);\n mapInstance.setLayoutProperty(\n layerId.value,\n 'visibility',\n props.visible ? 'visible' : 'none',\n );\n } catch (error) {\n console.error('Error updating route layer style:', error);\n }\n };\n\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance || !props.interactive) return;\n\n try {\n // Click handler\n mapInstance.on('click', layerId.value, (e: MapLayerMouseEvent) => {\n emit('click', {\n coordinates: e.lngLat,\n });\n });\n\n // Hover effects\n mapInstance.on('mouseenter', layerId.value, () => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n emit('mouseenter');\n });\n\n mapInstance.on('mouseleave', layerId.value, () => {\n mapInstance.getCanvas().style.cursor = '';\n emit('mouseleave');\n });\n } catch (error) {\n console.error('Error setting up route layer events:', error);\n }\n };\n\n // Watch for coordinate changes\n watch(\n () => props.coordinates,\n () => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n if (!mapInstance.getSource(sourceId.value)) {\n addLayer();\n } else {\n updateSource();\n }\n }\n },\n { deep: true },\n );\n\n // Watch for style changes\n watch(\n () => [\n props.color,\n props.width,\n props.opacity,\n props.lineCap,\n props.lineJoin,\n props.visible,\n props.blur,\n props.dashArray,\n ],\n () => updateLayerStyle(),\n { deep: true },\n );\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n }\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value && props.coordinates.length >= 2) {\n const mapInstance = getMapInstance();\n if (mapInstance) {\n addLayer();\n setupLayerEvents(mapInstance);\n }\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n try {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded() && props.coordinates.length >= 2) {\n addLayer();\n setupLayerEvents(mapInstance);\n }\n } catch (error) {\n console.error('Error mounting route layer:', error);\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(layerId.value)) {\n mapInstance.removeLayer(layerId.value);\n }\n if (mapInstance.getSource(sourceId.value)) {\n mapInstance.removeSource(sourceId.value);\n }\n } catch (error) {\n console.error('Error cleaning up route layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import {\n onMounted,\n onBeforeUnmount,\n ref,\n watch,\n computed,\n nextTick,\n } from 'vue';\n import type {\n GeoJSONSource,\n Map,\n MapLayerMouseEvent,\n FillLayerSpecification,\n LineLayerSpecification,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface IsochroneFeature {\n type: 'Feature';\n properties: {\n color: string;\n contour?: number;\n metric?: string;\n [key: string]: unknown;\n };\n geometry: GeoJSON.Polygon | GeoJSON.MultiPolygon;\n }\n\n interface IsochroneData {\n type: 'FeatureCollection';\n features: IsochroneFeature[];\n }\n\n interface IsochroneClick {\n feature: IsochroneFeature;\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n /** Unique identifier for the isochrone layer */\n id?: string;\n /** GeoJSON FeatureCollection with isochrone polygons (from Valhalla, OSRM, etc.) */\n data: IsochroneData | null;\n /** Fill opacity (0-1) */\n fillOpacity?: number;\n /** Line width in pixels for polygon outlines */\n lineWidth?: number;\n /** Line opacity (0-1) */\n lineOpacity?: number;\n /** Whether the layer is visible */\n visible?: boolean;\n /** Whether the layer is interactive (shows pointer cursor on hover) */\n interactive?: boolean;\n /** Render this layer before the specified layer */\n before?: string;\n /** Whether to reverse the feature order (for proper stacking of overlapping polygons) */\n reverseOrder?: boolean;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n id: () => `isochrone-${Math.random().toString(36).slice(2, 9)}`,\n fillOpacity: 0.4,\n lineWidth: 2,\n lineOpacity: 0.8,\n visible: true,\n interactive: true,\n before: '',\n reverseOrder: true,\n });\n\n const emit = defineEmits<{\n click: [event: IsochroneClick];\n mouseenter: [feature: IsochroneFeature];\n mouseleave: [];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n const initialized = ref(false);\n\n const sourceId = computed(() => `${props.id}-source`);\n const fillLayerId = computed(() => `${props.id}-fill`);\n const lineLayerId = computed(() => `${props.id}-line`);\n\n /**\n * Process the GeoJSON data:\n * 1. Optionally reverse feature order for proper polygon stacking\n * 2. Add fillColor property with # prefix (Valhalla returns colors without #)\n */\n const processedData = computed((): IsochroneData | null => {\n if (!props.data || !props.data.features || props.data.features.length === 0)\n return null;\n\n const features = props.reverseOrder\n ? [...props.data.features].reverse()\n : props.data.features;\n\n return {\n type: 'FeatureCollection',\n features: features.map((f) => ({\n ...f,\n properties: {\n ...f.properties,\n // Add # prefix if color doesn't have it (Valhalla format)\n fillColor: f.properties.color.startsWith('#')\n ? f.properties.color\n : `#${f.properties.color}`,\n },\n })),\n };\n });\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup map style load listener\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayers = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n const data = processedData.value;\n if (!data) return;\n\n try {\n // Add source if it doesn't exist\n if (!mapInstance.getSource(sourceId.value)) {\n mapInstance.addSource(sourceId.value, {\n type: 'geojson',\n data,\n });\n }\n\n // Add fill layer\n if (!mapInstance.getLayer(fillLayerId.value)) {\n const fillLayerSpec: FillLayerSpecification = {\n id: fillLayerId.value,\n type: 'fill',\n source: sourceId.value,\n layout: {\n visibility: props.visible ? 'visible' : 'none',\n },\n paint: {\n 'fill-color': ['get', 'fillColor'],\n 'fill-opacity': props.fillOpacity,\n },\n };\n\n mapInstance.addLayer(fillLayerSpec, props.before || undefined);\n }\n\n // Add line layer\n if (!mapInstance.getLayer(lineLayerId.value)) {\n const lineLayerSpec: LineLayerSpecification = {\n id: lineLayerId.value,\n type: 'line',\n source: sourceId.value,\n layout: {\n visibility: props.visible ? 'visible' : 'none',\n },\n paint: {\n 'line-color': ['get', 'fillColor'],\n 'line-width': props.lineWidth,\n 'line-opacity': props.lineOpacity,\n },\n };\n\n mapInstance.addLayer(lineLayerSpec, props.before || undefined);\n }\n } catch (error) {\n console.error('Error adding isochrone layers:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(sourceId.value) as\n | GeoJSONSource\n | undefined;\n\n const data = processedData.value;\n\n if (source && 'setData' in source) {\n if (data) {\n source.setData(data);\n }\n } else if (!source && data) {\n addLayers();\n }\n } catch (error) {\n console.error('Error updating isochrone source:', error);\n }\n };\n\n const updateLayerStyle = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Update fill layer\n if (mapInstance.getLayer(fillLayerId.value)) {\n mapInstance.setPaintProperty(\n fillLayerId.value,\n 'fill-opacity',\n props.fillOpacity,\n );\n mapInstance.setLayoutProperty(\n fillLayerId.value,\n 'visibility',\n props.visible ? 'visible' : 'none',\n );\n }\n\n // Update line layer\n if (mapInstance.getLayer(lineLayerId.value)) {\n mapInstance.setPaintProperty(\n lineLayerId.value,\n 'line-width',\n props.lineWidth,\n );\n mapInstance.setPaintProperty(\n lineLayerId.value,\n 'line-opacity',\n props.lineOpacity,\n );\n mapInstance.setLayoutProperty(\n lineLayerId.value,\n 'visibility',\n props.visible ? 'visible' : 'none',\n );\n }\n } catch (error) {\n console.error('Error updating isochrone layer style:', error);\n }\n };\n\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance || !props.interactive) return;\n\n try {\n // Click handler on fill layer\n mapInstance.on('click', fillLayerId.value, (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('click', {\n feature: e.features[0] as unknown as IsochroneFeature,\n coordinates: e.lngLat,\n });\n }\n });\n\n // Hover effects\n mapInstance.on(\n 'mouseenter',\n fillLayerId.value,\n (e: MapLayerMouseEvent) => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n if (e.features && e.features.length > 0) {\n emit('mouseenter', e.features[0] as unknown as IsochroneFeature);\n }\n },\n );\n\n mapInstance.on('mouseleave', fillLayerId.value, () => {\n mapInstance.getCanvas().style.cursor = '';\n emit('mouseleave');\n });\n } catch (error) {\n console.error('Error setting up isochrone layer events:', error);\n }\n };\n\n // Single initialization function to prevent race conditions\n const initializeLayers = async () => {\n if (initialized.value) return;\n\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n if (!processedData.value) return;\n\n // Wait for next tick to ensure all watchers are set up\n await nextTick();\n\n // Double-check we haven't been initialized during the tick\n if (initialized.value) return;\n\n addLayers();\n setupLayerEvents(mapInstance);\n initialized.value = true;\n };\n\n // Watch for data changes\n watch(\n () => props.data,\n () => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n if (!mapInstance.getSource(sourceId.value)) {\n addLayers();\n } else {\n updateSource();\n }\n }\n },\n { deep: true },\n );\n\n // Watch for style changes\n watch(\n () => [\n props.fillOpacity,\n props.lineWidth,\n props.lineOpacity,\n props.visible,\n ],\n () => updateLayerStyle(),\n { deep: true },\n );\n\n // IMPORTANT: watch(loaded) must be defined BEFORE watch(map) with immediate: true\n // Otherwise, when map watcher sets loaded.value = true, this watcher won't catch it\n watch(loaded, (value) => {\n if (value) {\n initializeLayers();\n }\n });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n // Also call initializeLayers directly in case loaded watcher already ran\n initializeLayers();\n }\n }\n },\n { immediate: true },\n );\n\n // Lifecycle hooks\n onMounted(() => {\n // Use nextTick to ensure all watchers are registered\n nextTick(() => {\n initializeLayers();\n });\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Remove layers\n if (mapInstance.getLayer(lineLayerId.value)) {\n mapInstance.removeLayer(lineLayerId.value);\n }\n if (mapInstance.getLayer(fillLayerId.value)) {\n mapInstance.removeLayer(fillLayerId.value);\n }\n // Remove source\n if (mapInstance.getSource(sourceId.value)) {\n mapInstance.removeSource(sourceId.value);\n }\n } catch (error) {\n console.error('Error cleaning up isochrone layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { ref, watch, onBeforeUnmount } from 'vue';\n import type { Map } from 'maplibre-gl';\n import { MaplibreStarfieldLayer } from '@geoql/maplibre-gl-starfield';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface Props {\n id?: string;\n starCount?: number;\n starSize?: number;\n starColor?: number;\n galaxyTextureUrl?: string;\n galaxyBrightness?: number;\n before?: string;\n sunEnabled?: boolean;\n sunAzimuth?: number;\n sunAltitude?: number;\n sunSize?: number;\n sunColor?: number;\n sunIntensity?: number;\n autoFadeStars?: boolean;\n fadeAltitude?: number;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n id: 'starfield',\n starCount: 4000,\n starSize: 2.0,\n starColor: 0xffffff,\n galaxyBrightness: 0.35,\n sunEnabled: false,\n sunAzimuth: 180,\n sunAltitude: 45,\n sunSize: 100,\n sunColor: 0xffeeaa,\n sunIntensity: 1.5,\n autoFadeStars: true,\n });\n\n const map = injectStrict(MapKey);\n const loaded = ref(false);\n let layerInstance: MaplibreStarfieldLayer | null = null;\n\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n try {\n if (mapInstance.getLayer(props.id)) {\n mapInstance.removeLayer(props.id);\n }\n\n layerInstance = new MaplibreStarfieldLayer({\n id: props.id,\n starCount: props.starCount,\n starSize: props.starSize,\n starColor: props.starColor,\n galaxyTextureUrl: props.galaxyTextureUrl,\n galaxyBrightness: props.galaxyBrightness,\n sunEnabled: props.sunEnabled,\n sunAzimuth: props.sunAzimuth,\n sunAltitude: props.sunAltitude,\n sunSize: props.sunSize,\n sunColor: props.sunColor,\n sunIntensity: props.sunIntensity,\n autoFadeStars: props.autoFadeStars,\n fadeAltitude: props.fadeAltitude,\n });\n\n mapInstance.addLayer(layerInstance, props.before || undefined);\n } catch (error) {\n console.error('Error adding starfield layer:', error);\n }\n };\n\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n }\n }\n },\n { immediate: true },\n );\n\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n watch(\n () => [props.sunAzimuth, props.sunAltitude, props.fadeAltitude],\n ([az, alt, fade]) => {\n layerInstance?.setSunPosition(\n az as number,\n alt as number,\n fade as number | undefined,\n );\n },\n );\n watch(\n () => props.fadeAltitude,\n (fade) => {\n layerInstance?.setFadeAltitude(fade);\n },\n );\n\n watch(\n () => props.sunEnabled,\n (enabled) => {\n layerInstance?.setSunEnabled(enabled);\n },\n );\n\n watch(\n () => props.sunIntensity,\n (intensity) => {\n layerInstance?.setSunIntensity(intensity);\n },\n );\n\n watch(\n () => props.sunSize,\n (size) => {\n layerInstance?.setSunSize(size);\n },\n );\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.id)) {\n mapInstance.removeLayer(props.id);\n }\n } catch (error) {\n console.error('Error cleaning up starfield layer:', error);\n }\n layerInstance = null;\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ScatterplotLayer } from '@deck.gl/layers';\n import type { ScatterplotLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getRadius?: Accessor<D, number>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n radiusUnits?: 'meters' | 'common' | 'pixels';\n radiusScale?: number;\n radiusMinPixels?: number;\n radiusMaxPixels?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n stroked?: boolean;\n filled?: boolean;\n billboard?: boolean;\n antialiasing?: boolean;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n radiusUnits: 'meters',\n radiusScale: 1,\n radiusMinPixels: 0,\n radiusMaxPixels: Number.MAX_SAFE_INTEGER,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n stroked: false,\n filled: true,\n billboard: false,\n antialiasing: true,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ScatterplotLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getRadius: props.getRadius ?? 1,\n getFillColor: props.getFillColor ?? [255, 140, 0],\n getLineColor: props.getLineColor ?? [0, 0, 0],\n getLineWidth: props.getLineWidth ?? 1,\n radiusUnits: props.radiusUnits,\n radiusScale: props.radiusScale,\n radiusMinPixels: props.radiusMinPixels,\n radiusMaxPixels: props.radiusMaxPixels,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n stroked: props.stroked,\n filled: props.filled,\n billboard: props.billboard,\n antialiasing: props.antialiasing,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as ScatterplotLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getRadius,\n props.getFillColor,\n props.getLineColor,\n props.radiusScale,\n props.opacity,\n props.visible,\n props.stroked,\n props.filled,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ArcLayer } from '@deck.gl/layers';\n import type { ArcLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getSourcePosition: Accessor<D, Position>;\n getTargetPosition: Accessor<D, Position>;\n getSourceColor?: Accessor<D, Color>;\n getTargetColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n getHeight?: Accessor<D, number>;\n getTilt?: Accessor<D, number>;\n greatCircle?: boolean;\n numSegments?: number;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n greatCircle: false,\n numSegments: 50,\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ArcLayer({\n id: props.id,\n data: props.data,\n getSourcePosition: props.getSourcePosition,\n getTargetPosition: props.getTargetPosition,\n getSourceColor: props.getSourceColor ?? [255, 140, 0],\n getTargetColor: props.getTargetColor ?? [0, 200, 255],\n getWidth: props.getWidth ?? 1,\n getHeight: props.getHeight ?? 1,\n getTilt: props.getTilt ?? 0,\n greatCircle: props.greatCircle,\n numSegments: props.numSegments,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as ArcLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getSourcePosition,\n props.getTargetPosition,\n props.getSourceColor,\n props.getTargetColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GeoJsonLayer } from '@deck.gl/layers';\n import type { PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D | string | Promise<D>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n getPointRadius?: Accessor<D, number>;\n getElevation?: Accessor<D, number>;\n getText?: Accessor<D, string>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n pointType?: string;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n lineJointRounded?: boolean;\n lineCapRounded?: boolean;\n lineMiterLimit?: number;\n pointRadiusUnits?: 'meters' | 'common' | 'pixels';\n pointRadiusScale?: number;\n pointRadiusMinPixels?: number;\n pointRadiusMaxPixels?: number;\n elevationScale?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n pointType: 'circle',\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n lineJointRounded: false,\n lineCapRounded: false,\n lineMiterLimit: 4,\n pointRadiusUnits: 'meters',\n pointRadiusScale: 1,\n pointRadiusMinPixels: 0,\n pointRadiusMaxPixels: Number.MAX_SAFE_INTEGER,\n elevationScale: 1,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GeoJsonLayer({\n id: props.id,\n data: props.data,\n getFillColor: props.getFillColor ?? [200, 200, 200, 200],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getLineWidth: props.getLineWidth ?? 1,\n getPointRadius: props.getPointRadius ?? 1,\n getElevation: props.getElevation ?? 1000,\n getText: props.getText,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n pointType: props.pointType,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n lineJointRounded: props.lineJointRounded,\n lineCapRounded: props.lineCapRounded,\n lineMiterLimit: props.lineMiterLimit,\n pointRadiusUnits: props.pointRadiusUnits,\n pointRadiusScale: props.pointRadiusScale,\n pointRadiusMinPixels: props.pointRadiusMinPixels,\n pointRadiusMaxPixels: props.pointRadiusMaxPixels,\n elevationScale: props.elevationScale,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof GeoJsonLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getFillColor,\n props.getLineColor,\n props.opacity,\n props.visible,\n props.extruded,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { PathLayer } from '@deck.gl/layers';\n import type { PathLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPath: Accessor<D, Position[]>;\n getColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n capRounded?: boolean;\n jointRounded?: boolean;\n billboard?: boolean;\n miterLimit?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n widthUnits: 'meters',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n capRounded: false,\n jointRounded: false,\n billboard: false,\n miterLimit: 4,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new PathLayer({\n id: props.id,\n data: props.data,\n getPath: props.getPath,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getWidth: props.getWidth ?? 1,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n capRounded: props.capRounded,\n jointRounded: props.jointRounded,\n billboard: props.billboard,\n miterLimit: props.miterLimit,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as PathLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPath,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { LineLayer } from '@deck.gl/layers';\n import type { LineLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getSourcePosition: Accessor<D, Position>;\n getTargetPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new LineLayer({\n id: props.id,\n data: props.data,\n getSourcePosition: props.getSourcePosition,\n getTargetPosition: props.getTargetPosition,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getWidth: props.getWidth ?? 1,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as LineLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getSourcePosition,\n props.getTargetPosition,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { PolygonLayer } from '@deck.gl/layers';\n import type { PolygonLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPolygon: Accessor<D, Position[] | Position[][]>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n lineJointRounded?: boolean;\n lineMiterLimit?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n lineJointRounded: false,\n lineMiterLimit: 4,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new PolygonLayer({\n id: props.id,\n data: props.data,\n getPolygon: props.getPolygon,\n getFillColor: props.getFillColor ?? [200, 200, 200, 200],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getLineWidth: props.getLineWidth ?? 1,\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n lineJointRounded: props.lineJointRounded,\n lineMiterLimit: props.lineMiterLimit,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as PolygonLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPolygon,\n props.getFillColor,\n props.getLineColor,\n props.opacity,\n props.visible,\n props.extruded,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { SolidPolygonLayer } from '@deck.gl/layers';\n import type { SolidPolygonLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPolygon: Accessor<D, Position[] | Position[][]>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new SolidPolygonLayer({\n id: props.id,\n data: props.data,\n getPolygon: props.getPolygon,\n getFillColor: props.getFillColor ?? [0, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as SolidPolygonLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPolygon,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { IconLayer } from '@deck.gl/layers';\n import type { IconLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface IconMapping {\n [key: string]: {\n x: number;\n y: number;\n width: number;\n height: number;\n anchorX?: number;\n anchorY?: number;\n mask?: boolean;\n };\n }\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getIcon?: Accessor<D, string | object>;\n getSize?: Accessor<D, number>;\n getColor?: Accessor<D, Color>;\n getAngle?: Accessor<D, number>;\n iconAtlas?: string;\n iconMapping?: IconMapping | string;\n sizeScale?: number;\n sizeUnits?: 'meters' | 'common' | 'pixels';\n sizeMinPixels?: number;\n sizeMaxPixels?: number;\n billboard?: boolean;\n alphaCutoff?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeScale: 1,\n sizeUnits: 'pixels',\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n billboard: true,\n alphaCutoff: 0.05,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new IconLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getIcon: props.getIcon ?? 'marker',\n getSize: props.getSize ?? 1,\n getColor: props.getColor ?? [255, 255, 255, 255],\n getAngle: props.getAngle ?? 0,\n iconAtlas: props.iconAtlas,\n iconMapping: props.iconMapping,\n sizeScale: props.sizeScale,\n sizeUnits: props.sizeUnits,\n sizeMinPixels: props.sizeMinPixels,\n sizeMaxPixels: props.sizeMaxPixels,\n billboard: props.billboard,\n alphaCutoff: props.alphaCutoff,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as IconLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getIcon,\n props.getSize,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TextLayer } from '@deck.gl/layers';\n import type { TextLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getText: Accessor<D, string>;\n getSize?: Accessor<D, number>;\n getColor?: Accessor<D, Color>;\n getAngle?: Accessor<D, number>;\n getTextAnchor?: Accessor<D, 'start' | 'middle' | 'end'>;\n getAlignmentBaseline?: Accessor<D, 'top' | 'center' | 'bottom'>;\n getPixelOffset?: Accessor<D, [number, number]>;\n getBackgroundColor?: Accessor<D, Color>;\n getBorderColor?: Accessor<D, Color>;\n getBorderWidth?: Accessor<D, number>;\n background?: boolean;\n backgroundPadding?: [number, number] | [number, number, number, number];\n billboard?: boolean;\n sizeScale?: number;\n sizeUnits?: 'meters' | 'common' | 'pixels';\n sizeMinPixels?: number;\n sizeMaxPixels?: number;\n characterSet?: string | string[];\n fontFamily?: string;\n fontWeight?: string | number;\n lineHeight?: number;\n fontSettings?: {\n sdf?: boolean;\n fontSize?: number;\n buffer?: number;\n radius?: number;\n cutoff?: number;\n smoothing?: number;\n };\n wordBreak?: 'break-all' | 'break-word';\n maxWidth?: number;\n outlineWidth?: number;\n outlineColor?: Color;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n background: false,\n billboard: true,\n sizeScale: 1,\n sizeUnits: 'pixels',\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n characterSet: 'auto',\n fontFamily: 'Monaco, monospace',\n fontWeight: 'normal',\n lineHeight: 1,\n fontSettings: () => ({ sdf: true }),\n wordBreak: 'break-word',\n maxWidth: -1,\n outlineWidth: 0,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TextLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getText: props.getText,\n getSize: props.getSize ?? 32,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getAngle: props.getAngle ?? 0,\n getTextAnchor: props.getTextAnchor ?? 'middle',\n getAlignmentBaseline: props.getAlignmentBaseline ?? 'center',\n getPixelOffset: props.getPixelOffset ?? [0, 0],\n getBackgroundColor: props.getBackgroundColor,\n getBorderColor: props.getBorderColor,\n getBorderWidth: props.getBorderWidth,\n background: props.background,\n backgroundPadding: props.backgroundPadding,\n billboard: props.billboard,\n sizeScale: props.sizeScale,\n sizeUnits: props.sizeUnits,\n sizeMinPixels: props.sizeMinPixels,\n sizeMaxPixels: props.sizeMaxPixels,\n characterSet: props.characterSet,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n lineHeight: props.lineHeight,\n fontSettings: props.fontSettings,\n wordBreak: props.wordBreak,\n maxWidth: props.maxWidth,\n outlineWidth: props.outlineWidth,\n outlineColor: props.outlineColor,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as TextLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getText,\n props.getSize,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ColumnLayer } from '@deck.gl/layers';\n import type { ColumnLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n diskResolution?: number;\n radius?: number;\n angle?: number;\n vertices?: Position[];\n offset?: [number, number];\n coverage?: number;\n elevationScale?: number;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n flatShading?: boolean;\n radiusUnits?: 'meters' | 'common' | 'pixels';\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n diskResolution: 20,\n radius: 1000,\n angle: 0,\n coverage: 1,\n elevationScale: 1,\n filled: true,\n stroked: false,\n extruded: true,\n wireframe: false,\n flatShading: false,\n radiusUnits: 'meters',\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ColumnLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n diskResolution: props.diskResolution,\n radius: props.radius,\n angle: props.angle,\n vertices: props.vertices,\n offset: props.offset,\n coverage: props.coverage,\n elevationScale: props.elevationScale,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n flatShading: props.flatShading,\n radiusUnits: props.radiusUnits,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as ColumnLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getFillColor,\n props.getElevation,\n props.radius,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { BitmapLayer } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n image:\n | string\n | HTMLImageElement\n | ImageBitmap\n | HTMLCanvasElement\n | ImageData\n | HTMLVideoElement;\n bounds:\n | [number, number, number, number]\n | [Position, Position, Position, Position];\n loadOptions?: object;\n textureParameters?: object;\n desaturate?: number;\n transparentColor?: Color;\n tintColor?: Color;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n desaturate: 0,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new BitmapLayer({\n id: props.id,\n image: props.image,\n bounds: props.bounds,\n loadOptions: props.loadOptions,\n textureParameters: props.textureParameters,\n desaturate: props.desaturate,\n transparentColor: props.transparentColor ?? [0, 0, 0, 0],\n tintColor: props.tintColor ?? [255, 255, 255],\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof BitmapLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.image,\n props.bounds,\n props.desaturate,\n props.tintColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GridCellLayer } from '@deck.gl/layers';\n import type { GridCellLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getFillColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n cellSize?: number;\n coverage?: number;\n elevationScale?: number;\n extruded?: boolean;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSize: 1000,\n coverage: 1,\n elevationScale: 1,\n extruded: true,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GridCellLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n cellSize: props.cellSize,\n coverage: props.coverage,\n elevationScale: props.elevationScale,\n extruded: props.extruded,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as GridCellLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getFillColor,\n props.getElevation,\n props.cellSize,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { PointCloudLayer } from '@deck.gl/layers';\n import type { PointCloudLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getNormal?: Accessor<D, [number, number, number]>;\n sizeUnits?: 'meters' | 'common' | 'pixels';\n pointSize?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeUnits: 'pixels',\n pointSize: 10,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new PointCloudLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getNormal: props.getNormal ?? [0, 0, 1],\n sizeUnits: props.sizeUnits,\n pointSize: props.pointSize,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as PointCloudLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getColor,\n props.pointSize,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { HeatmapLayer } from '@deck.gl/aggregation-layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getWeight?: Accessor<D, number>;\n intensity?: number;\n radiusPixels?: number;\n colorRange?: Color[];\n threshold?: number;\n colorDomain?: [number, number];\n aggregation?: 'SUM' | 'MEAN';\n weightsTextureSize?: number;\n debounceTimeout?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n intensity: 1,\n radiusPixels: 30,\n threshold: 0.05,\n aggregation: 'SUM',\n weightsTextureSize: 2048,\n debounceTimeout: 500,\n opacity: 1,\n visible: true,\n pickable: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new HeatmapLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getWeight: props.getWeight ?? 1,\n intensity: props.intensity,\n radiusPixels: props.radiusPixels,\n colorRange: props.colorRange,\n threshold: props.threshold,\n colorDomain: props.colorDomain,\n aggregation: props.aggregation,\n weightsTextureSize: props.weightsTextureSize,\n debounceTimeout: props.debounceTimeout,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof HeatmapLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getWeight,\n props.intensity,\n props.radiusPixels,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { HexagonLayer } from '@deck.gl/aggregation-layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getColorWeight?: Accessor<D, number>;\n getElevationWeight?: Accessor<D, number>;\n gpuAggregation?: boolean;\n radius?: number;\n elevationScale?: number;\n elevationRange?: [number, number];\n colorRange?: Color[];\n colorDomain?: [number, number];\n coverage?: number;\n extruded?: boolean;\n upperPercentile?: number;\n lowerPercentile?: number;\n elevationUpperPercentile?: number;\n elevationLowerPercentile?: number;\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n material?: boolean | object;\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX' | 'COUNT';\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX' | 'COUNT';\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n gpuAggregation: false,\n radius: 1000,\n elevationScale: 1,\n coverage: 1,\n extruded: false,\n upperPercentile: 100,\n lowerPercentile: 0,\n elevationUpperPercentile: 100,\n elevationLowerPercentile: 0,\n colorScaleType: 'quantize',\n colorAggregation: 'SUM',\n elevationAggregation: 'SUM',\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new HexagonLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getColorWeight: props.getColorWeight,\n getElevationWeight: props.getElevationWeight,\n gpuAggregation: props.gpuAggregation,\n radius: props.radius,\n elevationScale: props.elevationScale,\n elevationRange: props.elevationRange,\n colorRange: props.colorRange,\n colorDomain: props.colorDomain,\n coverage: props.coverage,\n extruded: props.extruded,\n upperPercentile: props.upperPercentile,\n lowerPercentile: props.lowerPercentile,\n elevationUpperPercentile: props.elevationUpperPercentile,\n elevationLowerPercentile: props.elevationLowerPercentile,\n colorScaleType: props.colorScaleType,\n material: props.material,\n colorAggregation: props.colorAggregation,\n elevationAggregation: props.elevationAggregation,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof HexagonLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.radius,\n props.elevationScale,\n props.opacity,\n props.visible,\n props.extruded,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GridLayer } from '@deck.gl/aggregation-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getColorWeight?: Accessor<D, number>;\n getElevationWeight?: Accessor<D, number>;\n cellSize?: number;\n colorRange?: Color[];\n coverage?: number;\n elevationDomain?: [number, number];\n elevationRange?: [number, number];\n elevationScale?: number;\n extruded?: boolean;\n upperPercentile?: number;\n lowerPercentile?: number;\n elevationUpperPercentile?: number;\n elevationLowerPercentile?: number;\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n gpuAggregation?: boolean;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSize: 1000,\n coverage: 1,\n elevationScale: 1,\n extruded: false,\n upperPercentile: 100,\n lowerPercentile: 0,\n elevationUpperPercentile: 100,\n elevationLowerPercentile: 0,\n colorScaleType: 'quantize',\n colorAggregation: 'SUM',\n elevationAggregation: 'SUM',\n gpuAggregation: false,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GridLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getColorWeight: props.getColorWeight ?? 1,\n getElevationWeight: props.getElevationWeight ?? 1,\n cellSize: props.cellSize,\n colorRange: props.colorRange,\n coverage: props.coverage,\n elevationDomain: props.elevationDomain,\n elevationRange: props.elevationRange,\n elevationScale: props.elevationScale,\n extruded: props.extruded,\n upperPercentile: props.upperPercentile,\n lowerPercentile: props.lowerPercentile,\n elevationUpperPercentile: props.elevationUpperPercentile,\n elevationLowerPercentile: props.elevationLowerPercentile,\n colorScaleType: props.colorScaleType,\n colorAggregation: props.colorAggregation,\n elevationAggregation: props.elevationAggregation,\n gpuAggregation: props.gpuAggregation,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof GridLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.cellSize,\n props.colorRange,\n props.elevationScale,\n props.extruded,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ContourLayer } from '@deck.gl/aggregation-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface ContourDefinition {\n threshold: number | [number, number];\n color?: Color;\n strokeWidth?: number;\n zIndex?: number;\n }\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getWeight?: Accessor<D, number>;\n cellSize?: number;\n contours: ContourDefinition[];\n gpuAggregation?: boolean;\n aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n zOffset?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSize: 1000,\n gpuAggregation: false,\n aggregation: 'SUM',\n zOffset: 0.005,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ContourLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getWeight: props.getWeight ?? 1,\n cellSize: props.cellSize,\n contours: props.contours,\n gpuAggregation: props.gpuAggregation,\n aggregation: props.aggregation,\n zOffset: props.zOffset,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof ContourLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.cellSize,\n props.contours,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ScreenGridLayer } from '@deck.gl/aggregation-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getWeight?: Accessor<D, number>;\n cellSizePixels?: number;\n cellMarginPixels?: number;\n colorRange?: Color[];\n colorDomain?: [number, number];\n gpuAggregation?: boolean;\n aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSizePixels: 100,\n cellMarginPixels: 2,\n gpuAggregation: false,\n aggregation: 'SUM',\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ScreenGridLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getWeight: props.getWeight ?? 1,\n cellSizePixels: props.cellSizePixels,\n cellMarginPixels: props.cellMarginPixels,\n colorRange: props.colorRange,\n colorDomain: props.colorDomain,\n gpuAggregation: props.gpuAggregation,\n aggregation: props.aggregation,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof ScreenGridLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.cellSizePixels,\n props.colorRange,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TripsLayer } from '@deck.gl/geo-layers';\n import type { TripsLayerProps } from '@deck.gl/geo-layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPath: Accessor<D, Position[]>;\n getTimestamps?: Accessor<D, number[]>;\n getColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n currentTime?: number;\n trailLength?: number;\n fadeTrail?: boolean;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n capRounded?: boolean;\n jointRounded?: boolean;\n billboard?: boolean;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n currentTime: 0,\n trailLength: 120,\n fadeTrail: true,\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n capRounded: false,\n jointRounded: false,\n billboard: false,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TripsLayer({\n id: props.id,\n data: props.data,\n getPath: props.getPath,\n getTimestamps: props.getTimestamps,\n getColor: props.getColor ?? [253, 128, 93],\n getWidth: props.getWidth ?? 1,\n currentTime: props.currentTime,\n trailLength: props.trailLength,\n fadeTrail: props.fadeTrail,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n capRounded: props.capRounded,\n jointRounded: props.jointRounded,\n billboard: props.billboard,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as TripsLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPath,\n props.currentTime,\n props.trailLength,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { H3HexagonLayer } from '@deck.gl/geo-layers';\n import type { H3HexagonLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getHexagon: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n highPrecision?: boolean | 'auto';\n coverage?: number;\n elevationScale?: number;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n highPrecision: 'auto',\n coverage: 1,\n elevationScale: 1,\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new H3HexagonLayer({\n id: props.id,\n data: props.data,\n getHexagon: props.getHexagon,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n highPrecision: props.highPrecision,\n coverage: props.coverage,\n elevationScale: props.elevationScale,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as H3HexagonLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getHexagon,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { H3ClusterLayer } from '@deck.gl/geo-layers';\n import type { H3ClusterLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getHexagons: Accessor<D, string[]>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new H3ClusterLayer({\n id: props.id,\n data: props.data,\n getHexagons: props.getHexagons,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as H3ClusterLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getHexagons,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { MVTLayer } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: string | string[];\n minZoom?: number;\n maxZoom?: number;\n uniqueIdProperty?: string;\n highlightedFeatureId?: string | number;\n binary?: boolean;\n loadOptions?: object;\n // Sublayer props\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n getPointRadius?: Accessor<D, number>;\n getElevation?: Accessor<D, number>;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n pointRadiusUnits?: 'meters' | 'common' | 'pixels';\n pointRadiusScale?: number;\n pointRadiusMinPixels?: number;\n pointRadiusMaxPixels?: number;\n stroked?: boolean;\n filled?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n pointType?: string;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n minZoom: 0,\n maxZoom: 23,\n binary: true,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n pointRadiusUnits: 'meters',\n pointRadiusScale: 1,\n pointRadiusMinPixels: 0,\n pointRadiusMaxPixels: Number.MAX_SAFE_INTEGER,\n stroked: true,\n filled: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n tileLoad: [tile: unknown];\n tileError: [error: Error, tile: unknown];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new MVTLayer({\n id: props.id,\n data: props.data,\n minZoom: props.minZoom,\n maxZoom: props.maxZoom,\n uniqueIdProperty: props.uniqueIdProperty,\n highlightedFeatureId: props.highlightedFeatureId,\n binary: props.binary,\n loadOptions: props.loadOptions,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getLineWidth: props.getLineWidth ?? 1,\n getPointRadius: props.getPointRadius ?? 1,\n getElevation: props.getElevation ?? 1000,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n pointRadiusUnits: props.pointRadiusUnits,\n pointRadiusScale: props.pointRadiusScale,\n pointRadiusMinPixels: props.pointRadiusMinPixels,\n pointRadiusMaxPixels: props.pointRadiusMaxPixels,\n stroked: props.stroked,\n filled: props.filled,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n pointType: props.pointType,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n onTileLoad: (tile: unknown) => emit('tileLoad', tile),\n onTileError: (error: Error, tile: unknown) =>\n emit('tileError', error, tile),\n } as unknown as ConstructorParameters<typeof MVTLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getFillColor,\n props.getLineColor,\n props.highlightedFeatureId,\n props.extruded,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TileLayer } from '@deck.gl/geo-layers';\n import type { TileLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo, Layer } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface TileData {\n x: number;\n y: number;\n z: number;\n url: string;\n signal: AbortSignal;\n bbox: {\n west: number;\n north: number;\n east: number;\n south: number;\n };\n }\n\n interface Props {\n id: string;\n data?: string | string[] | ((tileData: TileData) => Promise<unknown>);\n getTileData?: (tileData: TileData) => Promise<unknown>;\n renderSubLayers?: (props: object) => Layer | Layer[] | null;\n tileSize?: number;\n maxZoom?: number;\n minZoom?: number;\n maxCacheSize?: number;\n maxCacheByteSize?: number;\n refinementStrategy?: 'best-available' | 'no-overlap' | 'never';\n zRange?: [number, number];\n maxRequests?: number;\n extent?: [number, number, number, number];\n loadOptions?: object;\n zoomOffset?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n tileSize: 512,\n minZoom: 0,\n refinementStrategy: 'best-available',\n maxRequests: 6,\n zoomOffset: 0,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n viewportLoad: [tiles: unknown[]];\n tileLoad: [tile: unknown];\n tileUnload: [tile: unknown];\n tileError: [error: Error, tile: unknown];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TileLayer({\n id: props.id,\n data: props.data,\n getTileData: props.getTileData,\n renderSubLayers: props.renderSubLayers,\n tileSize: props.tileSize,\n maxZoom: props.maxZoom,\n minZoom: props.minZoom,\n maxCacheSize: props.maxCacheSize,\n maxCacheByteSize: props.maxCacheByteSize,\n refinementStrategy: props.refinementStrategy,\n zRange: props.zRange,\n maxRequests: props.maxRequests,\n extent: props.extent,\n loadOptions: props.loadOptions,\n zoomOffset: props.zoomOffset,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n onViewportLoad: (tiles: unknown[]) => emit('viewportLoad', tiles),\n onTileLoad: (tile: unknown) => emit('tileLoad', tile),\n onTileUnload: (tile: unknown) => emit('tileUnload', tile),\n onTileError: (error: Error, tile: unknown) =>\n emit('tileError', error, tile),\n } as TileLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.tileSize,\n props.maxZoom,\n props.minZoom,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { Tile3DLayer } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n data: string;\n loader?: object;\n loadOptions?: object;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n opacity?: number;\n visible?: boolean;\n pointSize?: number;\n getPointColor?: Color | ((d: unknown) => Color);\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n pointSize: 1,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n tilesetLoad: [tileset: unknown];\n tileLoad: [tile: unknown];\n tileUnload: [tile: unknown];\n tileError: [error: Error, url: string, tile: unknown];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n const layerProps = {\n id: props.id,\n data: props.data,\n pointSize: props.pointSize,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n onTilesetLoad: (tileset: unknown) => emit('tilesetLoad', tileset),\n onTileLoad: (tile: unknown) => emit('tileLoad', tile),\n onTileUnload: (tile: unknown) => emit('tileUnload', tile),\n onTileError: (error: Error, url: string, tile: unknown) =>\n emit('tileError', error, url, tile),\n // Only include optional props when defined to avoid deck.gl bugs\n ...(props.loader !== undefined && { loader: props.loader }),\n ...(props.loadOptions !== undefined && {\n loadOptions: props.loadOptions,\n }),\n ...(props.highlightColor !== undefined && {\n highlightColor: props.highlightColor,\n }),\n ...(props.getPointColor !== undefined && {\n getPointColor: props.getPointColor,\n }),\n };\n return new Tile3DLayer(\n layerProps as unknown as ConstructorParameters<typeof Tile3DLayer>[0],\n );\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [props.data, props.pointSize, props.opacity, props.visible],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TerrainLayer } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n elevationData:\n | string\n | ((tileData: { x: number; y: number; z: number }) => string);\n texture?:\n | string\n | ((tileData: { x: number; y: number; z: number }) => string);\n meshMaxError?: number;\n elevationDecoder?: {\n rScaler: number;\n gScaler: number;\n bScaler: number;\n offset: number;\n };\n bounds?: [number, number, number, number];\n loadOptions?: object;\n workerUrl?: string;\n color?: Color;\n wireframe?: boolean;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n meshMaxError: 4.0,\n wireframe: false,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TerrainLayer({\n id: props.id,\n elevationData: props.elevationData,\n texture: props.texture,\n meshMaxError: props.meshMaxError,\n elevationDecoder: props.elevationDecoder,\n bounds: props.bounds,\n loadOptions: props.loadOptions,\n workerUrl: props.workerUrl,\n color: props.color ?? [255, 255, 255],\n wireframe: props.wireframe,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof TerrainLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.elevationData,\n props.texture,\n props.meshMaxError,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GreatCircleLayer } from '@deck.gl/geo-layers';\n import type { GreatCircleLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getSourcePosition: Accessor<D, Position>;\n getTargetPosition: Accessor<D, Position>;\n getSourceColor?: Accessor<D, Color>;\n getTargetColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n getHeight?: Accessor<D, number>;\n getTilt?: Accessor<D, number>;\n numSegments?: number;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n numSegments: 50,\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GreatCircleLayer({\n id: props.id,\n data: props.data,\n getSourcePosition: props.getSourcePosition,\n getTargetPosition: props.getTargetPosition,\n getSourceColor: props.getSourceColor ?? [0, 0, 255],\n getTargetColor: props.getTargetColor ?? [0, 255, 0],\n getWidth: props.getWidth ?? 1,\n getHeight: props.getHeight ?? 1,\n getTilt: props.getTilt ?? 0,\n numSegments: props.numSegments,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as GreatCircleLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getSourcePosition,\n props.getTargetPosition,\n props.getSourceColor,\n props.getTargetColor,\n props.getWidth,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { S2Layer } from '@deck.gl/geo-layers';\n import type { S2LayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getS2Token: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new S2Layer({\n id: props.id,\n data: props.data,\n getS2Token: props.getS2Token,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as S2LayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getS2Token,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GeohashLayer } from '@deck.gl/geo-layers';\n import type { GeohashLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getGeohash: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GeohashLayer({\n id: props.id,\n data: props.data,\n getGeohash: props.getGeohash,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as GeohashLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getGeohash,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { QuadkeyLayer } from '@deck.gl/geo-layers';\n import type { QuadkeyLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getQuadkey: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new QuadkeyLayer({\n id: props.id,\n data: props.data,\n getQuadkey: props.getQuadkey,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as QuadkeyLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getQuadkey,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { _WMSLayer as WMSLayer } from '@deck.gl/geo-layers';\n import type { WMSLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n data: string;\n serviceType?: 'wms' | 'template';\n layers?: string[];\n srs?: string;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n serviceType: 'wms',\n srs: 'EPSG:4326',\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new WMSLayer({\n id: props.id,\n data: props.data,\n serviceType: props.serviceType,\n layers: props.layers,\n srs: props.srs,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as WMSLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [props.data, props.layers, props.srs, props.opacity, props.visible],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { SimpleMeshLayer } from '@deck.gl/mesh-layers';\n import type { SimpleMeshLayerProps } from '@deck.gl/mesh-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n mesh: string | object;\n getPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getOrientation?: Accessor<D, [number, number, number]>;\n getScale?: Accessor<D, [number, number, number] | number>;\n getTranslation?: Accessor<D, [number, number, number]>;\n getTransformMatrix?: Accessor<D, number[]>;\n texture?: string | object;\n sizeScale?: number;\n wireframe?: boolean;\n material?: boolean | object;\n loaders?: object[];\n loadOptions?: object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeScale: 1,\n wireframe: false,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n // Build layer props object, excluding undefined optional props to avoid deck.gl bugs\n // where it tries to call undefined as a function (e.g., getTransformMatrix)\n const layerProps = {\n id: props.id,\n data: props.data,\n mesh: props.mesh,\n getPosition: props.getPosition,\n getColor: props.getColor ?? [255, 255, 255, 255],\n getOrientation: props.getOrientation ?? [0, 0, 0],\n getScale: props.getScale ?? [1, 1, 1],\n getTranslation: props.getTranslation ?? [0, 0, 0],\n sizeScale: props.sizeScale,\n wireframe: props.wireframe,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n // Only include optional props if defined\n ...(props.getTransformMatrix !== undefined && {\n getTransformMatrix: props.getTransformMatrix,\n }),\n ...(props.texture !== undefined && { texture: props.texture }),\n ...(props.material !== undefined && { material: props.material }),\n ...(props.loaders !== undefined && { loaders: props.loaders }),\n ...(props.loadOptions !== undefined && {\n loadOptions: props.loadOptions,\n }),\n ...(props.highlightColor !== undefined && {\n highlightColor: props.highlightColor,\n }),\n ...(props.beforeId !== undefined && { beforeId: props.beforeId }),\n };\n\n return new SimpleMeshLayer(layerProps as SimpleMeshLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.mesh,\n props.getPosition,\n props.getColor,\n props.getOrientation,\n props.getScale,\n props.sizeScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ScenegraphLayer } from '@deck.gl/mesh-layers';\n import type { ScenegraphLayerProps } from '@deck.gl/mesh-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n scenegraph: string | object;\n getPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getOrientation?: Accessor<D, [number, number, number]>;\n getScale?: Accessor<D, [number, number, number] | number>;\n getTranslation?: Accessor<D, [number, number, number]>;\n getTransformMatrix?: Accessor<D, number[]>;\n sizeScale?: number;\n sizeMinPixels?: number;\n sizeMaxPixels?: number;\n animator?: object;\n loaders?: object[];\n loadOptions?: object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n // Animation and lighting options\n _animations?: Record<\n string,\n { playing?: boolean; speed?: number; startTime?: number }\n >;\n _lighting?: 'flat' | 'pbr';\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeScale: 1,\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n // Build layer props object, excluding undefined optional props to avoid deck.gl bugs\n // where it tries to call undefined as a function (e.g., getTransformMatrix)\n const layerProps = {\n id: props.id,\n data: props.data,\n scenegraph: props.scenegraph,\n getPosition: props.getPosition,\n getColor: props.getColor ?? [255, 255, 255, 255],\n getOrientation: props.getOrientation ?? [0, 0, 0],\n getScale: props.getScale ?? [1, 1, 1],\n getTranslation: props.getTranslation ?? [0, 0, 0],\n sizeScale: props.sizeScale,\n sizeMinPixels: props.sizeMinPixels,\n sizeMaxPixels: props.sizeMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n // Only include optional props if defined\n ...(props.getTransformMatrix !== undefined && {\n getTransformMatrix: props.getTransformMatrix,\n }),\n ...(props.animator !== undefined && { animator: props.animator }),\n ...(props.loaders !== undefined && { loaders: props.loaders }),\n ...(props.loadOptions !== undefined && {\n loadOptions: props.loadOptions,\n }),\n ...(props.highlightColor !== undefined && {\n highlightColor: props.highlightColor,\n }),\n ...(props.beforeId !== undefined && { beforeId: props.beforeId }),\n ...(props._animations !== undefined && {\n _animations: props._animations,\n }),\n ...(props._lighting !== undefined && { _lighting: props._lighting }),\n };\n\n return new ScenegraphLayer(layerProps as ScenegraphLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.scenegraph,\n props.getPosition,\n props.getColor,\n props.getOrientation,\n props.getScale,\n props.sizeScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n toRaw,\n markRaw,\n } from 'vue';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n /**\n * GeoTIFF source - URL string, ArrayBuffer, Blob, or geotiff.js instance\n */\n geotiff: string | ArrayBuffer | Blob | object;\n /**\n * Tile size in pixels\n */\n tileSize?: number;\n /**\n * Maximum zoom level\n */\n maxZoom?: number;\n /**\n * Minimum zoom level\n */\n minZoom?: number;\n /**\n * Maximum number of tiles to cache\n */\n maxCacheSize?: number;\n /**\n * Refinement strategy for tile loading\n */\n refinementStrategy?: 'best-available' | 'no-overlap' | 'never';\n /**\n * Maximum concurrent requests\n */\n maxRequests?: number;\n /**\n * Layer opacity (0-1)\n */\n opacity?: number;\n /**\n * Layer visibility\n */\n visible?: boolean;\n /**\n * Enable picking on this layer\n */\n pickable?: boolean;\n /**\n * Auto highlight on hover\n */\n autoHighlight?: boolean;\n /**\n * Highlight color when autoHighlight is enabled\n */\n highlightColor?: Color;\n /**\n * Insert layer before this layer id\n */\n beforeId?: string;\n /**\n * Show debug overlay on tiles\n */\n debug?: boolean;\n /**\n * Opacity of debug overlay (0-1)\n */\n debugOpacity?: number;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n tileSize: 256,\n minZoom: 0,\n refinementStrategy: 'best-available',\n maxRequests: 6,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n debug: false,\n debugOpacity: 0.25,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n geotiffLoad: [\n tiff: unknown,\n options: {\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n // Store module references\n const COGLayerClass = shallowRef<\n typeof import('@developmentseed/deck.gl-geotiff').COGLayer | null\n >(null);\n const epsgResolverFn = shallowRef<\n typeof import('@developmentseed/proj').epsgResolver | null\n >(null);\n\n const createLayer = () => {\n if (!COGLayerClass.value) return null;\n\n const layerProps: Record<string, unknown> = {\n id: toRaw(props.id),\n geotiff: toRaw(props.geotiff),\n opacity: toRaw(props.opacity),\n visible: toRaw(props.visible),\n pickable: toRaw(props.pickable),\n autoHighlight: toRaw(props.autoHighlight),\n debug: toRaw(props.debug),\n debugOpacity: toRaw(props.debugOpacity),\n };\n\n if (epsgResolverFn.value) {\n layerProps.epsgResolver = epsgResolverFn.value;\n }\n\n layerProps.onGeoTIFFLoad = (\n tiff: unknown,\n options: {\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ) => {\n emit('geotiffLoad', tiff, options);\n };\n\n if (props.tileSize !== 256) layerProps.tileSize = toRaw(props.tileSize);\n if (props.maxZoom !== undefined) layerProps.maxZoom = toRaw(props.maxZoom);\n if (props.minZoom !== 0) layerProps.minZoom = toRaw(props.minZoom);\n if (props.maxCacheSize !== undefined)\n layerProps.maxCacheSize = toRaw(props.maxCacheSize);\n if (props.refinementStrategy !== 'best-available')\n layerProps.refinementStrategy = toRaw(props.refinementStrategy);\n if (props.maxRequests !== 6)\n layerProps.maxRequests = toRaw(props.maxRequests);\n if (props.highlightColor !== undefined)\n layerProps.highlightColor = toRaw(props.highlightColor);\n if (props.beforeId !== undefined)\n layerProps.beforeId = toRaw(props.beforeId);\n\n const layer = new COGLayerClass.value(layerProps);\n return markRaw(layer);\n };\n\n const initializeLayer = async () => {\n try {\n const [geotiffModule, projModule] = await Promise.all([\n import('@developmentseed/deck.gl-geotiff'),\n import('@developmentseed/proj'),\n ]);\n\n COGLayerClass.value = markRaw(geotiffModule.COGLayer);\n epsgResolverFn.value = projModule.epsgResolver;\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-raster] Error loading COGLayer:', error);\n console.error('Make sure @developmentseed/deck.gl-geotiff is installed');\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.geotiff,\n props.tileSize,\n props.maxZoom,\n props.minZoom,\n props.opacity,\n props.visible,\n props.debug,\n props.debugOpacity,\n ],\n () => {\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * VLayerDeckglMosaic - Client-side COG mosaic layer for STAC items\n *\n * Uses @developmentseed/deck.gl-geotiff v0.3.0 MosaicLayer for efficient\n * client-side rendering of multiple COGs from STAC APIs.\n *\n * @see https://github.com/developmentseed/deck.gl-raster/blob/main/examples/naip-mosaic/src/App.tsx\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n markRaw,\n toRaw,\n } from 'vue';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import type { GeoTIFF, Overview } from '@developmentseed/geotiff';\n import type { Texture } from '@luma.gl/core';\n import type { RasterModule } from '@developmentseed/deck.gl-raster';\n import type { ShaderModule } from '@luma.gl/shadertools';\n import type {\n COGLayerProps,\n GetTileDataOptions,\n MosaicLayerProps,\n MosaicSource as BaseMosaicSource,\n } from '@developmentseed/deck.gl-geotiff';\n import type { EpsgResolver } from '@developmentseed/proj';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n /**\n * A STAC-like item with bounding box and COG asset URL\n * Extends the base MosaicSource from deck.gl-geotiff with asset info\n */\n export interface MosaicSource extends BaseMosaicSource {\n /** Asset containing the COG URL */\n assets: {\n image: { href: string };\n };\n }\n\n /**\n * Render mode for the mosaic layer\n */\n export type MosaicRenderMode = 'trueColor' | 'falseColor' | 'ndvi' | 'custom';\n\n /**\n * Custom render module for advanced band manipulation\n */\n export interface RenderModule {\n module: { name: string; inject?: Record<string, string> };\n props?: Record<string, unknown>;\n }\n\n interface Props {\n id: string;\n /**\n * Array of STAC-like items with bbox and COG asset URLs\n */\n sources: MosaicSource[];\n /**\n * Render mode: trueColor (RGB), falseColor (NIR-R-G), ndvi (with colormap)\n */\n renderMode?: MosaicRenderMode;\n /**\n * Custom render modules (only used when renderMode is 'custom')\n */\n customRenderModules?: (texture: Texture) => RenderModule[];\n /**\n * Custom colormap data for NDVI (Uint8ClampedArray of RGBA values, 256 colors)\n * @reserved Currently not implemented - NDVI uses built-in cfastie colormap.\n */\n colormapData?: Uint8ClampedArray;\n /**\n * Maximum number of tiles to cache\n */\n maxCacheSize?: number;\n /**\n * Layer opacity (0-1)\n */\n opacity?: number;\n /**\n * Layer visibility\n */\n visible?: boolean;\n /**\n * Enable picking on this layer\n */\n pickable?: boolean;\n /**\n * Auto highlight on hover\n */\n autoHighlight?: boolean;\n /**\n * Highlight color when autoHighlight is enabled\n */\n highlightColor?: Color;\n /**\n * NDVI range filter: pixels outside [min, max] are discarded.\n * Only applies when renderMode is 'ndvi'. Range: [-1, 1].\n */\n ndviRange?: [number, number];\n /**\n * Insert layer before this layer id\n */\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n renderMode: 'trueColor',\n maxCacheSize: Infinity,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n ndviRange: () => [-1, 1] as [number, number],\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n sourceLoad: [source: MosaicSource];\n error: [error: Error, source?: MosaicSource];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer } = useDeckOverlay(map);\n let activeLayerId = '';\n\n interface TextureData {\n texture: Texture;\n width: number;\n height: number;\n }\n\n interface LoadedModules {\n MosaicLayer: typeof import('@developmentseed/deck.gl-geotiff').MosaicLayer;\n COGLayer: typeof import('@developmentseed/deck.gl-geotiff').COGLayer;\n CreateTexture: RasterModule['module'];\n fromUrl: typeof GeoTIFF.fromUrl;\n resolveEpsg: EpsgResolver;\n }\n\n const modules = shallowRef<LoadedModules | null>(null);\n\n // Shader modules for different render modes\n const SetAlpha1 = {\n name: 'set-alpha-1',\n inject: { 'fs:DECKGL_FILTER_COLOR': `color = vec4(color.rgb, 1.0);` },\n };\n\n const FalseColorInfrared = {\n name: 'false-color-infrared',\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n float nir = color[3];\n float red = color[0];\n float green = color[1];\n color.rgb = vec3(nir, red, green);\n `,\n },\n };\n\n // --- NDVI Pipeline: 3 separate modules matching upstream pattern ---\n // Uniforms update per-draw via MeshTextureLayer.draw() → setProps() without\n // re-rendering tiles. Baked constants don't work because renderTile only runs\n // when tiles are FIRST FETCHED — cached tiles keep old shader modules.\n\n // Step 1: Compute NDVI from raw RGBA bands, store in color.r\n const NDVICompute = {\n name: 'ndvi-compute',\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n float nir_c = color[3];\n float red_c = color[0];\n float sum_c = nir_c + red_c;\n float ndvi_c = sum_c > 0.001 ? (nir_c - red_c) / sum_c : 0.0;\n color = vec4(ndvi_c, ndvi_c, ndvi_c, 1.0);\n `,\n },\n };\n\n // Step 2: Filter by NDVI range — uniforms update per-draw without tile re-render\n const ndviFilterUniformBlock = `\\\nuniform ndviFilterUniforms {\n float ndviMin;\n float ndviMax;\n} ndviFilter;\n`;\n\n const NDVIFilter = {\n name: 'ndviFilter',\n fs: ndviFilterUniformBlock,\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n if (color.r < ndviFilter.ndviMin || color.r > ndviFilter.ndviMax) {\n discard;\n }\n `,\n },\n uniformTypes: {\n ndviMin: 'f32',\n ndviMax: 'f32',\n },\n getUniforms: (uniformProps: Record<string, unknown>) => ({\n ndviMin: (uniformProps.ndviMin as number) ?? -1.0,\n ndviMax: (uniformProps.ndviMax as number) ?? 1.0,\n }),\n } as const satisfies ShaderModule<{ ndviMin: number; ndviMax: number }>;\n\n // Step 3: Apply cfastie-inspired colormap gradient from color.r (NDVI value)\n const NDVIColormap = {\n name: 'ndvi-colormap',\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n float t = clamp((color.r + 1.0) / 2.0, 0.0, 1.0);\n \n vec3 result;\n if (t < 0.4) {\n float localT = t / 0.4;\n result = mix(vec3(0.0, 0.0, 0.5), vec3(0.5, 0.8, 0.9), localT);\n } else if (t < 0.5) {\n float localT = (t - 0.4) / 0.1;\n result = mix(vec3(0.5, 0.8, 0.9), vec3(0.9, 0.9, 0.4), localT);\n } else if (t < 0.6) {\n float localT = (t - 0.5) / 0.1;\n result = mix(vec3(0.9, 0.9, 0.4), vec3(0.6, 0.8, 0.2), localT);\n } else if (t < 0.75) {\n float localT = (t - 0.6) / 0.15;\n result = mix(vec3(0.6, 0.8, 0.2), vec3(0.1, 0.6, 0.1), localT);\n } else {\n float localT = (t - 0.75) / 0.25;\n result = mix(vec3(0.1, 0.6, 0.1), vec3(0.0, 0.3, 0.0), localT);\n }\n \n color.rgb = result;\n `,\n },\n };\n\n function getRenderModules(\n mode: MosaicRenderMode,\n texture: Texture,\n mods: {\n CreateTexture: RasterModule['module'];\n },\n ndviRange: [number, number],\n customModules?: (texture: Texture) => RenderModule[],\n ): RasterModule[] {\n if (mode === 'custom' && customModules) {\n return customModules(texture) as RasterModule[];\n }\n\n const base: RasterModule[] = [\n { module: mods.CreateTexture, props: { textureName: texture } },\n ];\n\n if (mode === 'trueColor') {\n return [...base, { module: SetAlpha1 }];\n }\n\n if (mode === 'falseColor') {\n return [...base, { module: FalseColorInfrared }, { module: SetAlpha1 }];\n }\n\n // NDVI pipeline: compute → filter → colormap → alpha\n // NDVIFilter uses uniformTypes + getUniforms so uniform values update\n // per-draw via MeshTextureLayer.draw() WITHOUT re-rendering tiles.\n return [\n ...base,\n { module: NDVICompute },\n {\n module: NDVIFilter,\n props: { ndviMin: ndviRange[0], ndviMax: ndviRange[1] },\n },\n { module: NDVIColormap },\n { module: SetAlpha1 },\n ];\n }\n\n function createLayer() {\n const mods = modules.value;\n if (!mods || !props.sources.length) return null;\n\n const { MosaicLayer, COGLayer, CreateTexture, fromUrl, resolveEpsg } = mods;\n\n const rawSources = toRaw(props.sources);\n const renderMode = toRaw(props.renderMode);\n const ndviRange = toRaw(props.ndviRange) as [number, number];\n const customRenderModules = props.customRenderModules;\n\n // Fixed ID matching upstream pattern — deck.gl diffs old vs new layer\n // via setProps, detecting changed renderSource/renderTile callbacks.\n const newId = `${toRaw(props.id)}-mosaic`;\n const layer = new MosaicLayer<MosaicSource, GeoTIFF>({\n id: newId,\n sources: rawSources,\n maxCacheSize: toRaw(props.maxCacheSize),\n\n getSource: async (source) => {\n try {\n const tiff = await fromUrl(source.assets.image.href);\n emit('sourceLoad', source);\n return tiff;\n } catch (error) {\n emit('error', error as Error, source);\n throw error;\n }\n },\n\n renderSource: (source, { data, signal }) => {\n if (!data) return null;\n\n return new COGLayer<TextureData>({\n id: `cog-${source.assets.image.href}-${renderMode}`,\n geotiff: data,\n epsgResolver: resolveEpsg,\n getTileData: async (\n image: GeoTIFF | Overview,\n options: GetTileDataOptions,\n ) => {\n const { device, x, y } = options;\n const tile = await image.fetchTile(x, y, {\n signal,\n boundless: false,\n });\n const { array } = tile;\n if (array.layout === 'band-separate') {\n throw new Error('Band-separate COGs are not supported');\n }\n const texture = device.createTexture({\n data: array.data,\n format: 'rgba8unorm',\n width: array.width,\n height: array.height,\n });\n return {\n texture,\n width: array.width,\n height: array.height,\n };\n },\n renderTile: (tileData: TextureData) => ({\n image: tileData.texture,\n renderPipeline: getRenderModules(\n renderMode,\n tileData.texture,\n { CreateTexture },\n ndviRange,\n customRenderModules,\n ),\n }),\n signal,\n } as COGLayerProps<TextureData>);\n },\n } as MosaicLayerProps<MosaicSource, GeoTIFF>);\n\n return layer;\n }\n\n async function initializeLayer() {\n try {\n const [geotiffModule, rasterModule, devGeotiff, projModule] =\n await Promise.all([\n import('@developmentseed/deck.gl-geotiff'),\n import('@developmentseed/deck.gl-raster/gpu-modules'),\n import('@developmentseed/geotiff'),\n import('@developmentseed/proj'),\n ]);\n\n modules.value = markRaw({\n MosaicLayer: geotiffModule.MosaicLayer,\n COGLayer: geotiffModule.COGLayer,\n CreateTexture: rasterModule.CreateTexture,\n fromUrl: devGeotiff.GeoTIFF.fromUrl,\n resolveEpsg: projModule.epsgResolver,\n });\n\n const layer = createLayer();\n if (layer) {\n activeLayerId = (layer as { id: string }).id;\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-mosaic] Error loading MosaicLayer:', error);\n console.error(\n 'Make sure @developmentseed/deck.gl-geotiff, @developmentseed/deck.gl-raster, and @developmentseed/geotiff are installed',\n );\n emit('error', error as Error);\n }\n }\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.sources,\n props.renderMode,\n props.ndviRange,\n props.opacity,\n props.visible,\n ],\n () => {\n if (modules.value) {\n const layer = createLayer();\n if (layer) {\n activeLayerId = (layer as { id: string }).id;\n addLayer(layer);\n }\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n if (activeLayerId) {\n removeLayer(activeLayerId);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * VLayerDeckglMultiCOG — multi-band split-resolution COG compositing.\n *\n * Wraps @developmentseed/deck.gl-geotiff MultiCOGLayer.\n * Use case: render Sentinel-2 or other multi-band imagery where bands live in\n * separate COGs at different native resolutions. The layer opens all sources\n * in parallel, picks the finest as the primary tileset, and the GPU\n * resamples lower-resolution bands to match.\n *\n * @see https://github.com/developmentseed/deck.gl-raster/blob/main/examples/sentinel-2/src/App.tsx\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n markRaw,\n toRaw,\n } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import type { RasterModule } from '@developmentseed/deck.gl-raster';\n import type { MultiCOGSourceConfig } from '@developmentseed/deck.gl-geotiff';\n import type { GeoTIFF } from '@developmentseed/geotiff';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n /**\n * Maps source band names to RGB(A) output channels for the compositing step.\n */\n export interface MultiCOGComposite {\n r: string;\n g?: string;\n b?: string;\n a?: string;\n }\n\n interface Props {\n id: string;\n /**\n * Named sources — each key is the band name. Pass at least one entry per\n * band referenced in `composite`.\n */\n sources: Record<string, MultiCOGSourceConfig>;\n /**\n * Map source band names to RGB(A) output channels. Defaults to passing\n * the first source through to all channels (greyscale) if omitted.\n */\n composite?: MultiCOGComposite;\n /**\n * Post-processing render pipeline modules applied after band compositing\n * (e.g. LinearRescale, ColormapSprite, NDVI).\n */\n renderPipeline?: RasterModule[];\n /** Max reprojection error in pixels for mesh refinement. */\n maxError?: number;\n /** Maximum number of tiles to cache. */\n maxCacheSize?: number;\n /** Maximum cached tile byte size. */\n maxCacheByteSize?: number;\n /** Maximum concurrent tile requests. */\n maxRequests?: number;\n /** Tile fetch debounce (ms). */\n debounceTime?: number;\n /** Tile refinement strategy. */\n refinementStrategy?: 'best-available' | 'no-overlap' | 'never';\n /** Layer opacity (0-1). */\n opacity?: number;\n /** Layer visibility. */\n visible?: boolean;\n /** Enable picking. */\n pickable?: boolean;\n /** Auto-highlight on hover. */\n autoHighlight?: boolean;\n /** Insert layer before this layer id. */\n beforeId?: string;\n /** Show debug overlay on tiles. */\n debug?: boolean;\n /** Debug overlay opacity (0-1). */\n debugOpacity?: number;\n /** Debug verbosity: 1=coords, 2=+uv/tiles, 3=+stitched-size/meters/px. */\n debugLevel?: 1 | 2 | 3;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n maxError: 0.125,\n maxRequests: 6,\n refinementStrategy: 'best-available',\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n debug: false,\n debugOpacity: 0.5,\n debugLevel: 1,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n geotiffLoad: [\n sources: Map<string, GeoTIFF>,\n options: {\n primaryKey: string;\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const MultiCOGLayerClass = shallowRef<\n typeof import('@developmentseed/deck.gl-geotiff').MultiCOGLayer | null\n >(null);\n const epsgResolverFn = shallowRef<\n typeof import('@developmentseed/proj').epsgResolver | null\n >(null);\n\n const createLayer = () => {\n if (!MultiCOGLayerClass.value) return null;\n\n const layerProps: Record<string, unknown> = {\n id: toRaw(props.id),\n sources: toRaw(props.sources),\n opacity: toRaw(props.opacity),\n visible: toRaw(props.visible),\n pickable: toRaw(props.pickable),\n autoHighlight: toRaw(props.autoHighlight),\n debug: toRaw(props.debug),\n debugOpacity: toRaw(props.debugOpacity),\n debugLevel: toRaw(props.debugLevel),\n maxError: toRaw(props.maxError),\n };\n\n if (epsgResolverFn.value) {\n layerProps.epsgResolver = epsgResolverFn.value;\n }\n\n if (props.composite) {\n layerProps.composite = toRaw(props.composite);\n }\n if (props.renderPipeline) {\n layerProps.renderPipeline = toRaw(props.renderPipeline);\n }\n if (props.maxCacheSize !== undefined)\n layerProps.maxCacheSize = toRaw(props.maxCacheSize);\n if (props.maxCacheByteSize !== undefined)\n layerProps.maxCacheByteSize = toRaw(props.maxCacheByteSize);\n if (props.maxRequests !== 6)\n layerProps.maxRequests = toRaw(props.maxRequests);\n if (props.debounceTime !== undefined)\n layerProps.debounceTime = toRaw(props.debounceTime);\n if (props.refinementStrategy !== 'best-available')\n layerProps.refinementStrategy = toRaw(props.refinementStrategy);\n if (props.beforeId !== undefined)\n layerProps.beforeId = toRaw(props.beforeId);\n\n layerProps.onGeoTIFFLoad = (\n sources: Map<string, GeoTIFF>,\n options: {\n primaryKey: string;\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ) => {\n emit('geotiffLoad', sources, options);\n };\n\n const layer = new MultiCOGLayerClass.value(layerProps);\n return markRaw(layer);\n };\n\n const initializeLayer = async () => {\n try {\n const [geotiffModule, projModule] = await Promise.all([\n import('@developmentseed/deck.gl-geotiff'),\n import('@developmentseed/proj'),\n ]);\n\n MultiCOGLayerClass.value = markRaw(geotiffModule.MultiCOGLayer);\n epsgResolverFn.value = projModule.epsgResolver;\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-raster] Error loading MultiCOGLayer:', error);\n console.error(\n 'Make sure @developmentseed/deck.gl-geotiff and @developmentseed/proj are installed',\n );\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.sources,\n props.composite,\n props.renderPipeline,\n props.opacity,\n props.visible,\n props.debug,\n props.debugOpacity,\n props.debugLevel,\n props.maxError,\n ],\n () => {\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * VLayerDeckglZarr — GeoZarr tile rendering with reprojection.\n *\n * Wraps @developmentseed/deck.gl-zarr ZarrLayer.\n * The caller MUST open the zarr store with zarrita and pass the opened\n * Array/Group as `node`, plus `selection` for non-spatial dims, plus\n * `getTileData` + `renderTile` callbacks. This wrapper is intentionally\n * thin — ZarrLayer is data-format / shader-pipeline agnostic by design.\n *\n * @see https://github.com/developmentseed/deck.gl-raster/blob/main/examples/dynamical-zarr-ecmwf/src/App.tsx\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n markRaw,\n toRaw,\n } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import type {\n MinimalTileData,\n RenderTileResult,\n } from '@developmentseed/deck.gl-raster';\n import type {\n GetTileDataOptions,\n SliceInput,\n } from '@developmentseed/deck.gl-zarr';\n import type * as zarr from 'zarrita';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n /**\n * Pre-opened zarrita Array OR Group. The caller builds the store\n * (e.g. zarr.FetchStore + withConsolidatedMetadata) and opens it.\n */\n node: zarr.Array<zarr.DataType, zarr.Readable> | zarr.Group<zarr.Readable>;\n /**\n * Optional path to a variable within the store. Only used when `node`\n * is a Group. Ignored for direct Array nodes.\n */\n variable?: string;\n /**\n * Selection for non-spatial dims. One entry per non-spatial dim.\n * Use a number to pin to an index, `zarr.Slice` for a range, or `null`\n * for zarrita's default. For pure spatial arrays, pass `{}`.\n */\n selection: Record<string, SliceInput>;\n /**\n * Optional raw group attrs override. Use when the data source lacks\n * GeoZarr metadata and you want to inject it.\n */\n metadata?: unknown;\n /**\n * Tile fetcher. Receives the zarr Array for the chosen zoom level and\n * a pre-built sliceSpec. Must return a tile-shaped `DataT`.\n */\n getTileData: (\n arr: zarr.Array<zarr.DataType, zarr.Readable>,\n options: GetTileDataOptions,\n ) => Promise<MinimalTileData>;\n /**\n * Convert a loaded tile into a `RenderTileResult` (either `{ image }`\n * or `{ renderPipeline }`).\n */\n renderTile: (data: MinimalTileData) => RenderTileResult;\n /** Layer opacity (0-1). */\n opacity?: number;\n /** Layer visibility. */\n visible?: boolean;\n /** Enable picking. */\n pickable?: boolean;\n /** Insert layer before this layer id. */\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n opacity: 1,\n visible: true,\n pickable: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const ZarrLayerClass = shallowRef<\n typeof import('@developmentseed/deck.gl-zarr').ZarrLayer | null\n >(null);\n const epsgResolverFn = shallowRef<\n typeof import('@developmentseed/proj').epsgResolver | null\n >(null);\n\n const createLayer = () => {\n if (!ZarrLayerClass.value) return null;\n\n const layerProps: Record<string, unknown> = {\n id: toRaw(props.id),\n node: toRaw(props.node),\n selection: toRaw(props.selection),\n getTileData: props.getTileData,\n renderTile: props.renderTile,\n opacity: toRaw(props.opacity),\n visible: toRaw(props.visible),\n pickable: toRaw(props.pickable),\n };\n\n if (epsgResolverFn.value) {\n layerProps.epsgResolver = epsgResolverFn.value;\n }\n if (props.variable !== undefined) {\n layerProps.variable = toRaw(props.variable);\n }\n if (props.metadata !== undefined) {\n layerProps.metadata = toRaw(props.metadata);\n }\n if (props.beforeId !== undefined) {\n layerProps.beforeId = toRaw(props.beforeId);\n }\n\n const layer = new ZarrLayerClass.value(layerProps);\n return markRaw(layer);\n };\n\n const initializeLayer = async () => {\n try {\n const [zarrModule, projModule] = await Promise.all([\n import('@developmentseed/deck.gl-zarr'),\n import('@developmentseed/proj'),\n ]);\n\n ZarrLayerClass.value = markRaw(zarrModule.ZarrLayer);\n epsgResolverFn.value = projModule.epsgResolver;\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-raster] Error loading ZarrLayer:', error);\n console.error(\n 'Make sure @developmentseed/deck.gl-zarr, @developmentseed/proj, and zarrita are installed',\n );\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.node,\n props.variable,\n props.selection,\n props.metadata,\n props.opacity,\n props.visible,\n ],\n () => {\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { ref, computed, onMounted, onBeforeUnmount, watch } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import { WindParticleLayer, generateWindTexture } from 'maplibre-gl-wind';\n import type { ColorStop, WindDataPoint } from 'maplibre-gl-wind';\n import type { Color } from '../_shared/types';\n\n interface Props {\n id: string;\n imageUrl?: string;\n windData?: WindDataPoint[];\n bounds?: [number, number, number, number];\n uMin?: number;\n uMax?: number;\n vMin?: number;\n vMax?: number;\n numParticles?: number;\n maxAge?: number;\n speedFactor?: number;\n color?: Color;\n colorRamp?: ColorStop[];\n speedRange?: [number, number];\n width?: number;\n animate?: boolean;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n bounds: () => [-180, -90, 180, 90],\n uMin: -50,\n uMax: 50,\n vMin: -50,\n vMax: 50,\n numParticles: 8192,\n maxAge: 30,\n speedFactor: 50,\n color: () => [255, 255, 255, 200] as Color,\n colorRamp: () =>\n [\n [0.0, [59, 130, 189, 255]],\n [0.1, [102, 194, 165, 255]],\n [0.2, [171, 221, 164, 255]],\n [0.3, [230, 245, 152, 255]],\n [0.4, [254, 224, 139, 255]],\n [0.5, [253, 174, 97, 255]],\n [0.6, [244, 109, 67, 255]],\n [1.0, [213, 62, 79, 255]],\n ] as ColorStop[],\n speedRange: () => [0, 30],\n width: 1.5,\n animate: true,\n opacity: 1,\n visible: true,\n pickable: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n loaded: [];\n error: [error: Error];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const isLayerAdded = ref(false);\n const currentImageUrl = ref<string | null>(null);\n const windMetadata = ref({\n uMin: props.uMin,\n uMax: props.uMax,\n vMin: props.vMin,\n vMax: props.vMax,\n });\n\n const imageUnscale = computed(() => {\n const uRange = windMetadata.value.uMax - windMetadata.value.uMin;\n const vRange = windMetadata.value.vMax - windMetadata.value.vMin;\n return [Math.min(uRange, vRange) * -1, Math.max(uRange, vRange)];\n });\n\n const createLayer = () => {\n if (!currentImageUrl.value) return null;\n\n return new WindParticleLayer({\n id: props.id,\n image: currentImageUrl.value,\n bounds: props.bounds,\n imageUnscale: imageUnscale.value,\n numParticles: props.numParticles,\n maxAge: props.maxAge,\n speedFactor: props.speedFactor,\n color: props.color,\n colorRamp: props.colorRamp,\n speedRange: props.speedRange,\n width: props.width,\n animate: props.animate,\n wrapLongitude: true,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n });\n };\n\n const processWindData = (data: WindDataPoint[]) => {\n try {\n const result = generateWindTexture(data, {\n width: 360,\n height: 180,\n bounds: props.bounds,\n });\n\n windMetadata.value = {\n uMin: result.uMin,\n uMax: result.uMax,\n vMin: result.vMin,\n vMax: result.vMax,\n };\n\n currentImageUrl.value = result.canvas.toDataURL('image/png');\n return true;\n } catch (err) {\n emit('error', err instanceof Error ? err : new Error(String(err)));\n return false;\n }\n };\n\n const initializeLayer = () => {\n if (props.windData && props.windData.length > 0) {\n if (!processWindData(props.windData)) return;\n } else if (props.imageUrl) {\n currentImageUrl.value = props.imageUrl;\n windMetadata.value = {\n uMin: props.uMin,\n uMax: props.uMax,\n vMin: props.vMin,\n vMax: props.vMax,\n };\n } else {\n return;\n }\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n isLayerAdded.value = true;\n emit('loaded');\n }\n };\n\n const updateWindLayer = () => {\n if (!isLayerAdded.value) return;\n\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => props.windData,\n (newData) => {\n if (newData && newData.length > 0) {\n if (processWindData(newData)) {\n updateWindLayer();\n }\n }\n },\n { deep: true },\n );\n\n watch(\n () => props.imageUrl,\n (newUrl) => {\n if (newUrl && !props.windData) {\n currentImageUrl.value = newUrl;\n windMetadata.value = {\n uMin: props.uMin,\n uMax: props.uMax,\n vMin: props.vMin,\n vMax: props.vMax,\n };\n updateWindLayer();\n }\n },\n );\n\n watch(\n () => [\n props.numParticles,\n props.maxAge,\n props.speedFactor,\n props.color,\n props.colorRamp,\n props.speedRange,\n props.width,\n props.animate,\n props.opacity,\n props.visible,\n ],\n () => {\n updateWindLayer();\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n layer: unknown;\n }\n\n const props = defineProps<Props>();\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const getLayerId = (layer: unknown): string => {\n return (layer as { id: string }).id;\n };\n\n const initializeLayer = () => {\n addLayer(props.layer);\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => props.layer,\n (newLayer, oldLayer) => {\n const oldId = oldLayer ? getLayerId(oldLayer) : null;\n const newId = getLayerId(newLayer);\n\n if (oldId && oldId !== newId) {\n removeLayer(oldId);\n addLayer(newLayer);\n } else {\n updateLayer(newId, newLayer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(getLayerId(props.layer));\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import maplibregl, { Map } from 'maplibre-gl';\n import { Protocol } from 'pmtiles';\n import { onMounted, provide, ref, shallowRef } from 'vue';\n import type { MapOptions, MapEventType } from 'maplibre-gl';\n import type { Ref } from 'vue';\n import { mapEvents } from '../constants/events';\n import { MapKey, PMTileProtocolKey } from '../utils/symbols';\n import { useDeckOverlay } from '../layers/deckgl/_shared/useDeckOverlay';\n\n const props = withDefaults(\n defineProps<{\n options: MapOptions;\n supportPmtiles?: boolean;\n }>(),\n {\n options: () => ({ container: 'map' }) as MapOptions,\n supportPmtiles: false,\n },\n );\n const emit = defineEmits(['loaded', ...mapEvents]);\n\n if (props.supportPmtiles) {\n const protocol = new Protocol({ metadata: true });\n maplibregl.addProtocol('pmtiles', protocol.tile);\n provide(PMTileProtocolKey, protocol);\n }\n\n const map: Ref<Map | null> = shallowRef(null); // Initialize as null\n const loaded: Ref<boolean> = ref(false);\n const events: Ref<Array<keyof MapEventType>> = ref(mapEvents);\n\n // Provide the map reference immediately\n provide(MapKey, map);\n\n // Initialize deck.gl overlay at VMap level so all children can access it\n // This provides DeckOverlayKey and DeckLayersKey to all descendants\n useDeckOverlay(map);\n\n onMounted(() => {\n map.value = new Map(props.options);\n loaded.value = true;\n listenMapEvents();\n });\n\n const listenMapEvents = () => {\n if (!map.value) return;\n\n events.value.forEach((e) => {\n map.value?.on(e, (evt) => {\n switch (e) {\n case 'load':\n emit('loaded', map.value);\n break;\n default:\n emit(e, evt);\n break;\n }\n });\n });\n };\n</script>\n\n<template>\n <div :id=\"`${options?.container}`\" class=\"v-map-container\">\n <slot v-if=\"loaded\">\n <slot></slot>\n </slot>\n </div>\n</template>\n\n<style scoped>\n canvas {\n outline: none;\n }\n\n .v-map-container {\n width: 100%;\n height: 100%;\n }\n</style>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { ref, onMounted, onBeforeUnmount, watch } from 'vue';\n import type { LngLatLike, Marker, PopupOptions, Map } from 'maplibre-gl';\n import { Popup } from 'maplibre-gl';\n import { popupEvents } from '../constants/events';\n import { injectStrict, MapKey } from '../utils';\n\n const props = withDefaults(\n defineProps<{\n options: PopupOptions;\n coordinates: LngLatLike;\n marker?: Marker;\n }>(),\n {\n options: () => ({}) as PopupOptions,\n coordinates: () => ({}) as LngLatLike,\n marker: () => ({}) as Marker,\n },\n );\n\n const emit = defineEmits<{\n (e: 'added', payload: { popup: Popup }): void;\n (e: 'removed' | 'open' | 'close'): void;\n }>();\n\n const map = injectStrict(MapKey);\n const popup = new Popup(props.options);\n const loaded: Ref<boolean> = ref(true);\n const content = ref<HTMLElement | null>(null);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const setPopupContent = (): void => {\n try {\n if (content.value) {\n popup.setDOMContent(content.value);\n }\n } catch (error) {\n console.error('Error setting popup content:', error);\n }\n };\n\n const setPopupCoordinates = (): void => {\n try {\n popup.setLngLat(props.coordinates);\n } catch (error) {\n console.error('Error setting popup coordinates:', error);\n }\n };\n\n const addToMarker = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if ('setPopup' in props.marker) {\n props.marker.setPopup(popup);\n } else {\n popup.addTo(mapInstance);\n }\n emit('added', { popup });\n } catch (error) {\n console.error('Error adding popup to marker:', error);\n }\n };\n\n const remove = (): void => {\n try {\n popup.remove();\n emit('removed');\n } catch (error) {\n console.error('Error removing popup:', error);\n }\n };\n\n const listenPopupEvents = (): void => {\n try {\n popupEvents.forEach((event) => {\n popup.on(event, () => {\n emit(event);\n });\n });\n } catch (error) {\n console.error('Error setting up popup events:', error);\n }\n };\n\n const removePopupEvents = (): void => {\n try {\n popupEvents.forEach((event) => {\n popup.off(event, () => {\n emit(event);\n });\n });\n } catch (error) {\n console.error('Error removing popup events:', error);\n }\n };\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch for coordinates changes\n watch(\n () => props.coordinates,\n () => {\n setPopupCoordinates();\n },\n { deep: true },\n );\n\n // Lifecycle hooks\n onMounted(() => {\n if (loaded.value) {\n try {\n setPopupContent();\n setPopupCoordinates();\n addToMarker();\n listenPopupEvents();\n } catch (error) {\n console.error('Error initializing popup:', error);\n }\n } else {\n remove();\n removePopupEvents();\n }\n });\n\n onBeforeUnmount(() => {\n remove();\n removePopupEvents();\n });\n</script>\n\n<template>\n <section :id=\"`popup-${Date.now()}`\" ref=\"content\">\n <slot></slot>\n </section>\n</template>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { ref, watch, onMounted, onBeforeUnmount, useSlots } from 'vue';\n import type {\n LngLatLike,\n MarkerOptions,\n PopupOptions,\n Map,\n } from 'maplibre-gl';\n import { Marker } from 'maplibre-gl';\n import VPopup from '../popups/VPopup.vue';\n import { markerDOMEvents, markerMapEvents } from '../constants/events';\n import { injectStrict, MapKey } from '../utils';\n\n const slots = useSlots();\n\n const props = withDefaults(\n defineProps<{\n coordinates: LngLatLike;\n options?: MarkerOptions;\n popupOptions?: PopupOptions;\n cursor?: string;\n }>(),\n {\n options: () => ({}),\n popupOptions: () => ({}),\n cursor: 'pointer',\n },\n );\n\n const emit = defineEmits([\n 'added',\n 'update:coordinates',\n 'removed',\n ...markerMapEvents,\n ...markerDOMEvents,\n ]);\n\n const map = injectStrict(MapKey);\n const marker: Ref<Marker | null> = ref(null);\n const loaded = ref(true);\n const isMarkerAvailable = ref(false);\n const slotRef = ref<HTMLElement | null>(null);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const setSlotRef = (el: HTMLElement | Element | null) => {\n if (el instanceof HTMLElement) {\n slotRef.value = el;\n }\n };\n\n const setMarkerCoordinates = (markerInstance: Marker): void => {\n try {\n markerInstance.setLngLat(props.coordinates);\n } catch (error) {\n console.error('Error setting marker coordinates:', error);\n }\n };\n\n const setCursorPointer = (markerInstance: Marker): void => {\n try {\n markerInstance.getElement().style.cursor = props.cursor || 'default';\n } catch (error) {\n console.error('Error setting cursor:', error);\n }\n };\n\n const addToMap = (markerInstance: Marker): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n markerInstance.addTo(mapInstance);\n emit('added', { marker: markerInstance });\n } catch (error) {\n console.error('Error adding marker to map:', error);\n }\n };\n\n const removeFromMap = (markerInstance: Marker): void => {\n try {\n markerInstance.remove();\n emit('removed');\n } catch (error) {\n console.error('Error removing marker from map:', error);\n }\n };\n\n const listenMarkerEvents = (markerInstance: Marker): void => {\n try {\n let coordinates: LngLatLike;\n markerMapEvents.forEach((event: string) => {\n markerInstance.on(event, (e: { target: Marker }) => {\n if (event === 'dragend') {\n if (Array.isArray(props.coordinates)) {\n coordinates = [\n e.target.getLngLat().lng,\n e.target.getLngLat().lat,\n ];\n } else {\n coordinates = e.target.getLngLat();\n }\n emit('update:coordinates', coordinates);\n }\n emit(event, e);\n });\n });\n\n markerDOMEvents.forEach((event: string) => {\n markerInstance.getElement().addEventListener(event, (e) => {\n emit(event, e);\n });\n });\n } catch (error) {\n console.error('Error setting up marker events:', error);\n }\n };\n\n // Watchers\n watch(marker, (markerValue) => {\n isMarkerAvailable.value = markerValue !== null && '_map' in markerValue;\n });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n const initMarker = (element?: HTMLElement) => {\n if (!loaded.value || marker.value) return;\n\n try {\n const markerOptions: MarkerOptions = {\n ...props.options,\n element: element || undefined,\n };\n marker.value = new Marker(markerOptions);\n setMarkerCoordinates(marker.value);\n addToMap(marker.value);\n setCursorPointer(marker.value);\n listenMarkerEvents(marker.value);\n } catch (error) {\n console.error('Error initializing marker:', error);\n }\n };\n\n watch(slotRef, (el) => {\n if (el && !marker.value) {\n initMarker(el);\n }\n });\n\n onMounted(() => {\n const hasCustomElement = !!slots.markers;\n if (!hasCustomElement) {\n initMarker();\n }\n });\n\n onBeforeUnmount(() => {\n if (marker.value) {\n removeFromMap(marker.value);\n }\n });\n</script>\n\n<template>\n <section :id=\"`marker-${Date.now()}`\" class=\"absolute\">\n <slot :set-ref=\"setSlotRef\" name=\"markers\"></slot>\n <template v-if=\"isMarkerAvailable && $slots.default\">\n <v-popup\n :marker=\"marker!\"\n :options=\"popupOptions\"\n :coordinates=\"coordinates\"\n >\n <slot></slot>\n </v-popup>\n </template>\n </section>\n</template>\n\n<style>\n .absolute {\n position: absolute !important;\n }\n</style>\n","import {\n VControlAttribution,\n VControlFullscreen,\n VControlGeolocate,\n VControlNavigation,\n VControlScale,\n VControlLidar,\n VControlLayer,\n VControlLayerGroup,\n VControlLegend,\n} from './controls';\n\nimport {\n VLayerMaplibreCanvas,\n VLayerMaplibreGeojson,\n VLayerMaplibreCluster,\n VLayerMaplibreImage,\n VLayerMaplibreRaster,\n VLayerMaplibreVector,\n VLayerMaplibreVideo,\n VLayerMaplibrePmtile,\n VLayerMaplibreRoute,\n VLayerMaplibreIsochrone,\n VLayerMaplibreStarfield,\n} from './layers';\n\nimport VMap from './map/VMap.vue';\nimport VMarker from './markers/VMarker.vue';\nimport VPopup from './popups/VPopup.vue';\n\nexport {\n VMap,\n VMarker,\n VPopup,\n VLayerMaplibreCanvas,\n VLayerMaplibreGeojson,\n VLayerMaplibreCluster,\n VLayerMaplibreImage,\n VLayerMaplibreRaster,\n VLayerMaplibreVector,\n VLayerMaplibreVideo,\n VLayerMaplibrePmtile,\n VLayerMaplibreRoute,\n VLayerMaplibreIsochrone,\n VLayerMaplibreStarfield,\n VControlAttribution,\n VControlFullscreen,\n VControlGeolocate,\n VControlNavigation,\n VControlScale,\n VControlLidar,\n VControlLayer,\n VControlLayerGroup,\n VControlLegend,\n};\n\nexport type {\n LidarControlOptions,\n ColorScheme,\n ColorSchemeType,\n ColorSchemeConfig,\n CopcLoadingMode,\n ColormapName,\n ColorRangeConfig,\n PointCloudInfo,\n PointCloudBounds,\n StreamingProgress,\n StreamingLoaderOptions,\n LayerControlOptions,\n LayerType,\n ControlPosition,\n LayerConfig,\n LegendType,\n CategoryLegendItem,\n GradientLegendItem,\n SizeLegendItem,\n TableLegendItem,\n LegendControlOptions,\n FilterState,\n} from './controls';\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EAAc,EAAO,MAAK,EAE7B,aAID,EAWU,UAAA,CAXA,GAAE,UAAY,KAAK,KAAG,GAAM,MAAM,aAC1C,EAAkD,EAAA,OAAA,UAAA,CAA3C,OAAS,EAAU,CAAA,CACV,EAAA,OAAqBA,EAAAA,OAAO,SAAA,GAAA,CAC1C,EAMU,GAAA,OALP,OAAQ,EAAA,MACR,QAAS,EAAA,aACT,YAAa,EAAA,4BAED,CAAb,EAAa,EAAA,OAAA,UAAA,CAAA,CAAA,qECvHrB,IAAA,GAAeC"}
1
+ {"version":3,"file":"index.js","names":["$slots","VMap"],"sources":["../src/utils/injects.ts","../src/utils/require-peer.ts","../src/layers/deckgl/_shared/useDeckOverlay.ts","../src/utils/symbols.ts","../src/controls/attribution/VControlAttribution.vue","../src/controls/fullscreen/VControlFullscreen.vue","../src/controls/geolocate/events.ts","../src/controls/geolocate/VControlGeolocate.vue","../src/controls/navigation/VControlNavigation.vue","../src/controls/scale/VControlScale.vue","../src/controls/lidar/events.ts","../src/controls/lidar/VControlLidar.vue","../src/controls/_shared/useMapControl.ts","../src/controls/layer/VControlLayer.vue","../src/controls/layer/VControlLayerGroup.vue","../src/controls/legend/VControlLegend.vue","../src/layers/maplibre/canvas/VLayerMaplibreCanvas.vue","../src/layers/maplibre/geojson/VLayerMaplibreGeojson.vue","../src/layers/maplibre/image/VLayerMaplibreImage.vue","../src/layers/maplibre/raster/VLayerMaplibreRaster.vue","../src/constants/events/layer.ts","../src/constants/events/map.ts","../src/constants/events/marker.ts","../src/constants/events/popup.ts","../src/layers/maplibre/vector/VLayerMaplibreVector.vue","../src/layers/maplibre/video/VLayerMaplibreVideo.vue","../src/layers/maplibre/pmtile/VLayerMaplibrePmtile.vue","../src/layers/maplibre/custom/cluster/VLayerMaplibreCluster.vue","../src/layers/maplibre/custom/route/VLayerMaplibreRoute.vue","../src/layers/maplibre/custom/isochrone/VLayerMaplibreIsochrone.vue","../src/layers/maplibre/custom/starfield/VLayerMaplibreStarfield.vue","../src/layers/deckgl/scatterplot/VLayerDeckglScatterplot.vue","../src/layers/deckgl/arc/VLayerDeckglArc.vue","../src/layers/deckgl/geojson/VLayerDeckglGeojson.vue","../src/layers/deckgl/path/VLayerDeckglPath.vue","../src/layers/deckgl/line/VLayerDeckglLine.vue","../src/layers/deckgl/polygon/VLayerDeckglPolygon.vue","../src/layers/deckgl/solid-polygon/VLayerDeckglSolidPolygon.vue","../src/layers/deckgl/icon/VLayerDeckglIcon.vue","../src/layers/deckgl/text/VLayerDeckglText.vue","../src/layers/deckgl/column/VLayerDeckglColumn.vue","../src/layers/deckgl/bitmap/VLayerDeckglBitmap.vue","../src/layers/deckgl/grid-cell/VLayerDeckglGridCell.vue","../src/layers/deckgl/point-cloud/VLayerDeckglPointCloud.vue","../src/layers/deckgl/heatmap/VLayerDeckglHeatmap.vue","../src/layers/deckgl/hexagon/VLayerDeckglHexagon.vue","../src/layers/deckgl/grid/VLayerDeckglGrid.vue","../src/layers/deckgl/contour/VLayerDeckglContour.vue","../src/layers/deckgl/screen-grid/VLayerDeckglScreenGrid.vue","../src/layers/deckgl/trips/VLayerDeckglTrips.vue","../src/layers/deckgl/h3-hexagon/VLayerDeckglH3Hexagon.vue","../src/layers/deckgl/h3-cluster/VLayerDeckglH3Cluster.vue","../src/layers/deckgl/mvt/VLayerDeckglMVT.vue","../src/layers/deckgl/tile/VLayerDeckglTile.vue","../src/layers/deckgl/tile-3d/VLayerDeckglTile3D.vue","../src/layers/deckgl/terrain/VLayerDeckglTerrain.vue","../src/layers/deckgl/great-circle/VLayerDeckglGreatCircle.vue","../src/layers/deckgl/s2/VLayerDeckglS2.vue","../src/layers/deckgl/geohash/VLayerDeckglGeohash.vue","../src/layers/deckgl/quadkey/VLayerDeckglQuadkey.vue","../src/layers/deckgl/wms/VLayerDeckglWMS.vue","../src/layers/deckgl/simple-mesh/VLayerDeckglSimpleMesh.vue","../src/layers/deckgl/scenegraph/VLayerDeckglScenegraph.vue","../src/layers/deckgl/cog/VLayerDeckglCOG.vue","../src/layers/deckgl/mosaic/VLayerDeckglMosaic.vue","../src/layers/deckgl/multi-cog/VLayerDeckglMultiCOG.vue","../src/layers/deckgl/zarr/VLayerDeckglZarr.vue","../src/layers/deckgl/wind-particle/VLayerDeckglWindParticle.vue","../src/layers/deckgl/generic/VLayerDeckgl.vue","../src/map/VMap.vue","../src/popups/VPopup.vue","../src/markers/VMarker.vue","../src/index.ts"],"sourcesContent":["import type { InjectionKey } from 'vue';\nimport { inject } from 'vue';\n\n/**\n * Dependency injection 🥳\n * @param {InjectionKey} key - The key to inject\n * @param {string | undefined} fallback - The fallback value\n * @returns {undefined} - The value\n */\nexport function injectStrict<T>(key: InjectionKey<T>, fallback?: T): T {\n const resolved = inject(key, fallback);\n if (!resolved) {\n throw new Error(`Could not resolve ${key.description}`);\n }\n return resolved;\n}\n","/**\n * Wraps a dynamic `import()` of an optional peer dependency and converts the\n * opaque bundler `Cannot find module '…'` error into an actionable message\n * that names the package and includes a copy-pasteable install command.\n *\n * Use this **only** in non-Vue-SFC contexts (composables, lazy data loaders,\n * controls that already use `await import()`). Inside `<script setup>` of a\n * Vue component, prefer the existing top-level `import` statements — Vue\n * templates render synchronously and turning component-level imports into\n * dynamic ones changes the component contract.\n *\n * @example\n * ```ts\n * const { LidarControl } = await requirePeer(\n * 'maplibre-gl-lidar',\n * () => import('maplibre-gl-lidar'),\n * );\n * ```\n *\n * @example Custom install command (e.g. multi-package install)\n * ```ts\n * const mod = await requirePeer(\n * '@developmentseed/deck.gl-geotiff',\n * () => import('@developmentseed/deck.gl-geotiff'),\n * 'pnpm add @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj',\n * );\n * ```\n *\n * @param packageName - The npm package name (used in the error message).\n * @param loader - A thunk returning `import('<packageName>')`. Must be a thunk\n * so the bundler can split it and so the import is evaluated lazily.\n * @param installCommand - Optional override for the install hint. Defaults to\n * `pnpm add <packageName>`. Pass a custom command when several peer packages\n * must be installed together.\n * @returns The resolved module exports.\n * @throws Error with a descriptive message naming the package, the install\n * command, and the underlying loader error.\n */\nexport async function requirePeer<T>(\n packageName: string,\n loader: () => Promise<T>,\n installCommand?: string,\n): Promise<T> {\n try {\n return await loader();\n } catch (cause) {\n const install = installCommand ?? `pnpm add ${packageName}`;\n const reason = cause instanceof Error ? cause.message : String(cause);\n const error = new Error(\n `[@geoql/v-maplibre] Missing optional peer dependency \"${packageName}\". ` +\n `Install it with: ${install}\\nOriginal error: ${reason}`,\n );\n if (cause instanceof Error && cause.stack) {\n error.stack = `${error.message}\\nCaused by: ${cause.stack}`;\n }\n throw error;\n }\n}\n","import {\n inject,\n provide,\n ref,\n shallowRef,\n onUnmounted,\n watch,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport type { MapboxOverlay } from '@deck.gl/mapbox';\nimport type { Map, MapMouseEvent } from 'maplibre-gl';\nimport { requirePeer } from '../../../utils';\n\nexport const DeckOverlayKey: InjectionKey<ShallowRef<MapboxOverlay | null>> =\n Symbol('DeckOverlay');\n\nexport const DeckLayersKey: InjectionKey<{\n addLayer: (layer: unknown) => void;\n removeLayer: (layerId: string) => void;\n updateLayer: (layerId: string, layer: unknown) => void;\n getLayers: () => unknown[];\n}> = Symbol('DeckLayers');\n\ninterface UseDeckOverlayOptions {\n interleaved?: boolean;\n}\n\ninterface UseDeckOverlayReturn {\n overlay: ShallowRef<MapboxOverlay | null>;\n layers: Ref<unknown[]>;\n isInitialized: Ref<boolean>;\n initOverlay: () => Promise<void>;\n addLayer: (layer: unknown) => void;\n removeLayer: (layerId: string) => void;\n updateLayer: (layerId: string, layer: unknown) => void;\n getLayers: () => unknown[];\n}\n\nexport function useDeckOverlay(\n map: Ref<Map | null>,\n options: UseDeckOverlayOptions = {},\n): UseDeckOverlayReturn {\n const { interleaved = false } = options;\n\n const existingOverlay = inject(DeckOverlayKey, null);\n const existingLayersRegistry = inject(DeckLayersKey, null);\n\n if (existingOverlay && existingLayersRegistry) {\n return {\n overlay: existingOverlay,\n isInitialized: ref(true),\n layers: ref([]),\n initOverlay: () => Promise.resolve(),\n ...existingLayersRegistry,\n };\n }\n\n const overlay = shallowRef<MapboxOverlay | null>(null);\n const layers = ref<unknown[]>([]);\n const isInitialized = ref(false);\n let initPromise: Promise<void> | null = null;\n let clickHandler: ((e: MapMouseEvent) => void) | null = null;\n\n /**\n * Workaround for deck.gl MapboxOverlay click events not reaching layer onClick\n * callbacks. The built-in path (_onPointerDown → _onEvent → getLastPickedObject)\n * fails to dispatch clicks. We register our own MapLibre click handler that uses\n * overlay.pickObject() for a fresh GPU pick and dispatches to the layer's onClick.\n */\n function registerClickHandler(mapInstance: Map): void {\n clickHandler = (e: MapMouseEvent) => {\n if (!overlay.value) return;\n const info = overlay.value.pickObject({\n x: e.point.x,\n y: e.point.y,\n radius: 5,\n });\n if (!info?.layer) return;\n\n const layerProps = info.layer.props as Record<string, unknown>;\n const onClick = layerProps.onClick as\n | ((i: unknown, ev: unknown) => boolean | void)\n | undefined;\n if (onClick) {\n onClick(info, e);\n }\n };\n mapInstance.on('click', clickHandler);\n }\n\n function removeClickHandler(mapInstance: Map | null): void {\n if (clickHandler && mapInstance) {\n mapInstance.off('click', clickHandler);\n }\n clickHandler = null;\n }\n\n const initOverlay = (): Promise<void> => {\n const mapInstance = map.value;\n if (!mapInstance) return Promise.resolve();\n if (overlay.value) return Promise.resolve();\n if (initPromise) return initPromise;\n\n initPromise = requirePeer(\n '@deck.gl/mapbox',\n () => import('@deck.gl/mapbox'),\n 'pnpm add @deck.gl/core @deck.gl/mapbox',\n )\n .then(({ MapboxOverlay }) => {\n if (overlay.value) return;\n\n overlay.value = new MapboxOverlay({\n interleaved,\n layers: [],\n });\n\n mapInstance.addControl(overlay.value);\n registerClickHandler(mapInstance);\n isInitialized.value = true;\n })\n .catch((error) => {\n console.error('[deck.gl] Error initializing overlay:', error);\n initPromise = null;\n });\n\n return initPromise;\n };\n\n const getLayerId = (layer: unknown): string => {\n return (layer as { id: string }).id;\n };\n\n const syncLayers = () => {\n if (overlay.value) {\n overlay.value.setProps({ layers: layers.value as never });\n }\n };\n\n const addLayer = (layer: unknown): void => {\n const layerId = getLayerId(layer);\n const existingIndex = layers.value.findIndex(\n (l) => getLayerId(l) === layerId,\n );\n\n if (existingIndex >= 0) {\n layers.value = [\n ...layers.value.slice(0, existingIndex),\n layer,\n ...layers.value.slice(existingIndex + 1),\n ];\n } else {\n layers.value = [...layers.value, layer];\n }\n\n if (overlay.value) {\n syncLayers();\n } else {\n initOverlay().then(syncLayers);\n }\n };\n\n const removeLayer = (layerId: string): void => {\n layers.value = layers.value.filter((l) => getLayerId(l) !== layerId);\n syncLayers();\n };\n\n const updateLayer = (layerId: string, newLayer: unknown): void => {\n const index = layers.value.findIndex((l) => getLayerId(l) === layerId);\n if (index >= 0) {\n layers.value = [\n ...layers.value.slice(0, index),\n newLayer,\n ...layers.value.slice(index + 1),\n ];\n syncLayers();\n } else {\n addLayer(newLayer);\n }\n };\n\n const getLayers = (): unknown[] => {\n return [...layers.value];\n };\n\n watch(\n map,\n (mapInstance) => {\n if (mapInstance && !overlay.value) {\n if (mapInstance.isStyleLoaded()) {\n initOverlay();\n } else {\n mapInstance.once('style.load', () => {\n initOverlay();\n });\n }\n }\n },\n { immediate: true },\n );\n\n provide(DeckOverlayKey, overlay);\n provide(DeckLayersKey, {\n addLayer,\n removeLayer,\n updateLayer,\n getLayers,\n });\n\n onUnmounted(() => {\n removeClickHandler(map.value);\n if (overlay.value && map.value) {\n try {\n map.value.removeControl(overlay.value);\n overlay.value.finalize();\n } catch (error) {\n console.error('[deck.gl] Error cleaning up overlay:', error);\n }\n }\n overlay.value = null;\n layers.value = [];\n isInitialized.value = false;\n initPromise = null;\n });\n\n return {\n overlay,\n layers,\n isInitialized,\n initOverlay,\n addLayer,\n removeLayer,\n updateLayer,\n getLayers,\n };\n}\n\nexport function useDeckLayers() {\n const registry = inject(DeckLayersKey, null);\n const overlay = inject(DeckOverlayKey, null);\n\n if (!registry) {\n throw new Error(\n '[deck.gl] useDeckLayers must be used within a component that has initialized useDeckOverlay',\n );\n }\n\n return {\n ...registry,\n overlay,\n };\n}\n","import type { Map } from 'maplibre-gl';\nimport type { Protocol } from 'pmtiles';\nimport type { InjectionKey, Ref } from 'vue';\n\nconst MapKey: InjectionKey<Ref<Map | null>> = Symbol('Map');\nconst PMTileProtocolKey: InjectionKey<Protocol | null> = Symbol('Protocol');\n\nexport { MapKey, PMTileProtocolKey };\nexport {\n DeckOverlayKey,\n DeckLayersKey,\n} from '../layers/deckgl/_shared/useDeckOverlay';\n","<script setup lang=\"ts\">\n import { AttributionControl } from 'maplibre-gl';\n import { onMounted, useSlots } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import type { AttributionControlOptions, ControlPosition } from './types';\n\n const defaultOptions: AttributionControlOptions = {\n compact: false,\n customAttribution: undefined,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: AttributionControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'bottom-right',\n },\n );\n\n const slots = useSlots();\n\n const map = injectStrict(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n let options = defaultOptions;\n if (props.options) {\n options = {\n ...props.options,\n };\n }\n if (slots && slots.default?.()) {\n options.customAttribution = slots.default()[0]!\n .children as unknown as string;\n }\n const control = new AttributionControl(options);\n map.value!.addControl(control, props.position);\n };\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { FullscreenControl } from 'maplibre-gl';\n import { onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import type { ControlPosition, FullscreenControlOptions } from './types';\n\n const defaultOptions: FullscreenControlOptions = {\n container: undefined,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: FullscreenControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'top-left',\n },\n );\n\n const map = injectStrict(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new FullscreenControl(props.options || defaultOptions);\n map.value!.addControl(control, props.position);\n };\n</script>\n","export const geolocateControlEvents: string[] = [\n 'geolocate',\n 'error',\n 'outofmaxbounds',\n 'trackuserlocationstart',\n 'trackuserlocationend',\n];\n","<script setup lang=\"ts\">\n import { GeolocateControl } from 'maplibre-gl';\n import { onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { geolocateControlEvents as events } from './events';\n import type { ControlPosition, GeolocateControlOptions } from './types';\n\n const defaultOptions: GeolocateControlOptions = {\n fitBoundsOptions: {\n linear: false,\n offset: [0, 0],\n maxZoom: 22,\n },\n positionOptions: {\n enableHighAccuracy: true,\n maximumAge: 0,\n timeout: 6000,\n },\n trackUserLocation: true,\n showAccuracyCircle: true,\n showUserLocation: true,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: GeolocateControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'top-left',\n },\n );\n\n const emit = defineEmits(events);\n\n const map = injectStrict(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new GeolocateControl(props.options || defaultOptions);\n map.value!.addControl(control, props.position);\n events.forEach((event: string) => {\n control.on(event, () => {\n emit(event);\n });\n });\n };\n</script>\n","<script setup lang=\"ts\">\n import { NavigationControl } from 'maplibre-gl';\n import { onMounted, inject } from 'vue';\n import { MapKey } from '../../utils';\n import type { ControlPosition, NavigationOptions } from './types';\n\n const defaultOptions: NavigationOptions = {\n showCompass: true,\n showZoom: true,\n visualizePitch: true,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: NavigationOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'top-left',\n },\n );\n\n const map = inject(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new NavigationControl(props.options || defaultOptions);\n map!.value!.addControl(control, props.position);\n };\n</script>\n","<script setup lang=\"ts\">\n import { onMounted, inject } from 'vue';\n import { ScaleControl } from 'maplibre-gl';\n import { MapKey } from '../../utils';\n import type { ControlPosition, ScaleControlOptions } from './types';\n\n const defaultOptions: ScaleControlOptions = {\n maxWidth: 100,\n unit: 'metric',\n };\n\n const props = withDefaults(\n defineProps<{\n options?: ScaleControlOptions;\n position?: ControlPosition;\n }>(),\n {\n options: undefined,\n position: 'bottom-left',\n },\n );\n\n const map = inject(MapKey);\n\n onMounted(() => {\n addControl();\n });\n\n const addControl = (): void => {\n const control = new ScaleControl(props.options || defaultOptions);\n map?.value!.addControl(control, props.position);\n };\n</script>\n\n<template>\n <slot></slot>\n</template>\n","export const lidarControlEvents: string[] = [\n 'load',\n 'loadstart',\n 'loaderror',\n 'unload',\n 'statechange',\n 'stylechange',\n 'collapse',\n 'expand',\n 'streamingstart',\n 'streamingstop',\n 'streamingprogress',\n 'budgetreached',\n];\n","<script setup lang=\"ts\">\n /**\n * COPC / LAZ point-cloud viewer control with streaming + colormap controls.\n *\n * @requires `maplibre-gl-lidar`\n *\n * Install with:\n * `pnpm add maplibre-gl-lidar`\n */\n import { onMounted, onUnmounted, ref } from 'vue';\n import { MapKey, injectStrict, requirePeer } from '../../utils';\n import { lidarControlEvents as events } from './events';\n import type {\n ControlPosition,\n LidarControlOptions,\n ColorScheme,\n ColormapName,\n ColorRangeConfig,\n PointCloudInfo,\n StreamingLoaderOptions,\n CopcLoadingMode,\n } from './types';\n\n const defaultOptions: LidarControlOptions = {\n collapsed: true,\n pointSize: 2,\n colorScheme: 'elevation',\n pickable: false,\n autoZoom: true,\n };\n\n const props = withDefaults(\n defineProps<{\n options?: LidarControlOptions;\n position?: ControlPosition;\n defaultUrl?: string;\n }>(),\n {\n options: undefined,\n position: 'top-right',\n defaultUrl: undefined,\n },\n );\n\n const emit = defineEmits(events);\n\n const map = injectStrict(MapKey);\n\n interface LidarControlInstance {\n on: (event: string, handler: (data?: unknown) => void) => void;\n off: (event: string, handler: (data?: unknown) => void) => void;\n loadPointCloud: (\n source: string | File | ArrayBuffer,\n options?: { loadingMode?: CopcLoadingMode },\n ) => Promise<PointCloudInfo>;\n loadPointCloudStreaming: (\n source: string | File | ArrayBuffer,\n options?: StreamingLoaderOptions,\n ) => Promise<PointCloudInfo>;\n loadPointCloudEptStreaming: (\n eptUrl: string,\n options?: StreamingLoaderOptions,\n ) => Promise<PointCloudInfo>;\n unloadPointCloud: (id?: string) => void;\n flyToPointCloud: (id?: string) => void;\n setPointSize: (size: number) => void;\n setOpacity: (opacity: number) => void;\n setColorScheme: (scheme: ColorScheme) => void;\n setColormap: (colormap: ColormapName) => void;\n getColormap: () => ColormapName;\n setColorRange: (config: ColorRangeConfig) => void;\n getColorRange: () => ColorRangeConfig;\n setUsePercentile: (use: boolean) => void;\n getUsePercentile: () => boolean;\n setPickable: (pickable: boolean) => void;\n setElevationRange: (min: number, max: number) => void;\n clearElevationRange: () => void;\n setPointBudget: (budget: number) => void;\n setZOffset: (offset: number) => void;\n setZOffsetEnabled: (enabled: boolean) => void;\n getZOffset: () => number;\n setTerrain: (enabled: boolean) => void;\n getTerrain: () => boolean;\n setPickInfoFields: (fields?: string[]) => void;\n getPickInfoFields: () => string[] | undefined;\n setClassificationVisibility: (code: number, visible: boolean) => void;\n showAllClassifications: () => void;\n hideAllClassifications: () => void;\n getHiddenClassifications: () => number[];\n getAvailableClassifications: () => number[];\n toggle: () => void;\n expand: () => void;\n collapse: () => void;\n getState: () => unknown;\n getPointClouds: () => PointCloudInfo[];\n stopStreaming: (id?: string) => void;\n isStreaming: (id?: string) => boolean;\n getStreamingProgress: () => unknown;\n getMap: () => unknown;\n getPanelElement: () => HTMLElement | null;\n }\n\n const control = ref<LidarControlInstance | null>(null);\n\n onMounted(async () => {\n await addControl();\n });\n\n onUnmounted(() => {\n if (control.value && map.value) {\n map.value.removeControl(control.value as unknown as maplibregl.IControl);\n control.value = null;\n }\n });\n\n const addControl = async (): Promise<void> => {\n const { LidarControl } = await requirePeer(\n 'maplibre-gl-lidar',\n () => import('maplibre-gl-lidar'),\n );\n\n control.value = new LidarControl(\n props.options || defaultOptions,\n ) as unknown as LidarControlInstance;\n\n map.value!.addControl(\n control.value as unknown as maplibregl.IControl,\n props.position,\n );\n\n events.forEach((event: string) => {\n control.value!.on(event, (data?: unknown) => {\n emit(event, data);\n });\n });\n\n if (props.defaultUrl) {\n control.value.loadPointCloud(props.defaultUrl);\n }\n };\n\n defineExpose({\n loadPointCloud: (\n source: string | File | ArrayBuffer,\n options?: { loadingMode?: CopcLoadingMode },\n ) => control.value?.loadPointCloud(source, options),\n loadPointCloudStreaming: (\n source: string | File | ArrayBuffer,\n options?: StreamingLoaderOptions,\n ) => control.value?.loadPointCloudStreaming(source, options),\n loadPointCloudEptStreaming: (\n eptUrl: string,\n options?: StreamingLoaderOptions,\n ) => control.value?.loadPointCloudEptStreaming(eptUrl, options),\n unloadPointCloud: (id?: string) => control.value?.unloadPointCloud(id),\n flyToPointCloud: (id?: string) => control.value?.flyToPointCloud(id),\n setPointSize: (size: number) => control.value?.setPointSize(size),\n setColorScheme: (scheme: ColorScheme) =>\n control.value?.setColorScheme(scheme),\n setColormap: (colormap: ColormapName) =>\n control.value?.setColormap(colormap),\n getColormap: () => control.value?.getColormap(),\n setColorRange: (config: ColorRangeConfig) =>\n control.value?.setColorRange(config),\n getColorRange: () => control.value?.getColorRange(),\n setOpacity: (opacity: number) => control.value?.setOpacity(opacity),\n setPickable: (pickable: boolean) => control.value?.setPickable(pickable),\n setUsePercentile: (use: boolean) => control.value?.setUsePercentile(use),\n getUsePercentile: () => control.value?.getUsePercentile(),\n setElevationRange: (min: number, max: number) =>\n control.value?.setElevationRange(min, max),\n clearElevationRange: () => control.value?.clearElevationRange(),\n setPointBudget: (budget: number) => control.value?.setPointBudget(budget),\n setZOffset: (offset: number) => control.value?.setZOffset(offset),\n setZOffsetEnabled: (enabled: boolean) =>\n control.value?.setZOffsetEnabled(enabled),\n getZOffset: () => control.value?.getZOffset(),\n setTerrain: (enabled: boolean) => control.value?.setTerrain(enabled),\n getTerrain: () => control.value?.getTerrain(),\n setPickInfoFields: (fields?: string[]) =>\n control.value?.setPickInfoFields(fields),\n getPickInfoFields: () => control.value?.getPickInfoFields(),\n setClassificationVisibility: (code: number, visible: boolean) =>\n control.value?.setClassificationVisibility(code, visible),\n showAllClassifications: () => control.value?.showAllClassifications(),\n hideAllClassifications: () => control.value?.hideAllClassifications(),\n getHiddenClassifications: () => control.value?.getHiddenClassifications(),\n getAvailableClassifications: () =>\n control.value?.getAvailableClassifications(),\n toggle: () => control.value?.toggle(),\n expand: () => control.value?.expand(),\n collapse: () => control.value?.collapse(),\n getState: () => control.value?.getState(),\n getPointClouds: () => control.value?.getPointClouds(),\n stopStreaming: (id?: string) => control.value?.stopStreaming(id),\n isStreaming: (id?: string) => control.value?.isStreaming(id),\n getStreamingProgress: () => control.value?.getStreamingProgress(),\n getMap: () => control.value?.getMap(),\n getPanelElement: () => control.value?.getPanelElement(),\n getControl: () => control.value,\n });\n</script>\n","import {\n onMounted,\n onUnmounted,\n onUpdated,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport type { Map, IControl, ControlPosition } from 'maplibre-gl';\n\n/**\n * Register a Vue component as a MapLibre IControl for proper control stacking.\n *\n * @param map - Ref to the MapLibre map instance\n * @param containerRef - Ref to the component's root HTMLElement\n * @param position - Control position ('top-left' | 'top-right' | 'bottom-left' | 'bottom-right')\n */\nexport function useMapControl(\n map: ShallowRef<Map | null> | Ref<Map | null>,\n containerRef: Ref<HTMLElement | null>,\n position: ControlPosition,\n): void {\n let control: IControl | null = null;\n let isAdded = false;\n\n /**\n * Re-add the maplibregl-ctrl class if Vue's :class reconciliation removed it.\n * Vue overwrites the class attribute when dynamic :class bindings update,\n * which drops imperatively-added classes like maplibregl-ctrl.\n */\n const ensureControlClass = () => {\n if (\n isAdded &&\n containerRef.value &&\n !containerRef.value.classList.contains('maplibregl-ctrl')\n ) {\n containerRef.value.classList.add('maplibregl-ctrl');\n }\n };\n\n onMounted(() => {\n if (!map.value || !containerRef.value) return;\n\n control = {\n onAdd: (): HTMLElement => {\n containerRef.value?.classList.add('maplibregl-ctrl');\n return containerRef.value!;\n },\n onRemove: (): void => {},\n };\n\n map.value.addControl(control, position);\n isAdded = true;\n });\n\n onUpdated(() => {\n ensureControlClass();\n });\n\n onUnmounted(() => {\n if (map.value && control) {\n try {\n map.value.removeControl(control);\n } catch {\n // Control may already be removed if map was destroyed\n }\n }\n });\n}\n","<script setup lang=\"ts\">\n import { ref, watch, inject, onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { DeckLayersKey } from '../../layers/deckgl/_shared/useDeckOverlay';\n import { useMapControl } from '../_shared';\n import type { ControlPosition, LayerType } from './types';\n\n const props = withDefaults(\n defineProps<{\n layerId: string;\n position?: ControlPosition;\n visible?: boolean;\n opacity?: number;\n title?: string;\n layerType?: LayerType;\n }>(),\n {\n position: 'top-right',\n visible: true,\n opacity: 1,\n title: 'Layer Control',\n layerType: undefined,\n },\n );\n\n const emit = defineEmits<{\n 'visibility-change': [visible: boolean];\n 'opacity-change': [opacity: number];\n 'update:visible': [visible: boolean];\n 'update:opacity': [opacity: number];\n }>();\n\n const map = injectStrict(MapKey);\n const deckLayers = inject(DeckLayersKey, null);\n const containerRef = ref<HTMLElement | null>(null);\n const isVisible = ref(props.visible);\n const currentOpacity = ref(props.opacity);\n\n useMapControl(map, containerRef, props.position);\n\n // Function to detect layer type (called fresh each time, not cached)\n const getLayerType = (): LayerType | null => {\n if (props.layerType) return props.layerType;\n if (!map.value) return null;\n const maplibreLayer = map.value.getLayer(props.layerId);\n if (maplibreLayer) return 'maplibre';\n if (deckLayers) {\n const layers = deckLayers.getLayers();\n const deckLayer = (layers as Array<{ id: string }>).find(\n (l) => l.id === props.layerId,\n );\n if (deckLayer) return 'deckgl';\n }\n return null;\n };\n\n const getOpacityProperty = (): string | null => {\n if (!map.value || getLayerType() !== 'maplibre') return null;\n\n const layer = map.value.getLayer(props.layerId);\n if (!layer) return null;\n\n switch (layer.type) {\n case 'fill':\n return 'fill-opacity';\n case 'line':\n return 'line-opacity';\n case 'circle':\n return 'circle-opacity';\n case 'symbol':\n return 'icon-opacity';\n default:\n return null;\n }\n };\n\n const updateVisibility = (visible: boolean) => {\n const layerType = getLayerType();\n\n if (layerType === 'maplibre') {\n if (!map.value) return;\n const layer = map.value.getLayer(props.layerId);\n if (!layer) {\n console.warn(`MapLibre layer not found: ${props.layerId}`);\n return;\n }\n map.value.setLayoutProperty(\n props.layerId,\n 'visibility',\n visible ? 'visible' : 'none',\n );\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `deck.gl overlay not available for layer: ${props.layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === props.layerId);\n if (!existingLayer) {\n console.warn(`deck.gl layer not found: ${props.layerId}`);\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ visible });\n deckLayers.updateLayer(props.layerId, updatedLayer);\n }\n } else {\n console.warn(`Layer not found in MapLibre or deck.gl: ${props.layerId}`);\n return;\n }\n\n emit('visibility-change', visible);\n emit('update:visible', visible);\n };\n\n const updateOpacity = (opacity: number) => {\n const layerType = getLayerType();\n\n if (layerType === 'maplibre') {\n const opacityProp = getOpacityProperty();\n if (!map.value || !opacityProp) return;\n const layer = map.value.getLayer(props.layerId);\n if (!layer) {\n console.warn(`MapLibre layer not found: ${props.layerId}`);\n return;\n }\n map.value.setPaintProperty(props.layerId, opacityProp, opacity);\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `deck.gl overlay not available for layer: ${props.layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === props.layerId);\n if (!existingLayer) {\n console.warn(`deck.gl layer not found: ${props.layerId}`);\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ opacity });\n deckLayers.updateLayer(props.layerId, updatedLayer);\n }\n } else {\n console.warn(`Layer not found in MapLibre or deck.gl: ${props.layerId}`);\n return;\n }\n\n emit('opacity-change', opacity);\n emit('update:opacity', opacity);\n };\n\n const toggleVisibility = () => {\n isVisible.value = !isVisible.value;\n };\n\n const handleOpacityInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n currentOpacity.value = Number(target.value) / 100;\n };\n\n watch(isVisible, (newValue) => {\n updateVisibility(newValue);\n });\n\n watch(currentOpacity, (newValue) => {\n updateOpacity(newValue);\n });\n\n watch(\n () => props.visible,\n (newValue) => {\n isVisible.value = newValue;\n },\n );\n\n watch(\n () => props.opacity,\n (newValue) => {\n currentOpacity.value = newValue;\n },\n );\n\n // Wait for layer to be available, then apply initial settings\n onMounted(() => {\n let applied = false;\n\n const checkAndApply = () => {\n if (applied) return true;\n // Use function directly to get fresh result (not cached computed)\n const layerType = getLayerType();\n if (layerType) {\n applied = true;\n updateVisibility(isVisible.value);\n updateOpacity(currentOpacity.value);\n return true;\n }\n return false;\n };\n\n // Try immediately\n if (checkAndApply()) return;\n\n // If layer not found, retry with increasing intervals\n // Total wait: ~10 seconds (enough for data fetching)\n const delays = [100, 200, 300, 500, 500, 1000, 1000, 1000, 2000, 3000];\n let index = 0;\n\n const retry = () => {\n if (checkAndApply() || index >= delays.length) return;\n setTimeout(() => {\n index++;\n retry();\n }, delays[index]);\n };\n\n retry();\n });\n</script>\n\n<template>\n <div ref=\"containerRef\" class=\"v-layer-control\">\n <div class=\"v-layer-control-header\">\n <span class=\"v-layer-control-title\">{{ title }}</span>\n <button\n type=\"button\"\n class=\"v-layer-control-toggle\"\n :class=\"{ 'is-hidden': !isVisible }\"\n :aria-pressed=\"isVisible\"\n :title=\"isVisible ? 'Hide layer' : 'Show layer'\"\n @click=\"toggleVisibility\"\n >\n <svg\n v-if=\"isVisible\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M8 3C4.5 3 1.5 5.5 0.5 8C1.5 10.5 4.5 13 8 13C11.5 13 14.5 10.5 15.5 8C14.5 5.5 11.5 3 8 3Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"2.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n />\n </svg>\n <svg v-else width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M2 2L14 14M6.5 6.5C5.9 7.1 5.5 7.9 5.5 8.8C5.5 10.4 6.9 11.5 8 11.5C8.9 11.5 9.7 11.1 10.3 10.5M8 3C4.5 3 1.5 5.5 0.5 8C1 9.2 1.8 10.3 2.8 11.2M13.2 11.2C14.2 10.3 15 9.2 15.5 8C14.5 5.5 11.5 3 8 3\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"v-layer-control-slider-row\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n :value=\"Math.round(currentOpacity * 100)\"\n class=\"v-layer-control-slider\"\n :disabled=\"!isVisible\"\n @input=\"handleOpacityInput\"\n />\n <span class=\"v-layer-control-value\"\n >{{ Math.round(currentOpacity * 100) }}%</span\n >\n </div>\n\n <slot></slot>\n </div>\n</template>\n\n<style>\n .v-layer-control {\n min-width: 140px;\n max-width: 280px;\n margin: 10px;\n background: var(--color-card, #fff);\n border-radius: var(--radius, 0.5rem);\n border: 1px solid var(--color-border, #e5e7eb);\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n sans-serif;\n font-size: 12px;\n overflow: hidden;\n padding: 8px 10px;\n /* Required: MapLibre control containers have pointer-events:none */\n pointer-events: auto;\n }\n\n .v-layer-control-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 8px;\n }\n\n .v-layer-control-title {\n font-weight: 500;\n font-size: 11px;\n color: var(--color-card-foreground, #111827);\n line-height: 1.2;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n .v-layer-control-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n border: none;\n border-radius: calc(var(--radius, 0.5rem) - 2px);\n background: transparent;\n color: var(--color-foreground, #374151);\n cursor: pointer;\n transition:\n background 0.15s ease,\n color 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-layer-control-toggle svg {\n width: 14px;\n height: 14px;\n }\n\n .v-layer-control-toggle:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-layer-control-toggle.is-hidden {\n color: var(--color-muted-foreground, #9ca3af);\n }\n\n .v-layer-control-toggle:focus {\n outline: none;\n }\n\n .v-layer-control-toggle:focus-visible {\n outline: 2px solid var(--color-primary, #3b82f6);\n outline-offset: -2px;\n }\n\n .v-layer-control-slider-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .v-layer-control-slider {\n flex: 1;\n height: 3px;\n border-radius: 2px;\n background: var(--color-secondary, #e5e7eb);\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n }\n\n .v-layer-control-slider:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .v-layer-control-value {\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n font-variant-numeric: tabular-nums;\n min-width: 28px;\n text-align: right;\n }\n\n .v-layer-control-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-control-slider::-moz-range-thumb {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-control-slider:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-control-slider:disabled::-moz-range-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-control-slider:focus {\n outline: none;\n }\n\n .v-layer-control-slider:focus::-webkit-slider-thumb {\n box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--color-primary, #3b82f6) 20%, transparent);\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref, watch, inject, onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { DeckLayersKey } from '../../layers/deckgl/_shared/useDeckOverlay';\n import { useMapControl } from '../_shared';\n import type { ControlPosition, LayerType } from './types';\n\n export interface LayerConfig {\n id: string;\n title: string;\n visible?: boolean;\n opacity?: number;\n type?: LayerType;\n }\n\n const props = withDefaults(\n defineProps<{\n layers: LayerConfig[];\n position?: ControlPosition;\n title?: string;\n collapsible?: boolean;\n collapsed?: boolean;\n }>(),\n {\n position: 'top-right',\n title: 'Layers',\n collapsible: true,\n collapsed: false,\n },\n );\n\n const emit = defineEmits<{\n 'visibility-change': [data: { layerId: string; visible: boolean }];\n 'opacity-change': [data: { layerId: string; opacity: number }];\n 'update:layers': [layers: LayerConfig[]];\n }>();\n\n const map = injectStrict(MapKey);\n const deckLayers = inject(DeckLayersKey, null);\n const containerRef = ref<HTMLElement | null>(null);\n const isCollapsed = ref(props.collapsed);\n\n const layerStates = ref<Map<string, { visible: boolean; opacity: number }>>(\n new Map(),\n );\n\n useMapControl(map, containerRef, props.position);\n\n const initLayerStates = () => {\n for (const layer of props.layers) {\n layerStates.value.set(layer.id, {\n visible: layer.visible ?? true,\n opacity: layer.opacity ?? 1,\n });\n }\n };\n\n const getLayerType = (\n layerId: string,\n configType?: LayerType,\n ): LayerType | null => {\n if (configType) return configType;\n if (!map.value) return null;\n\n const maplibreLayer = map.value.getLayer(layerId);\n if (maplibreLayer) return 'maplibre';\n\n if (deckLayers) {\n const layers = deckLayers.getLayers();\n const deckLayer = (layers as Array<{ id: string }>).find(\n (l) => l.id === layerId,\n );\n if (deckLayer) return 'deckgl';\n }\n return null;\n };\n\n const getOpacityProperty = (layerId: string): string | null => {\n if (!map.value) return null;\n const layer = map.value.getLayer(layerId);\n if (!layer) return null;\n\n const layerType = layer.type;\n switch (layerType) {\n case 'fill':\n return 'fill-opacity';\n case 'line':\n return 'line-opacity';\n case 'circle':\n return 'circle-opacity';\n case 'symbol':\n return 'icon-opacity';\n case 'raster':\n return 'raster-opacity';\n default:\n return null;\n }\n };\n\n const updateVisibility = (\n layerId: string,\n visible: boolean,\n configType?: LayerType,\n ) => {\n const layerType = getLayerType(layerId, configType);\n\n if (layerType === 'maplibre') {\n if (!map.value) return;\n const layer = map.value.getLayer(layerId);\n if (!layer) {\n console.warn(\n `[VControlLayerGroup] MapLibre layer not found: ${layerId}`,\n );\n return;\n }\n map.value.setLayoutProperty(\n layerId,\n 'visibility',\n visible ? 'visible' : 'none',\n );\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `[VControlLayerGroup] deck.gl overlay not available for layer: ${layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === layerId);\n if (!existingLayer) {\n console.warn(\n `[VControlLayerGroup] deck.gl layer not found: ${layerId}`,\n );\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ visible });\n deckLayers.updateLayer(layerId, updatedLayer);\n }\n } else {\n console.warn(`[VControlLayerGroup] Layer not found: ${layerId}`);\n return;\n }\n\n emit('visibility-change', { layerId, visible });\n };\n\n const updateOpacity = (\n layerId: string,\n opacity: number,\n configType?: LayerType,\n ) => {\n const layerType = getLayerType(layerId, configType);\n\n if (layerType === 'maplibre') {\n const opacityProp = getOpacityProperty(layerId);\n if (!map.value || !opacityProp) return;\n const layer = map.value.getLayer(layerId);\n if (!layer) {\n console.warn(\n `[VControlLayerGroup] MapLibre layer not found: ${layerId}`,\n );\n return;\n }\n map.value.setPaintProperty(layerId, opacityProp, opacity);\n } else if (layerType === 'deckgl') {\n if (!deckLayers) {\n console.warn(\n `[VControlLayerGroup] deck.gl overlay not available for layer: ${layerId}`,\n );\n return;\n }\n const layers = deckLayers.getLayers();\n const existingLayer = (\n layers as Array<{ id: string; clone?: (props: object) => unknown }>\n ).find((l) => l.id === layerId);\n if (!existingLayer) {\n console.warn(\n `[VControlLayerGroup] deck.gl layer not found: ${layerId}`,\n );\n return;\n }\n if (typeof existingLayer.clone === 'function') {\n const updatedLayer = existingLayer.clone({ opacity });\n deckLayers.updateLayer(layerId, updatedLayer);\n }\n } else {\n console.warn(`[VControlLayerGroup] Layer not found: ${layerId}`);\n return;\n }\n\n emit('opacity-change', { layerId, opacity });\n };\n\n const toggleVisibility = (layer: LayerConfig) => {\n const state = layerStates.value.get(layer.id);\n if (!state) return;\n\n const newVisible = !state.visible;\n state.visible = newVisible;\n updateVisibility(layer.id, newVisible, layer.type);\n };\n\n const handleOpacityInput = (layer: LayerConfig, event: Event) => {\n const target = event.target as HTMLInputElement;\n const opacity = Number(target.value) / 100;\n\n const state = layerStates.value.get(layer.id);\n if (!state) return;\n\n state.opacity = opacity;\n updateOpacity(layer.id, opacity, layer.type);\n };\n\n const getState = (layerId: string) => {\n return layerStates.value.get(layerId) ?? { visible: true, opacity: 1 };\n };\n\n const toggleCollapse = () => {\n if (props.collapsible) {\n isCollapsed.value = !isCollapsed.value;\n }\n };\n\n watch(\n () => props.layers,\n () => {\n initLayerStates();\n },\n { deep: true },\n );\n\n watch(\n () => props.collapsed,\n (newValue) => {\n isCollapsed.value = newValue;\n },\n );\n\n onMounted(() => {\n initLayerStates();\n // Apply initial states\n for (const layer of props.layers) {\n const state = getState(layer.id);\n updateVisibility(layer.id, state.visible, layer.type);\n updateOpacity(layer.id, state.opacity, layer.type);\n }\n });\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"v-layer-group maplibregl-ctrl\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n >\n <button\n v-if=\"collapsible\"\n type=\"button\"\n class=\"v-layer-group-header\"\n @click=\"toggleCollapse\"\n >\n <span class=\"v-layer-group-title\">{{ title }}</span>\n <svg\n class=\"v-layer-group-chevron\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n >\n <path\n d=\"M3 5L7 9L11 5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <div v-else class=\"v-layer-group-header is-static\">\n <span class=\"v-layer-group-title\">{{ title }}</span>\n </div>\n\n <div v-if=\"!isCollapsed\" class=\"v-layer-group-content\">\n <div v-for=\"layer in layers\" :key=\"layer.id\" class=\"v-layer-group-item\">\n <div class=\"v-layer-group-item-header\">\n <span class=\"v-layer-group-item-title\">{{ layer.title }}</span>\n <button\n type=\"button\"\n class=\"v-layer-group-toggle\"\n :class=\"{ 'is-hidden': !getState(layer.id).visible }\"\n :aria-pressed=\"getState(layer.id).visible\"\n :title=\"getState(layer.id).visible ? 'Hide layer' : 'Show layer'\"\n @click=\"toggleVisibility(layer)\"\n >\n <svg\n v-if=\"getState(layer.id).visible\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M8 3C4.5 3 1.5 5.5 0.5 8C1.5 10.5 4.5 13 8 13C11.5 13 14.5 10.5 15.5 8C14.5 5.5 11.5 3 8 3Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"2.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n />\n </svg>\n <svg v-else width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M2 2L14 14M6.5 6.5C5.9 7.1 5.5 7.9 5.5 8.8C5.5 10.4 6.9 11.5 8 11.5C8.9 11.5 9.7 11.1 10.3 10.5M8 3C4.5 3 1.5 5.5 0.5 8C1 9.2 1.8 10.3 2.8 11.2M13.2 11.2C14.2 10.3 15 9.2 15.5 8C14.5 5.5 11.5 3 8 3\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n <div class=\"v-layer-group-slider-row\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n :value=\"Math.round(getState(layer.id).opacity * 100)\"\n class=\"v-layer-group-slider\"\n :disabled=\"!getState(layer.id).visible\"\n @input=\"handleOpacityInput(layer, $event)\"\n />\n <span class=\"v-layer-group-value\"\n >{{ Math.round(getState(layer.id).opacity * 100) }}%</span\n >\n </div>\n </div>\n </div>\n\n <slot></slot>\n </div>\n</template>\n\n<style>\n .v-layer-group {\n min-width: 140px;\n max-width: 280px;\n margin: 10px;\n background: var(--color-card, #fff);\n border-radius: var(--radius, 0.5rem);\n border: 1px solid var(--color-border, #e5e7eb);\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n sans-serif;\n font-size: 12px;\n overflow: hidden;\n /* Required: MapLibre control containers have pointer-events:none */\n pointer-events: auto;\n }\n\n .v-layer-group-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n width: 100%;\n min-height: 36px;\n padding: 8px 10px;\n border: none;\n border-bottom: 1px solid var(--color-border, #e5e7eb);\n background: transparent;\n cursor: pointer;\n text-align: left;\n line-height: 1;\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n }\n\n .v-layer-group-header.is-static {\n cursor: default;\n }\n\n .v-layer-group-header:not(.is-static):hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-layer-group-header:focus {\n outline: none;\n }\n\n .v-layer-group-header:focus-visible {\n outline: 2px solid var(--color-primary, #3b82f6);\n outline-offset: -2px;\n }\n\n .v-layer-group.is-collapsed .v-layer-group-header {\n border-bottom: none;\n }\n\n .v-layer-group-title {\n font-weight: 500;\n font-size: 11px;\n color: var(--color-card-foreground, #111827);\n line-height: 1.2;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n .v-layer-group-chevron {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n color: var(--color-muted-foreground, #6b7280);\n transition: transform 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-layer-group-chevron.is-collapsed {\n transform: rotate(-90deg);\n }\n\n .v-layer-group-content {\n display: flex;\n flex-direction: column;\n }\n\n .v-layer-group-item {\n padding: 6px 10px 8px;\n border-bottom: 1px solid var(--color-border, #e5e7eb);\n }\n\n .v-layer-group-item:last-child {\n border-bottom: none;\n }\n\n .v-layer-group-item-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 6px;\n }\n\n .v-layer-group-item-title {\n font-weight: 500;\n font-size: 11px;\n color: var(--color-foreground, #374151);\n line-height: 1.2;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n .v-layer-group-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n border: none;\n border-radius: calc(var(--radius, 0.5rem) - 2px);\n background: transparent;\n color: var(--color-foreground, #374151);\n cursor: pointer;\n transition:\n background 0.15s ease,\n color 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-layer-group-toggle svg {\n width: 14px;\n height: 14px;\n }\n\n .v-layer-group-toggle:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-layer-group-toggle.is-hidden {\n color: var(--color-muted-foreground, #9ca3af);\n }\n\n .v-layer-group-slider-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .v-layer-group-slider {\n flex: 1;\n height: 3px;\n border-radius: 2px;\n background: var(--color-secondary, #e5e7eb);\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n }\n\n .v-layer-group-slider:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .v-layer-group-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-group-slider::-moz-range-thumb {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n cursor: pointer;\n border: 2px solid #fff;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);\n }\n\n .v-layer-group-slider:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-group-slider:disabled::-moz-range-thumb {\n cursor: not-allowed;\n }\n\n .v-layer-group-slider:focus {\n outline: none;\n }\n\n .v-layer-group-slider:focus::-webkit-slider-thumb {\n box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--color-primary, #3b82f6) 20%, transparent);\n }\n\n .v-layer-group-value {\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n font-variant-numeric: tabular-nums;\n min-width: 28px;\n text-align: right;\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref, watch, computed, inject, onMounted } from 'vue';\n import { MapKey, injectStrict } from '../../utils';\n import { DeckLayersKey } from '../../layers/deckgl/_shared/useDeckOverlay';\n import { useMapControl } from '../_shared';\n import type {\n ControlPosition,\n LegendType,\n CategoryLegendItem,\n GradientLegendItem,\n SizeLegendItem,\n TableLegendItem,\n LegendItem,\n FilterState,\n ExpressionValue,\n DeckLayerWithExtensions,\n } from './types';\n\n const props = withDefaults(\n defineProps<{\n layerIds: string[];\n type?: LegendType;\n items?: LegendItem[];\n position?: ControlPosition;\n property?: string;\n autoGenerate?: boolean;\n title?: string;\n collapsed?: boolean;\n interactive?: boolean;\n }>(),\n {\n type: 'category',\n position: 'top-right',\n autoGenerate: false,\n title: 'Legend',\n collapsed: false,\n interactive: true,\n },\n );\n\n const emit = defineEmits<{\n 'item-click': [data: { item: LegendItem; index: number; visible: boolean }];\n 'filter-change': [data: { filter: FilterState; layerIds: string[] }];\n 'update:filter': [filter: FilterState];\n }>();\n\n const map = injectStrict(MapKey);\n const deckLayers = inject(DeckLayersKey, null);\n const containerRef = ref<HTMLElement | null>(null);\n const isCollapsed = ref(props.collapsed);\n const categoryItemVisibility = ref<Map<string | number, boolean>>(new Map());\n const generatedItems = ref<LegendItem[]>([]);\n\n useMapControl(map, containerRef, props.position);\n\n const parseMatchExpression = (\n expression: ExpressionValue[],\n ): CategoryLegendItem[] => {\n const items: CategoryLegendItem[] = [];\n const defaultColor = expression[expression.length - 1] as string;\n\n for (let i = 2; i < expression.length - 1; i += 2) {\n const value = expression[i];\n const color = expression[i + 1] as string;\n\n if (Array.isArray(value)) {\n for (const v of value) {\n items.push({\n value: v as string | number,\n label: String(v),\n color,\n visible: true,\n });\n }\n } else {\n items.push({\n value: value as string | number,\n label: String(value),\n color,\n visible: true,\n });\n }\n }\n\n if (items.length > 0 && defaultColor && typeof defaultColor === 'string') {\n items.push({\n value: '__default__',\n label: 'Other',\n color: defaultColor,\n visible: true,\n });\n }\n\n return items;\n };\n\n const parseStepExpression = (\n expression: ExpressionValue[],\n ): GradientLegendItem | null => {\n const colors: string[] = [];\n const stops: number[] = [];\n\n const defaultColor = expression[2] as string;\n colors.push(defaultColor);\n\n for (let i = 3; i < expression.length; i += 2) {\n const stop = expression[i] as number;\n const color = expression[i + 1] as string;\n stops.push(stop);\n colors.push(color);\n }\n\n if (stops.length === 0) return null;\n\n return {\n min: stops[0],\n max: stops[stops.length - 1],\n colors,\n stops,\n };\n };\n\n const parseInterpolateExpression = (\n expression: ExpressionValue[],\n ): GradientLegendItem | null => {\n const colors: string[] = [];\n const stops: number[] = [];\n\n const startIndex = expression[1] && Array.isArray(expression[1]) ? 3 : 3;\n\n for (let i = startIndex; i < expression.length; i += 2) {\n const stop = expression[i] as number;\n const color = expression[i + 1] as string;\n stops.push(stop);\n colors.push(color);\n }\n\n if (stops.length < 2) return null;\n\n return {\n min: stops[0],\n max: stops[stops.length - 1],\n colors,\n stops,\n };\n };\n\n const generateLegendFromPaint = (): LegendItem[] => {\n if (!props.autoGenerate || !props.property || !map.value) return [];\n\n const layerId = props.layerIds[0];\n if (!layerId) return [];\n\n const layer = map.value.getLayer(layerId);\n if (!layer) {\n console.warn(`[VControlLegend] Layer not found: ${layerId}`);\n return [];\n }\n\n const paintValue = map.value.getPaintProperty(layerId, props.property);\n if (!paintValue || !Array.isArray(paintValue)) {\n console.warn(\n `[VControlLegend] Paint property \"${props.property}\" not found or not an expression`,\n );\n return [];\n }\n\n const expressionType = paintValue[0];\n\n if (expressionType === 'match') {\n return parseMatchExpression(paintValue as ExpressionValue[]);\n }\n\n if (expressionType === 'step') {\n const gradient = parseStepExpression(paintValue as ExpressionValue[]);\n return gradient ? [gradient] : [];\n }\n\n if (\n expressionType === 'interpolate' ||\n expressionType === 'interpolate-hcl' ||\n expressionType === 'interpolate-lab'\n ) {\n const gradient = parseInterpolateExpression(\n paintValue as ExpressionValue[],\n );\n return gradient ? [gradient] : [];\n }\n\n console.warn(\n `[VControlLegend] Unsupported expression type: ${expressionType}`,\n );\n return [];\n };\n\n const effectiveItems = computed((): LegendItem[] => {\n if (props.items && props.items.length > 0) {\n return props.items;\n }\n return generatedItems.value;\n });\n\n const categoryItems = computed(() => {\n if (props.type !== 'category') return [];\n return effectiveItems.value.filter(\n (item): item is CategoryLegendItem =>\n 'value' in item && 'color' in item && 'label' in item,\n );\n });\n\n const gradientItem = computed(() => {\n if (props.type !== 'gradient') return null;\n const items = effectiveItems.value;\n if (items.length === 0) return null;\n const first = items[0];\n if ('min' in first && 'max' in first && 'colors' in first) {\n return first as GradientLegendItem;\n }\n return null;\n });\n\n const sizeItems = computed(() => {\n if (props.type !== 'size') return [];\n return effectiveItems.value.filter(\n (item): item is SizeLegendItem => 'size' in item && 'value' in item,\n );\n });\n\n const tableItems = computed((): TableLegendItem[] => {\n if (props.type !== 'table') return [];\n return effectiveItems.value\n .filter(\n (item): item is TableLegendItem =>\n 'label' in item &&\n 'color' in item &&\n 'value' in item &&\n !('size' in item) &&\n !('visible' in item),\n )\n .sort((a, b) => b.value - a.value);\n });\n\n const formatTableValue = (item: TableLegendItem): string => {\n if (item.formattedValue) return item.formattedValue;\n return `${item.value}${item.unit ?? ''}`;\n };\n\n const filterState = computed((): FilterState => {\n const visibleValues = Array.from(categoryItemVisibility.value.entries())\n .filter(([, visible]) => visible)\n .map(([value]) => value);\n return { visibleValues };\n });\n\n const gradientStyle = computed(() => {\n if (!gradientItem.value) return '';\n const colorStops = gradientItem.value.colors.join(', ');\n return `linear-gradient(to right, ${colorStops})`;\n });\n\n const initVisibility = () => {\n if (props.type === 'category') {\n for (const item of categoryItems.value) {\n categoryItemVisibility.value.set(item.value, item.visible ?? true);\n }\n }\n };\n\n const applyFilterToMapLibreLayers = () => {\n if (!map.value || !props.property || props.type !== 'category') return;\n\n const visibleValues = filterState.value.visibleValues.filter(\n (v) => v !== '__default__',\n );\n const allValues = categoryItems.value\n .map((item) => item.value)\n .filter((v) => v !== '__default__');\n const allVisible = visibleValues.length === allValues.length;\n\n for (const layerId of props.layerIds) {\n const layer = map.value.getLayer(layerId);\n if (!layer) continue;\n\n if (allVisible) {\n map.value.setFilter(layerId, null);\n } else if (visibleValues.length === 0) {\n map.value.setFilter(layerId, ['==', ['get', '_never_match_'], true]);\n } else {\n const paintValue = map.value.getPaintProperty(layerId, props.property);\n if (!paintValue || !Array.isArray(paintValue)) continue;\n\n const inputExpr = paintValue[1];\n let propertyName: string | null = null;\n\n if (Array.isArray(inputExpr) && inputExpr[0] === 'get') {\n propertyName = inputExpr[1] as string;\n }\n\n if (propertyName) {\n map.value.setFilter(layerId, [\n 'in',\n ['get', propertyName],\n ['literal', visibleValues],\n ]);\n }\n }\n }\n };\n\n const applyFilterToDeckglLayers = () => {\n if (!deckLayers || props.type !== 'category') return;\n\n const visibleValues = filterState.value.visibleValues.filter(\n (v) => v !== '__default__',\n );\n const allValues = categoryItems.value\n .map((item) => item.value)\n .filter((v) => v !== '__default__');\n const allVisible = visibleValues.length === allValues.length;\n\n const layers = deckLayers.getLayers() as DeckLayerWithExtensions[];\n\n for (const layerId of props.layerIds) {\n if (map.value?.getLayer(layerId)) continue;\n\n const deckLayer = layers.find((l) => l.id === layerId);\n if (!deckLayer) continue;\n\n const hasDataFilterExtension = deckLayer.props?.extensions?.some(\n (ext) => ext?.constructor?.name === 'DataFilterExtension',\n );\n\n if (!hasDataFilterExtension) {\n console.warn(\n `[VControlLegend] deck.gl layer \"${layerId}\" requires DataFilterExtension for filtering. ` +\n 'Add DataFilterExtension to layer extensions and configure getFilterValue accessor.',\n );\n continue;\n }\n\n if (typeof deckLayer.clone !== 'function') continue;\n\n if (allVisible) {\n const updatedLayer = deckLayer.clone({\n filterRange: [-Infinity, Infinity],\n });\n deckLayers.updateLayer(layerId, updatedLayer);\n } else if (visibleValues.length === 0) {\n const updatedLayer = deckLayer.clone({\n filterRange: [Infinity, Infinity],\n });\n deckLayers.updateLayer(layerId, updatedLayer);\n } else {\n const valueIndices = visibleValues\n .map((v) => categoryItems.value.findIndex((item) => item.value === v))\n .filter((i) => i >= 0);\n\n if (valueIndices.length > 0) {\n const minIndex = Math.min(...valueIndices);\n const maxIndex = Math.max(...valueIndices);\n const updatedLayer = deckLayer.clone({\n filterRange: [minIndex - 0.5, maxIndex + 0.5],\n });\n deckLayers.updateLayer(layerId, updatedLayer);\n }\n }\n }\n };\n\n const toggleItem = (item: CategoryLegendItem, index: number) => {\n if (!props.interactive) return;\n\n const currentVisible = categoryItemVisibility.value.get(item.value) ?? true;\n const newVisible = !currentVisible;\n categoryItemVisibility.value.set(item.value, newVisible);\n\n applyFilterToMapLibreLayers();\n applyFilterToDeckglLayers();\n\n emit('item-click', { item, index, visible: newVisible });\n emit('filter-change', {\n filter: filterState.value,\n layerIds: props.layerIds,\n });\n emit('update:filter', filterState.value);\n };\n\n const isItemVisible = (item: CategoryLegendItem) => {\n return categoryItemVisibility.value.get(item.value) ?? true;\n };\n\n const toggleCollapse = () => {\n isCollapsed.value = !isCollapsed.value;\n };\n\n watch(\n () => props.items,\n () => {\n initVisibility();\n },\n { deep: true },\n );\n\n watch(\n () => props.collapsed,\n (newValue) => {\n isCollapsed.value = newValue;\n },\n );\n\n onMounted(() => {\n if (props.autoGenerate) {\n generatedItems.value = generateLegendFromPaint();\n }\n initVisibility();\n });\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"v-legend-control\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n >\n <button\n type=\"button\"\n class=\"v-legend-control-header\"\n @click=\"toggleCollapse\"\n >\n <span class=\"v-legend-control-title\">{{ title }}</span>\n <svg\n class=\"v-legend-control-chevron\"\n :class=\"{ 'is-collapsed': isCollapsed }\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n >\n <path\n d=\"M3 5L7 9L11 5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <div v-if=\"!isCollapsed\" class=\"v-legend-control-content\">\n <template v-if=\"type === 'category'\">\n <button\n v-for=\"(item, index) in categoryItems\"\n :key=\"item.value\"\n type=\"button\"\n class=\"v-legend-control-item\"\n :class=\"{\n 'is-interactive': interactive,\n 'is-hidden': !isItemVisible(item),\n }\"\n :disabled=\"!interactive\"\n @click=\"toggleItem(item, index)\"\n >\n <span\n class=\"v-legend-control-swatch\"\n :style=\"{ backgroundColor: item.color }\"\n ></span>\n <span class=\"v-legend-control-label\">{{ item.label }}</span>\n <span v-if=\"item.count !== undefined\" class=\"v-legend-control-count\">\n {{ item.count }}\n </span>\n </button>\n </template>\n\n <template v-else-if=\"type === 'gradient' && gradientItem\">\n <div\n class=\"v-legend-control-gradient\"\n :style=\"{ background: gradientStyle }\"\n ></div>\n <div class=\"v-legend-control-gradient-labels\">\n <span>{{ gradientItem.minLabel ?? gradientItem.min }}</span>\n <span>{{ gradientItem.maxLabel ?? gradientItem.max }}</span>\n </div>\n </template>\n\n <template v-else-if=\"type === 'size'\">\n <div\n v-for=\"item in sizeItems\"\n :key=\"item.value\"\n class=\"v-legend-control-size-item\"\n >\n <div class=\"v-legend-control-size-circle-wrap\">\n <div\n class=\"v-legend-control-size-circle\"\n :style=\"{\n width: `${Math.min(item.size, 20)}px`,\n height: `${Math.min(item.size, 20)}px`,\n }\"\n ></div>\n </div>\n <span class=\"v-legend-control-label\">{{ item.label }}</span>\n </div>\n </template>\n\n <template v-else-if=\"type === 'table'\">\n <div class=\"v-legend-control-table\">\n <div\n v-for=\"item in tableItems\"\n :key=\"item.label\"\n class=\"v-legend-control-table-row\"\n :title=\"item.description\"\n >\n <span\n class=\"v-legend-control-swatch\"\n :style=\"{ backgroundColor: item.color }\"\n ></span>\n <span class=\"v-legend-control-table-label\">{{ item.label }}</span>\n <span class=\"v-legend-control-table-value\">\n {{ formatTableValue(item) }}\n </span>\n </div>\n </div>\n </template>\n </div>\n\n <slot></slot>\n </div>\n</template>\n\n<style>\n .v-legend-control {\n min-width: 140px;\n max-width: 200px;\n margin: 10px;\n background: var(--color-card, #fff);\n border-radius: var(--radius, 0.5rem);\n border: 1px solid var(--color-border, #e5e7eb);\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n sans-serif;\n font-size: 12px;\n overflow: hidden;\n /* Required: MapLibre control containers have pointer-events:none */\n pointer-events: auto;\n }\n\n .v-legend-control-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n min-height: 44px;\n padding: 8px 10px;\n border: none;\n border-bottom: 1px solid var(--color-border, #e5e7eb);\n background: transparent;\n cursor: pointer;\n text-align: left;\n line-height: 1;\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n }\n\n .v-legend-control.is-collapsed .v-legend-control-header {\n border-bottom: none;\n }\n\n .v-legend-control-header:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-legend-control-title {\n font-weight: 500;\n font-size: 13px;\n color: var(--color-card-foreground, #111827);\n line-height: 1;\n }\n\n .v-legend-control-chevron {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n color: var(--color-muted-foreground, #6b7280);\n transition: transform 0.15s ease;\n flex-shrink: 0;\n }\n\n .v-legend-control-chevron.is-collapsed {\n transform: rotate(-90deg);\n }\n\n .v-legend-control-content {\n padding: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .v-legend-control-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 6px 8px;\n border: none;\n border-radius: calc(var(--radius, 0.5rem) - 4px);\n background: transparent;\n text-align: left;\n transition:\n background 0.1s ease,\n opacity 0.1s ease;\n }\n\n .v-legend-control-item.is-interactive {\n cursor: pointer;\n }\n\n .v-legend-control-item.is-interactive:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-legend-control-item.is-hidden {\n opacity: 0.4;\n }\n\n .v-legend-control-item.is-hidden .v-legend-control-label {\n text-decoration: line-through;\n }\n\n .v-legend-control-item:disabled {\n cursor: default;\n }\n\n .v-legend-control-swatch {\n width: 12px;\n height: 12px;\n border-radius: 3px;\n flex-shrink: 0;\n box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);\n }\n\n .v-legend-control-label {\n flex: 1;\n font-size: 11px;\n font-weight: 500;\n color: var(--color-foreground, #374151);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .v-legend-control-count {\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n background: var(--color-secondary, #f3f4f6);\n padding: 1px 5px;\n border-radius: 8px;\n }\n\n .v-legend-control-gradient {\n height: 12px;\n border-radius: 3px;\n margin: 6px 8px 4px;\n }\n\n .v-legend-control-gradient-labels {\n display: flex;\n justify-content: space-between;\n padding: 0 8px 6px;\n font-size: 10px;\n font-weight: 500;\n color: var(--color-muted-foreground, #6b7280);\n }\n\n .v-legend-control-size-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n }\n\n .v-legend-control-size-circle-wrap {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .v-legend-control-size-circle {\n border-radius: 50%;\n background: var(--color-primary, #3b82f6);\n box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);\n }\n\n .v-legend-control-table {\n max-height: 300px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 1px;\n }\n\n .v-legend-control-table-row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n border-radius: calc(var(--radius, 0.5rem) - 4px);\n }\n\n .v-legend-control-table-row:hover {\n background: var(--color-accent, #f3f4f6);\n }\n\n .v-legend-control-table-label {\n flex: 1;\n font-size: 11px;\n font-weight: 500;\n color: var(--color-foreground, #374151);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .v-legend-control-table-value {\n font-size: 10px;\n font-weight: 600;\n color: var(--color-muted-foreground, #6b7280);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n }\n\n .v-legend-control:has(.v-legend-control-table) {\n max-width: 280px;\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n CanvasSourceSpecification,\n LayerSpecification,\n Map,\n } from 'maplibre-gl';\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = withDefaults(\n defineProps<{\n source: CanvasSourceSpecification;\n layer: LayerSpecification;\n sourceId?: string;\n layerId?: string;\n before?: string;\n }>(),\n {\n sourceId: 'maplibre.gl-canvas-source',\n layerId: 'maplibre.gl-canvas-layer',\n before: '',\n },\n );\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding Canvas layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // For canvas sources, we need to remove and re-add both source and layer\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n mapInstance.addLayer(layerSpec, props.before);\n } catch (error) {\n console.error('Error updating Canvas source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Canvas layer:', error);\n }\n };\n\n // Watchers\n watch(() => props.source, updateSource, { deep: true });\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n addLayer();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up Canvas layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<!-- web/app/lib/v-mapbox/layers/maplibre/geojson/VLayerMaplibreGeojson.vue -->\n<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch, nextTick } from 'vue';\n import type {\n GeoJSONSource,\n GeoJSONSourceSpecification,\n LayerSpecification,\n Map,\n MapLayerMouseEvent,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../utils';\n\n interface LayerClick {\n features: GeoJSON.Feature[];\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n sourceId: string;\n layerId: string;\n source: GeoJSONSourceSpecification;\n layer: LayerSpecification;\n before?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sourceId: 'maplibre-gl-geojson-source',\n layerId: 'maplibre-gl-geojson-layer',\n before: '',\n });\n\n const emit = defineEmits<{\n 'on-click': [event: LayerClick];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper to check if data is valid GeoJSON with features\n const hasValidData = (\n data: string | GeoJSON.GeoJSON | undefined,\n ): boolean => {\n if (!data || typeof data === 'string') return false;\n if (data && typeof data === 'object' && 'type' in data) {\n if (data.type === 'FeatureCollection' && 'features' in data) {\n return data.features.length > 0;\n }\n // Also valid for single Feature or Geometry\n return (\n data.type === 'Feature' ||\n data.type === 'Point' ||\n data.type === 'LineString' ||\n data.type === 'Polygon' ||\n data.type === 'MultiPoint' ||\n data.type === 'MultiLineString' ||\n data.type === 'MultiPolygon'\n );\n }\n return false;\n };\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n const instance = map.value || null;\n return instance;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) {\n return;\n }\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) {\n return;\n }\n\n // For clustering support, wait for valid data before adding source/layer\n if (!hasValidData(props.source.data)) {\n console.log(\n `[${props.layerId}] Waiting for valid data before adding layer`,\n );\n return;\n }\n\n try {\n // Only add source if it doesn't exist\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n\n // Only add layer if it doesn't exist\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding GeoJSON layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as\n | GeoJSONSource\n | undefined;\n\n if (source && 'setData' in source) {\n // CRITICAL FIX: Only update data if source doesn't have clustering\n // or if this is the first/primary layer for this source\n const existingLayers = mapInstance\n .getStyle()\n .layers.filter(\n (l) =>\n l.type !== 'background' &&\n 'source' in l &&\n l.source === props.sourceId,\n );\n\n // Only update data if this is the first layer using this source\n // This prevents breaking clustering when multiple layers share a source\n if (\n existingLayers.length === 0 ||\n existingLayers[0]?.id === props.layerId\n ) {\n source.setData(props.source.data);\n }\n } else if (!source) {\n // If source doesn't exist, try to add the layer\n addLayer();\n }\n } catch (error) {\n console.error('Error updating GeoJSON source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n // Update paint properties\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n // Update layout properties\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n } else {\n // If layer doesn't exist, try to add it\n addLayer();\n }\n } catch (error) {\n console.error('Error updating GeoJSON layer:', error);\n }\n };\n\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance) {\n return;\n }\n\n try {\n // Add click handler for the specific layer\n mapInstance.on('click', props.layerId, (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('on-click', {\n features: e.features,\n coordinates: e.lngLat,\n });\n }\n });\n\n // Add hover effect to verify interactivity\n mapInstance.on('mouseenter', props.layerId, () => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n });\n\n mapInstance.on('mouseleave', props.layerId, () => {\n mapInstance.getCanvas().style.cursor = '';\n });\n } catch (error) {\n console.error('Error in setupLayerEvents:', error);\n }\n };\n\n // Track if layer has been initialized to prevent duplicate setup\n const initialized = ref(false);\n\n // Initialize layer - single entry point to prevent race conditions\n const initializeLayer = async () => {\n if (initialized.value) return;\n\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n if (!hasValidData(props.source.data)) return;\n\n // Use nextTick to ensure Vue has finished setup\n await nextTick();\n\n // Double-check conditions after nextTick\n if (initialized.value) return;\n if (!mapInstance.isStyleLoaded()) return;\n\n addLayer();\n setupLayerEvents(mapInstance);\n initialized.value = true;\n };\n\n // Watch loaded state - MUST be defined BEFORE watch(map) to catch immediate changes\n watch(loaded, (value) => {\n if (value) {\n initializeLayer();\n }\n });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n // Check if style is already loaded\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n // Also try to initialize directly in case watch(loaded) already fired\n initializeLayer();\n }\n }\n },\n { immediate: true },\n );\n\n // Watchers for updates after initialization\n watch(\n () => props.source,\n (newSource, oldSource) => {\n // Wait for valid data before doing anything\n if (!hasValidData(newSource?.data)) {\n return;\n }\n\n // Only update if the data actually changed\n if (JSON.stringify(newSource.data) !== JSON.stringify(oldSource?.data)) {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n // If source doesn't exist yet, add the whole layer\n if (!mapInstance.getSource(props.sourceId)) {\n addLayer();\n if (!initialized.value) {\n setupLayerEvents(mapInstance);\n initialized.value = true;\n }\n } else {\n // Source exists, just update data\n updateSource();\n }\n }\n }\n },\n { deep: true },\n );\n\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for visibility changes\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer && newVisibility === 'visible') {\n // Add layer if it doesn't exist and should be visible\n if (hasValidData(props.source.data)) {\n addLayer();\n }\n } else if (hasLayer) {\n // Update visibility of existing layer\n try {\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n } catch (error) {\n console.error(\n `Error updating visibility for ${props.layerId}:`,\n error,\n );\n }\n }\n },\n { immediate: true },\n );\n\n // Lifecycle hooks\n onMounted(() => {\n // Use nextTick to ensure all watchers are set up\n nextTick(() => {\n initializeLayer();\n });\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Remove layer\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n\n // Only remove source if no other layers are using it\n const layersUsingSource = mapInstance\n .getStyle()\n .layers.filter(\n (l) =>\n l.type !== 'background' &&\n 'source' in l &&\n l.source === props.sourceId,\n );\n\n if (\n layersUsingSource.length === 0 &&\n mapInstance.getSource(props.sourceId)\n ) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up GeoJSON layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type {\n LayerSpecification as AnyLayer,\n ImageSourceSpecification as ImageSourceRaw,\n ImageSource,\n Map,\n } from 'maplibre-gl';\n import type { PropType, Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps({\n sourceId: {\n type: String,\n default: 'maplibre.gl-image-source',\n required: true,\n },\n layerId: {\n type: String,\n default: 'maplibre.gl-image-layer',\n required: true,\n },\n source: {\n type: Object as PropType<ImageSourceRaw>,\n required: true,\n },\n layer: {\n type: Object as PropType<AnyLayer>,\n default: () => ({}),\n required: true,\n },\n before: {\n type: String,\n default: '',\n required: false,\n },\n });\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding Image layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as ImageSource;\n if (source) {\n // For image sources, we need to update coordinates and url\n if (source.updateImage) {\n source.updateImage({\n url: props.source.url,\n coordinates: props.source.coordinates,\n });\n } else {\n // If updateImage is not available, remove and re-add the source and layer\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n }\n }\n } catch (error) {\n console.error('Error updating Image source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Image layer:', error);\n }\n };\n\n // Watchers\n watch(() => props.source, updateSource, { deep: true });\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n addLayer();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up Image layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type {\n RasterSourceSpecification,\n RasterLayerSpecification,\n Map,\n } from 'maplibre-gl';\n import type { Ref } from 'vue';\n import { onMounted, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps<{\n sourceId: string;\n source: RasterSourceSpecification;\n layerId: string;\n layer: RasterLayerSpecification;\n before?: string;\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n // Always add with proper ordering\n mapInstance.addLayer(props.layer, props.before);\n\n // Set initial visibility\n if (props.layer.layout?.visibility) {\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n props.layer.layout.visibility,\n );\n }\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Store the current beforeId since we'll need to reuse it\n const beforeId = props.before;\n\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n mapInstance.removeSource(props.sourceId);\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n type: 'raster',\n source: props.sourceId,\n } as RasterLayerSpecification;\n\n // Explicitly check if the beforeId layer exists before adding\n if (beforeId && mapInstance.getLayer(beforeId)) {\n mapInstance.addLayer(layerSpec, beforeId);\n } else {\n mapInstance.addLayer(layerSpec);\n }\n } catch (error) {\n console.error('Error updating Raster source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n // Update paint properties\n const paint = props.layer.paint || {};\n Object.entries(paint).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n\n // Update layout properties\n const layout = props.layer.layout || {};\n Object.entries(layout).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Raster layer:', error);\n }\n };\n\n // Watchers\n watch(\n () => props.source.tiles?.[0], // Usually raster sources have a single tile URL\n (newTileUrl, oldTileUrl) => {\n if (newTileUrl !== oldTileUrl) {\n updateSource();\n }\n },\n );\n watch(() => props.layer, updateLayer, { deep: true });\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer) {\n // Add layer with proper ordering\n try {\n mapInstance.addLayer(props.layer, props.before);\n } catch (error) {\n console.error(`[${props.layerId}] Error adding layer:`, error);\n }\n } else {\n try {\n // Update visibility\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n\n // If becoming visible, ensure proper layer ordering\n if (newVisibility === 'visible' && props.before) {\n mapInstance.moveLayer(props.layerId, props.before);\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error updating visibility:`, error);\n }\n }\n },\n { immediate: true },\n );\n watch(\n () => props.before,\n (newBefore) => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.getLayer(props.layerId)) return;\n\n // Only move layer if it's visible\n if (props.layer.layout?.visibility === 'visible') {\n try {\n console.log(`[${props.layerId}] Moving layer before:`, newBefore);\n mapInstance.moveLayer(props.layerId, newBefore);\n } catch (error) {\n console.error(`[${props.layerId}] Error moving layer:`, error);\n }\n }\n },\n );\n\n // Also add logging for source and layer setup\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) {\n return;\n }\n try {\n addLayer();\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","import type { MapLayerEventType } from 'maplibre-gl';\n\nexport const mapLayerEvents: Array<keyof MapLayerEventType> = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mouseup',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'contextmenu',\n 'touchstart',\n 'touchend',\n 'touchcancel',\n];\n","import type { MapEventType } from 'maplibre-gl';\n\nexport const mapEvents: Array<keyof MapEventType> = [\n 'error',\n 'load',\n 'idle',\n 'remove',\n 'render',\n 'resize',\n 'webglcontextlost',\n 'webglcontextrestored',\n 'dataloading',\n 'data',\n 'tiledataloading',\n 'sourcedataloading',\n 'styledataloading',\n 'sourcedata',\n 'styledata',\n 'boxzoomcancel',\n 'boxzoomstart',\n 'boxzoomend',\n 'touchcancel',\n 'touchmove',\n 'touchend',\n 'touchstart',\n 'click',\n 'contextmenu',\n 'dblclick',\n 'mousemove',\n 'mouseup',\n 'mousedown',\n 'mouseout',\n 'mouseover',\n 'movestart',\n 'move',\n 'moveend',\n 'zoomstart',\n 'zoom',\n 'zoomend',\n 'rotatestart',\n 'rotate',\n 'rotateend',\n 'dragstart',\n 'drag',\n 'dragend',\n 'pitchstart',\n 'pitch',\n 'pitchend',\n 'wheel',\n];\n","export const markerMapEvents = ['dragstart', 'drag', 'dragend'];\nexport const markerDOMEvents = ['click', 'mouseenter', 'mouseleave'];\n","export const popupEvents = ['open', 'close'] as Array<'open' | 'close'>;\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, ref, watch } from 'vue';\n import type {\n Map,\n VectorSourceSpecification,\n LayerSpecification,\n } from 'maplibre-gl';\n import { mapLayerEvents } from '../../../constants/events';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps<{\n sourceId: string;\n source: VectorSourceSpecification;\n layerId: string;\n layer: LayerSpecification;\n before?: string;\n }>();\n const emit = defineEmits([...mapLayerEvents]);\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n // Always get a fresh beforeId when adding a layer\n if (props.layer.layout?.visibility === 'visible') {\n mapInstance.addLayer(props.layer, props.before);\n } else {\n // For hidden layers, just add them without worrying about order\n mapInstance.addLayer(props.layer);\n }\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n };\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const existingSource = mapInstance.getSource(props.sourceId);\n // Only update source if it has actually changed\n if (\n existingSource &&\n JSON.stringify(existingSource.serialize()) !==\n JSON.stringify(props.source)\n ) {\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n mapInstance.removeSource(props.sourceId);\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as LayerSpecification;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error updating vector source:', error);\n }\n };\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n // Get current paint and layout properties\n const currentLayer = mapInstance.getLayer(props.layerId);\n const currentPaint = (currentLayer?.paint || {}) as Record<\n string,\n unknown\n >;\n const currentLayout = (currentLayer?.layout || {}) as Record<\n string,\n unknown\n >;\n\n // Only update properties that have changed\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n if (JSON.stringify(currentPaint[key]) !== JSON.stringify(value)) {\n mapInstance.setPaintProperty(props.layerId, key, value);\n }\n });\n\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n if (JSON.stringify(currentLayout[key]) !== JSON.stringify(value)) {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n }\n });\n }\n } catch (error) {\n console.error('Error updating vector layer:', error);\n }\n };\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n try {\n mapLayerEvents.forEach((eventName) => {\n mapInstance.on(eventName, props.layerId, (e) => {\n if (eventName === 'mousemove') {\n mapInstance.getCanvas().style.cursor = 'pointer';\n }\n if (eventName === 'mouseleave') {\n mapInstance.getCanvas().style.cursor = '';\n }\n emit(eventName, e);\n });\n });\n } catch (error) {\n console.error('Error setting up layer events:', error);\n }\n };\n\n // Watchers\n watch(\n map,\n (newMap, oldMap) => {\n if (newMap && newMap !== oldMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n watch(loaded, (value) => {\n if (value) {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n addLayer();\n setupLayerEvents(mapInstance);\n }\n });\n watch(\n () => JSON.stringify(props.source.tiles),\n (newTiles, oldTiles) => {\n if (newTiles !== oldTiles) {\n updateSource();\n }\n },\n );\n watch(\n () => ({\n paint: props.layer.paint,\n // Watch layout changes but exclude visibility since it's handled separately\n layout: props.layer.layout\n ? { ...props.layer.layout, visibility: undefined }\n : undefined,\n }),\n (newValue, oldValue) => {\n if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {\n updateLayer();\n }\n },\n { deep: true },\n );\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer) {\n // Add layer if it doesn't exist\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n mapInstance.addLayer(props.layer, props.before);\n } catch (error) {\n console.error(`[${props.layerId}] Error adding layer:`, error);\n }\n } else {\n try {\n // Update visibility\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n\n // If becoming visible, ensure proper layer order\n if (newVisibility === 'visible' && props.before) {\n // Small timeout to ensure target layer is ready\n setTimeout(() => {\n mapInstance.moveLayer(props.layerId, props.before);\n }, 0);\n }\n } catch (error) {\n console.error(`[${props.layerId}] Error updating visibility:`, error);\n }\n }\n },\n { immediate: true },\n );\n watch(\n () => props.before,\n (newBefore) => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.getLayer(props.layerId)) return;\n\n // Only move visible layers\n if (props.layer.layout?.visibility === 'visible') {\n try {\n mapInstance.moveLayer(props.layerId, newBefore);\n } catch (error) {\n console.error(\n `Error reordering vector layer ${props.layerId}:`,\n error,\n );\n }\n }\n },\n );\n watch(\n () => props.layer.layout?.visibility,\n (newVisibility) => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const hasLayer = mapInstance.getLayer(props.layerId);\n\n if (!hasLayer) {\n // Only add layer if it doesn't exist\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n mapInstance.addLayer(props.layer, props.before);\n } catch (error) {\n console.error(`[${props.layerId}] Error adding layer:`, error);\n }\n } else {\n // Just update visibility if layer exists\n try {\n mapInstance.setLayoutProperty(\n props.layerId,\n 'visibility',\n newVisibility,\n );\n } catch (error) {\n console.error(`[${props.layerId}] Error updating visibility:`, error);\n }\n }\n },\n { immediate: true },\n );\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) {\n return;\n }\n try {\n addLayer();\n } catch (error) {\n console.error(`[${props.layerId}] Error setting up layer:`, error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type {\n LayerSpecification as AnyLayer,\n VideoSourceSpecification,\n VideoSource,\n Map,\n } from 'maplibre-gl';\n import type { PropType, Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch } from 'vue';\n import { injectStrict, MapKey } from '../../../utils';\n\n const props = defineProps({\n sourceId: {\n type: String,\n default: 'maplibre.gl-video-source',\n required: true,\n },\n layerId: {\n type: String,\n default: 'maplibre.gl-video-layer',\n required: true,\n },\n source: {\n type: Object as PropType<VideoSourceSpecification>,\n required: true,\n },\n layer: {\n type: Object as PropType<AnyLayer>,\n default: () => ({}),\n required: true,\n },\n before: {\n type: String,\n default: '',\n required: false,\n },\n });\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (!mapInstance.getSource(props.sourceId)) {\n mapInstance.addSource(props.sourceId, props.source);\n }\n if (!mapInstance.getLayer(props.layerId)) {\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n }\n } catch (error) {\n console.error('Error adding Video layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as VideoSource;\n if (source) {\n // For video sources, we need to remove and re-add since there's no direct update method\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n\n mapInstance.addSource(props.sourceId, props.source);\n const layerSpec = {\n ...props.layer,\n id: props.layerId,\n source: props.sourceId,\n } as AnyLayer;\n mapInstance.addLayer(layerSpec, props.before);\n\n // Additional video-specific operations if needed\n if (source.getVideo) {\n const videoElement = source.getVideo();\n if (videoElement) {\n // Handle video element updates if needed\n videoElement.play().catch((error) => {\n console.error('Error playing video:', error);\n });\n }\n }\n }\n } catch (error) {\n console.error('Error updating Video source:', error);\n }\n };\n\n const updateLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.layerId)) {\n Object.entries(props.layer.paint || {}).forEach(([key, value]) => {\n mapInstance.setPaintProperty(props.layerId, key, value);\n });\n Object.entries(props.layer.layout || {}).forEach(([key, value]) => {\n mapInstance.setLayoutProperty(props.layerId, key, value);\n });\n }\n } catch (error) {\n console.error('Error updating Video layer:', error);\n }\n };\n\n // Watchers\n watch(() => props.source, updateSource, { deep: true });\n watch(() => props.layer, updateLayer, { deep: true });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n addLayer();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as VideoSource;\n if (source?.getVideo) {\n const videoElement = source.getVideo();\n if (videoElement) {\n // Stop and cleanup video if needed\n videoElement.pause();\n videoElement.remove();\n }\n }\n\n if (mapInstance.getLayer(props.layerId)) {\n mapInstance.removeLayer(props.layerId);\n }\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up Video layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import { PMTiles } from 'pmtiles';\n import { inject, onMounted, ref } from 'vue';\n import type { PropType } from 'vue';\n import type {\n RasterLayerSpecification,\n RasterSourceSpecification,\n } from 'maplibre-gl';\n import VLayerMaplibreRaster from '../raster/VLayerMaplibreRaster.vue';\n import { PMTileProtocolKey } from '../../../utils/symbols';\n\n const props = defineProps({\n sourceId: {\n type: String,\n default: 'maplibre.gl-pmtile-source',\n required: true,\n },\n layerId: {\n type: String,\n default: 'maplibre.gl-pmtile-layer',\n required: true,\n },\n url: {\n type: String,\n required: true,\n },\n layer: {\n type: Object as PropType<RasterLayerSpecification>,\n default: () => ({}),\n required: true,\n },\n before: {\n type: String,\n default: '',\n required: false,\n },\n });\n\n const protocol = inject(PMTileProtocolKey);\n if (!protocol) {\n throw new Error('Protocol not provided');\n }\n\n const source = ref<RasterSourceSpecification>({\n type: 'raster',\n url: `pmtiles://${props.url}`,\n tileSize: 512,\n volatile: true,\n });\n onMounted(async () => {\n const p = new PMTiles(props.url);\n protocol.add(p);\n // Optional: You could fetch the header here if you need metadata\n // const header = await p.getHeader();\n });\n</script>\n\n<template>\n <VLayerMaplibreRaster\n :source-id=\"sourceId\"\n :layer-id=\"layerId\"\n :source=\"source\"\n :layer=\"{\n ...layer,\n type: 'raster',\n }\"\n :before=\"before\"\n ></VLayerMaplibreRaster>\n</template>\n","<!-- web/app/lib/v-mapbox/layers/maplibre/cluster/VLayerMaplibreCluster.vue -->\n<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch, computed } from 'vue';\n import type {\n GeoJSONSource,\n GeoJSONSourceSpecification,\n CircleLayerSpecification,\n SymbolLayerSpecification,\n Map,\n MapLayerMouseEvent,\n DataDrivenPropertyValueSpecification,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface LayerClick {\n features: GeoJSON.Feature[];\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n sourceId: string;\n baseLayerId: string;\n source: GeoJSONSourceSpecification;\n visibility?: boolean;\n clusterPaint?: {\n colors?: string[];\n radii?: number[];\n breakpoints?: number[];\n };\n unclusteredPaint?: {\n color?: DataDrivenPropertyValueSpecification<string>;\n radius?: number;\n };\n textPaint?: {\n color?: string;\n font?: string[];\n size?: number;\n };\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sourceId: 'cluster-source',\n baseLayerId: 'cluster',\n visibility: true,\n clusterPaint: () => ({\n colors: ['#51bbd6', '#f1f075', '#f28cb1'],\n radii: [20, 30, 40],\n breakpoints: [100, 750],\n }),\n unclusteredPaint: () => ({\n color: '#51bbd6',\n radius: 6,\n }),\n textPaint: () => ({\n color: '#ffffff',\n font: ['DIN Offc Pro Medium', 'Arial Unicode MS Bold'],\n size: 12,\n }),\n });\n\n const emit = defineEmits<{\n 'cluster-click': [event: LayerClick];\n 'point-click': [event: LayerClick];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n // Layer IDs\n const clustersLayerId = computed(() => `${props.baseLayerId}-clusters`);\n const clusterCountLayerId = computed(\n () => `${props.baseLayerId}-cluster-count`,\n );\n const unclusteredLayerId = computed(\n () => `${props.baseLayerId}-unclustered-point`,\n );\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Helper to check if data is valid GeoJSON with features\n const hasValidData = (data: string | GeoJSON.GeoJSON): boolean => {\n if (typeof data === 'string') return false;\n if (data && typeof data === 'object' && 'type' in data) {\n if (data.type === 'FeatureCollection' && 'features' in data) {\n return data.features.length > 0;\n }\n }\n return false;\n };\n\n // Add all cluster-related layers at once\n const addClusterLayers = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) {\n return;\n }\n\n try {\n // 1. Add source if it doesn't exist\n if (!mapInstance.getSource(props.sourceId)) {\n console.log(`Adding clustered source: ${props.sourceId}`);\n mapInstance.addSource(props.sourceId, {\n ...props.source,\n cluster: true,\n clusterMaxZoom: 14,\n clusterRadius: 50,\n });\n } else {\n // If source exists, update its data\n const source = mapInstance.getSource(props.sourceId) as GeoJSONSource;\n if (source && 'setData' in source) {\n source.setData(props.source.data);\n }\n }\n\n // 2. Add clusters layer\n if (!mapInstance.getLayer(clustersLayerId.value)) {\n console.log(`Adding clusters layer: ${clustersLayerId.value}`);\n mapInstance.addLayer({\n id: clustersLayerId.value,\n type: 'circle',\n source: props.sourceId,\n filter: ['has', 'point_count'],\n paint: {\n 'circle-color': [\n 'step',\n ['get', 'point_count'],\n props.clusterPaint.colors![0]!,\n props.clusterPaint.breakpoints![0]!,\n props.clusterPaint.colors![1]!,\n props.clusterPaint.breakpoints![1]!,\n props.clusterPaint.colors![2]!,\n ],\n 'circle-radius': [\n 'step',\n ['get', 'point_count'],\n props.clusterPaint.radii![0]!,\n props.clusterPaint.breakpoints![0]!,\n props.clusterPaint.radii![1]!,\n props.clusterPaint.breakpoints![1]!,\n props.clusterPaint.radii![2]!,\n ],\n 'circle-stroke-width': 2,\n 'circle-stroke-color': '#ffffff',\n 'circle-opacity': 0.9,\n },\n layout: {\n visibility: props.visibility ? 'visible' : 'none',\n },\n } as CircleLayerSpecification);\n }\n\n // 3. Add cluster count text layer\n if (!mapInstance.getLayer(clusterCountLayerId.value)) {\n console.log(`Adding cluster count layer: ${clusterCountLayerId.value}`);\n mapInstance.addLayer({\n id: clusterCountLayerId.value,\n type: 'symbol',\n source: props.sourceId,\n filter: ['has', 'point_count'],\n layout: {\n 'text-field': '{point_count_abbreviated}',\n 'text-font': props.textPaint.font!,\n 'text-size': props.textPaint.size!,\n visibility: props.visibility ? 'visible' : 'none',\n },\n paint: {\n 'text-color': props.textPaint.color!,\n },\n } as SymbolLayerSpecification);\n }\n\n // 4. Add unclustered points layer\n if (!mapInstance.getLayer(unclusteredLayerId.value)) {\n console.log(\n `Adding unclustered points layer: ${unclusteredLayerId.value}`,\n );\n mapInstance.addLayer({\n id: unclusteredLayerId.value,\n type: 'circle',\n source: props.sourceId,\n filter: ['!', ['has', 'point_count']],\n paint: {\n 'circle-color': props.unclusteredPaint.color!,\n 'circle-radius': props.unclusteredPaint.radius!,\n 'circle-stroke-width': 2,\n 'circle-stroke-color': '#ffffff',\n 'circle-opacity': 0.95,\n },\n layout: {\n visibility: props.visibility ? 'visible' : 'none',\n },\n } as CircleLayerSpecification);\n }\n\n console.log(`All cluster layers added for ${props.baseLayerId}`);\n\n // Setup click handlers after layers are added\n setupLayerEvents(mapInstance);\n } catch (error) {\n console.error('Error adding cluster layers:', error);\n }\n };\n\n // Update source data\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(props.sourceId) as\n | GeoJSONSource\n | undefined;\n if (source && 'setData' in source) {\n console.log(`Updating source ${props.sourceId} with data`);\n source.setData(props.source.data);\n\n // After updating data, ensure all layers are properly added\n // This fixes the issue where layers might not render correctly with initial empty data\n setTimeout(() => {\n // Re-add layers if they're missing (this won't duplicate them)\n addClusterLayers();\n }, 100);\n } else if (!source) {\n // Source doesn't exist, add all layers\n addClusterLayers();\n }\n } catch (error) {\n console.error('Error updating source:', error);\n }\n };\n\n // Update visibility for all layers\n const updateVisibility = (visible: boolean): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n const visibility = visible ? 'visible' : 'none';\n\n [\n clustersLayerId.value,\n clusterCountLayerId.value,\n unclusteredLayerId.value,\n ].forEach((layerId) => {\n if (mapInstance.getLayer(layerId)) {\n mapInstance.setLayoutProperty(layerId, 'visibility', visibility);\n }\n });\n };\n\n // Setup click handlers for layers\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n try {\n // Click handler for clusters\n mapInstance.on(\n 'click',\n clustersLayerId.value,\n (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('cluster-click', {\n features: e.features,\n coordinates: e.lngLat,\n });\n }\n },\n );\n\n // Click handler for individual points\n mapInstance.on(\n 'click',\n unclusteredLayerId.value,\n (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('point-click', {\n features: e.features,\n coordinates: e.lngLat,\n });\n }\n },\n );\n\n // Add hover effects\n [clustersLayerId.value, unclusteredLayerId.value].forEach((layerId) => {\n mapInstance.on('mouseenter', layerId, () => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n });\n\n mapInstance.on('mouseleave', layerId, () => {\n mapInstance.getCanvas().style.cursor = '';\n });\n });\n } catch (error) {\n console.error('Error setting up layer events:', error);\n }\n };\n\n // Setup map\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const checkStyleLoaded = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(checkStyleLoaded, 200);\n } else {\n loaded.value = true;\n // Only add layers if we have data\n if (hasValidData(props.source.data)) {\n addClusterLayers();\n }\n }\n };\n checkStyleLoaded();\n });\n\n // If style is already loaded\n if (mapInstance.isStyleLoaded()) {\n loaded.value = true;\n // Only add layers if we have data\n if (hasValidData(props.source.data)) {\n addClusterLayers();\n }\n }\n };\n\n // Watchers\n watch(\n () => props.source.data,\n (newData) => {\n // Only proceed if we have actual data\n if (hasValidData(newData)) {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n // First time with data - add all layers\n if (!mapInstance.getSource(props.sourceId)) {\n addClusterLayers();\n } else {\n // Source exists, just update data\n updateSource();\n }\n }\n }\n },\n { deep: true, immediate: true },\n );\n\n watch(() => props.visibility, updateVisibility);\n\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Lifecycle\n onMounted(() => {\n const mapInstance = getMapInstance();\n // Only add layers if map is ready AND we have data\n if (mapInstance?.isStyleLoaded() && hasValidData(props.source.data)) {\n addClusterLayers();\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Remove click handlers\n [clustersLayerId.value, unclusteredLayerId.value].forEach((layerId) => {\n mapInstance.off('click', layerId, () => {});\n mapInstance.off('mouseenter', layerId, () => {});\n mapInstance.off('mouseleave', layerId, () => {});\n });\n\n // Remove all layers\n [\n clustersLayerId.value,\n clusterCountLayerId.value,\n unclusteredLayerId.value,\n ].forEach((layerId) => {\n if (mapInstance.getLayer(layerId)) {\n mapInstance.removeLayer(layerId);\n }\n });\n\n // Remove source\n if (mapInstance.getSource(props.sourceId)) {\n mapInstance.removeSource(props.sourceId);\n }\n } catch (error) {\n console.error('Error cleaning up cluster layers:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { onMounted, onBeforeUnmount, ref, watch, computed } from 'vue';\n import type {\n GeoJSONSource,\n Map,\n MapLayerMouseEvent,\n LineLayerSpecification,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface RouteClick {\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n /** Unique identifier for the route */\n id?: string;\n /** Array of [longitude, latitude] coordinate pairs defining the route */\n coordinates: [number, number][];\n /** Line color as CSS color value */\n color?: string;\n /** Line width in pixels */\n width?: number;\n /** Line opacity (0-1) */\n opacity?: number;\n /** Line cap style */\n lineCap?: 'butt' | 'round' | 'square';\n /** Line join style */\n lineJoin?: 'bevel' | 'round' | 'miter';\n /** Whether the route is visible */\n visible?: boolean;\n /** Whether the route is interactive (shows pointer cursor on hover) */\n interactive?: boolean;\n /** Render this layer before the specified layer */\n before?: string;\n /** Line dash array for dashed lines */\n dashArray?: number[];\n /** Line blur in pixels */\n blur?: number;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n id: () => `route-${Math.random().toString(36).slice(2, 9)}`,\n color: '#4285F4',\n width: 4,\n opacity: 1,\n lineCap: 'round',\n lineJoin: 'round',\n visible: true,\n interactive: true,\n before: '',\n blur: 0,\n });\n\n const emit = defineEmits<{\n click: [event: RouteClick];\n mouseenter: [];\n mouseleave: [];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n\n const sourceId = computed(() => `${props.id}-source`);\n const layerId = computed(() => `${props.id}-layer`);\n\n // Create GeoJSON data from coordinates\n const geojsonData = computed(\n (): GeoJSON.FeatureCollection<GeoJSON.LineString> => ({\n type: 'FeatureCollection',\n features:\n props.coordinates.length >= 2\n ? [\n {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: props.coordinates,\n },\n },\n ]\n : [],\n }),\n );\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup map style load listener\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n // Don't add if no valid coordinates\n if (props.coordinates.length < 2) return;\n\n try {\n // Only add source if it doesn't exist\n if (!mapInstance.getSource(sourceId.value)) {\n mapInstance.addSource(sourceId.value, {\n type: 'geojson',\n data: geojsonData.value,\n });\n }\n\n // Only add layer if it doesn't exist\n if (!mapInstance.getLayer(layerId.value)) {\n const layerSpec: LineLayerSpecification = {\n id: layerId.value,\n type: 'line',\n source: sourceId.value,\n layout: {\n 'line-cap': props.lineCap,\n 'line-join': props.lineJoin,\n visibility: props.visible ? 'visible' : 'none',\n },\n paint: {\n 'line-color': props.color,\n 'line-width': props.width,\n 'line-opacity': props.opacity,\n ...(props.blur > 0 && { 'line-blur': props.blur }),\n ...(props.dashArray && { 'line-dasharray': props.dashArray }),\n },\n };\n\n mapInstance.addLayer(layerSpec, props.before || undefined);\n }\n } catch (error) {\n console.error('Error adding route layer:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(sourceId.value) as\n | GeoJSONSource\n | undefined;\n\n if (source && 'setData' in source) {\n source.setData(geojsonData.value);\n } else if (!source && props.coordinates.length >= 2) {\n addLayer();\n }\n } catch (error) {\n console.error('Error updating route source:', error);\n }\n };\n\n const updateLayerStyle = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.getLayer(layerId.value)) return;\n\n try {\n // Update paint properties\n mapInstance.setPaintProperty(layerId.value, 'line-color', props.color);\n mapInstance.setPaintProperty(layerId.value, 'line-width', props.width);\n mapInstance.setPaintProperty(\n layerId.value,\n 'line-opacity',\n props.opacity,\n );\n\n if (props.blur > 0) {\n mapInstance.setPaintProperty(layerId.value, 'line-blur', props.blur);\n }\n if (props.dashArray) {\n mapInstance.setPaintProperty(\n layerId.value,\n 'line-dasharray',\n props.dashArray,\n );\n }\n\n // Update layout properties\n mapInstance.setLayoutProperty(layerId.value, 'line-cap', props.lineCap);\n mapInstance.setLayoutProperty(layerId.value, 'line-join', props.lineJoin);\n mapInstance.setLayoutProperty(\n layerId.value,\n 'visibility',\n props.visible ? 'visible' : 'none',\n );\n } catch (error) {\n console.error('Error updating route layer style:', error);\n }\n };\n\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance || !props.interactive) return;\n\n try {\n // Click handler\n mapInstance.on('click', layerId.value, (e: MapLayerMouseEvent) => {\n emit('click', {\n coordinates: e.lngLat,\n });\n });\n\n // Hover effects\n mapInstance.on('mouseenter', layerId.value, () => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n emit('mouseenter');\n });\n\n mapInstance.on('mouseleave', layerId.value, () => {\n mapInstance.getCanvas().style.cursor = '';\n emit('mouseleave');\n });\n } catch (error) {\n console.error('Error setting up route layer events:', error);\n }\n };\n\n // Watch for coordinate changes\n watch(\n () => props.coordinates,\n () => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n if (!mapInstance.getSource(sourceId.value)) {\n addLayer();\n } else {\n updateSource();\n }\n }\n },\n { deep: true },\n );\n\n // Watch for style changes\n watch(\n () => [\n props.color,\n props.width,\n props.opacity,\n props.lineCap,\n props.lineJoin,\n props.visible,\n props.blur,\n props.dashArray,\n ],\n () => updateLayerStyle(),\n { deep: true },\n );\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n }\n }\n },\n { immediate: true },\n );\n\n // Watch loaded state\n watch(loaded, (value) => {\n if (value && props.coordinates.length >= 2) {\n const mapInstance = getMapInstance();\n if (mapInstance) {\n addLayer();\n setupLayerEvents(mapInstance);\n }\n }\n });\n\n // Lifecycle hooks\n onMounted(() => {\n try {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded() && props.coordinates.length >= 2) {\n addLayer();\n setupLayerEvents(mapInstance);\n }\n } catch (error) {\n console.error('Error mounting route layer:', error);\n }\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(layerId.value)) {\n mapInstance.removeLayer(layerId.value);\n }\n if (mapInstance.getSource(sourceId.value)) {\n mapInstance.removeSource(sourceId.value);\n }\n } catch (error) {\n console.error('Error cleaning up route layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import {\n onMounted,\n onBeforeUnmount,\n ref,\n watch,\n computed,\n nextTick,\n } from 'vue';\n import type {\n GeoJSONSource,\n Map,\n MapLayerMouseEvent,\n FillLayerSpecification,\n LineLayerSpecification,\n } from 'maplibre-gl';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface IsochroneFeature {\n type: 'Feature';\n properties: {\n color: string;\n contour?: number;\n metric?: string;\n [key: string]: unknown;\n };\n geometry: GeoJSON.Polygon | GeoJSON.MultiPolygon;\n }\n\n interface IsochroneData {\n type: 'FeatureCollection';\n features: IsochroneFeature[];\n }\n\n interface IsochroneClick {\n feature: IsochroneFeature;\n coordinates: {\n lng: number;\n lat: number;\n };\n }\n\n interface Props {\n /** Unique identifier for the isochrone layer */\n id?: string;\n /** GeoJSON FeatureCollection with isochrone polygons (from Valhalla, OSRM, etc.) */\n data: IsochroneData | null;\n /** Fill opacity (0-1) */\n fillOpacity?: number;\n /** Line width in pixels for polygon outlines */\n lineWidth?: number;\n /** Line opacity (0-1) */\n lineOpacity?: number;\n /** Whether the layer is visible */\n visible?: boolean;\n /** Whether the layer is interactive (shows pointer cursor on hover) */\n interactive?: boolean;\n /** Render this layer before the specified layer */\n before?: string;\n /** Whether to reverse the feature order (for proper stacking of overlapping polygons) */\n reverseOrder?: boolean;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n id: () => `isochrone-${Math.random().toString(36).slice(2, 9)}`,\n fillOpacity: 0.4,\n lineWidth: 2,\n lineOpacity: 0.8,\n visible: true,\n interactive: true,\n before: '',\n reverseOrder: true,\n });\n\n const emit = defineEmits<{\n click: [event: IsochroneClick];\n mouseenter: [feature: IsochroneFeature];\n mouseleave: [];\n }>();\n\n const map = injectStrict(MapKey);\n const loaded: Ref<boolean> = ref(false);\n const initialized = ref(false);\n\n const sourceId = computed(() => `${props.id}-source`);\n const fillLayerId = computed(() => `${props.id}-fill`);\n const lineLayerId = computed(() => `${props.id}-line`);\n\n /**\n * Process the GeoJSON data:\n * 1. Optionally reverse feature order for proper polygon stacking\n * 2. Add fillColor property with # prefix (Valhalla returns colors without #)\n */\n const processedData = computed((): IsochroneData | null => {\n if (!props.data || !props.data.features || props.data.features.length === 0)\n return null;\n\n const features = props.reverseOrder\n ? [...props.data.features].reverse()\n : props.data.features;\n\n return {\n type: 'FeatureCollection',\n features: features.map((f) => ({\n ...f,\n properties: {\n ...f.properties,\n // Add # prefix if color doesn't have it (Valhalla format)\n fillColor: f.properties.color.startsWith('#')\n ? f.properties.color\n : `#${f.properties.color}`,\n },\n })),\n };\n });\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup map style load listener\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const addLayers = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n const data = processedData.value;\n if (!data) return;\n\n try {\n // Add source if it doesn't exist\n if (!mapInstance.getSource(sourceId.value)) {\n mapInstance.addSource(sourceId.value, {\n type: 'geojson',\n data,\n });\n }\n\n // Add fill layer\n if (!mapInstance.getLayer(fillLayerId.value)) {\n const fillLayerSpec: FillLayerSpecification = {\n id: fillLayerId.value,\n type: 'fill',\n source: sourceId.value,\n layout: {\n visibility: props.visible ? 'visible' : 'none',\n },\n paint: {\n 'fill-color': ['get', 'fillColor'],\n 'fill-opacity': props.fillOpacity,\n },\n };\n\n mapInstance.addLayer(fillLayerSpec, props.before || undefined);\n }\n\n // Add line layer\n if (!mapInstance.getLayer(lineLayerId.value)) {\n const lineLayerSpec: LineLayerSpecification = {\n id: lineLayerId.value,\n type: 'line',\n source: sourceId.value,\n layout: {\n visibility: props.visible ? 'visible' : 'none',\n },\n paint: {\n 'line-color': ['get', 'fillColor'],\n 'line-width': props.lineWidth,\n 'line-opacity': props.lineOpacity,\n },\n };\n\n mapInstance.addLayer(lineLayerSpec, props.before || undefined);\n }\n } catch (error) {\n console.error('Error adding isochrone layers:', error);\n }\n };\n\n const updateSource = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n const source = mapInstance.getSource(sourceId.value) as\n | GeoJSONSource\n | undefined;\n\n const data = processedData.value;\n\n if (source && 'setData' in source) {\n if (data) {\n source.setData(data);\n }\n } else if (!source && data) {\n addLayers();\n }\n } catch (error) {\n console.error('Error updating isochrone source:', error);\n }\n };\n\n const updateLayerStyle = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Update fill layer\n if (mapInstance.getLayer(fillLayerId.value)) {\n mapInstance.setPaintProperty(\n fillLayerId.value,\n 'fill-opacity',\n props.fillOpacity,\n );\n mapInstance.setLayoutProperty(\n fillLayerId.value,\n 'visibility',\n props.visible ? 'visible' : 'none',\n );\n }\n\n // Update line layer\n if (mapInstance.getLayer(lineLayerId.value)) {\n mapInstance.setPaintProperty(\n lineLayerId.value,\n 'line-width',\n props.lineWidth,\n );\n mapInstance.setPaintProperty(\n lineLayerId.value,\n 'line-opacity',\n props.lineOpacity,\n );\n mapInstance.setLayoutProperty(\n lineLayerId.value,\n 'visibility',\n props.visible ? 'visible' : 'none',\n );\n }\n } catch (error) {\n console.error('Error updating isochrone layer style:', error);\n }\n };\n\n const setupLayerEvents = (mapInstance: Map) => {\n if (!mapInstance || !props.interactive) return;\n\n try {\n // Click handler on fill layer\n mapInstance.on('click', fillLayerId.value, (e: MapLayerMouseEvent) => {\n if (e.features && e.features.length > 0) {\n emit('click', {\n feature: e.features[0] as unknown as IsochroneFeature,\n coordinates: e.lngLat,\n });\n }\n });\n\n // Hover effects\n mapInstance.on(\n 'mouseenter',\n fillLayerId.value,\n (e: MapLayerMouseEvent) => {\n mapInstance.getCanvas().style.cursor = 'pointer';\n if (e.features && e.features.length > 0) {\n emit('mouseenter', e.features[0] as unknown as IsochroneFeature);\n }\n },\n );\n\n mapInstance.on('mouseleave', fillLayerId.value, () => {\n mapInstance.getCanvas().style.cursor = '';\n emit('mouseleave');\n });\n } catch (error) {\n console.error('Error setting up isochrone layer events:', error);\n }\n };\n\n // Single initialization function to prevent race conditions\n const initializeLayers = async () => {\n if (initialized.value) return;\n\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n if (!processedData.value) return;\n\n // Wait for next tick to ensure all watchers are set up\n await nextTick();\n\n // Double-check we haven't been initialized during the tick\n if (initialized.value) return;\n\n addLayers();\n setupLayerEvents(mapInstance);\n initialized.value = true;\n };\n\n // Watch for data changes\n watch(\n () => props.data,\n () => {\n const mapInstance = getMapInstance();\n if (mapInstance?.isStyleLoaded()) {\n if (!mapInstance.getSource(sourceId.value)) {\n addLayers();\n } else {\n updateSource();\n }\n }\n },\n { deep: true },\n );\n\n // Watch for style changes\n watch(\n () => [\n props.fillOpacity,\n props.lineWidth,\n props.lineOpacity,\n props.visible,\n ],\n () => updateLayerStyle(),\n { deep: true },\n );\n\n // IMPORTANT: watch(loaded) must be defined BEFORE watch(map) with immediate: true\n // Otherwise, when map watcher sets loaded.value = true, this watcher won't catch it\n watch(loaded, (value) => {\n if (value) {\n initializeLayers();\n }\n });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n // Also call initializeLayers directly in case loaded watcher already ran\n initializeLayers();\n }\n }\n },\n { immediate: true },\n );\n\n // Lifecycle hooks\n onMounted(() => {\n // Use nextTick to ensure all watchers are registered\n nextTick(() => {\n initializeLayers();\n });\n });\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n // Remove layers\n if (mapInstance.getLayer(lineLayerId.value)) {\n mapInstance.removeLayer(lineLayerId.value);\n }\n if (mapInstance.getLayer(fillLayerId.value)) {\n mapInstance.removeLayer(fillLayerId.value);\n }\n // Remove source\n if (mapInstance.getSource(sourceId.value)) {\n mapInstance.removeSource(sourceId.value);\n }\n } catch (error) {\n console.error('Error cleaning up isochrone layer:', error);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Animated starfield overlay rendered as a custom MapLibre layer for night-time / space-themed basemaps.\n *\n * @requires `@geoql/maplibre-gl-starfield`\n *\n * Install with:\n * `pnpm add @geoql/maplibre-gl-starfield`\n */\n import { ref, watch, onBeforeUnmount } from 'vue';\n import type { Map } from 'maplibre-gl';\n import { MaplibreStarfieldLayer } from '@geoql/maplibre-gl-starfield';\n import { injectStrict, MapKey } from '../../../../utils';\n\n interface Props {\n id?: string;\n starCount?: number;\n starSize?: number;\n starColor?: number;\n galaxyTextureUrl?: string;\n galaxyBrightness?: number;\n before?: string;\n sunEnabled?: boolean;\n sunAzimuth?: number;\n sunAltitude?: number;\n sunSize?: number;\n sunColor?: number;\n sunIntensity?: number;\n autoFadeStars?: boolean;\n fadeAltitude?: number;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n id: 'starfield',\n starCount: 4000,\n starSize: 2.0,\n starColor: 0xffffff,\n galaxyBrightness: 0.35,\n sunEnabled: false,\n sunAzimuth: 180,\n sunAltitude: 45,\n sunSize: 100,\n sunColor: 0xffeeaa,\n sunIntensity: 1.5,\n autoFadeStars: true,\n });\n\n const map = injectStrict(MapKey);\n const loaded = ref(false);\n let layerInstance: MaplibreStarfieldLayer | null = null;\n\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n const addLayer = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance || !mapInstance.isStyleLoaded()) return;\n\n try {\n if (mapInstance.getLayer(props.id)) {\n mapInstance.removeLayer(props.id);\n }\n\n layerInstance = new MaplibreStarfieldLayer({\n id: props.id,\n starCount: props.starCount,\n starSize: props.starSize,\n starColor: props.starColor,\n galaxyTextureUrl: props.galaxyTextureUrl,\n galaxyBrightness: props.galaxyBrightness,\n sunEnabled: props.sunEnabled,\n sunAzimuth: props.sunAzimuth,\n sunAltitude: props.sunAltitude,\n sunSize: props.sunSize,\n sunColor: props.sunColor,\n sunIntensity: props.sunIntensity,\n autoFadeStars: props.autoFadeStars,\n fadeAltitude: props.fadeAltitude,\n });\n\n mapInstance.addLayer(layerInstance, props.before || undefined);\n } catch (error) {\n console.error('Error adding starfield layer:', error);\n }\n };\n\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n if (newMap.isStyleLoaded()) {\n loaded.value = true;\n }\n }\n },\n { immediate: true },\n );\n\n watch(loaded, (value) => {\n if (value) {\n addLayer();\n }\n });\n\n watch(\n () => [props.sunAzimuth, props.sunAltitude, props.fadeAltitude],\n ([az, alt, fade]) => {\n layerInstance?.setSunPosition(\n az as number,\n alt as number,\n fade as number | undefined,\n );\n },\n );\n watch(\n () => props.fadeAltitude,\n (fade) => {\n layerInstance?.setFadeAltitude(fade);\n },\n );\n\n watch(\n () => props.sunEnabled,\n (enabled) => {\n layerInstance?.setSunEnabled(enabled);\n },\n );\n\n watch(\n () => props.sunIntensity,\n (intensity) => {\n layerInstance?.setSunIntensity(intensity);\n },\n );\n\n watch(\n () => props.sunSize,\n (size) => {\n layerInstance?.setSunSize(size);\n },\n );\n\n onBeforeUnmount(() => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if (mapInstance.getLayer(props.id)) {\n mapInstance.removeLayer(props.id);\n }\n } catch (error) {\n console.error('Error cleaning up starfield layer:', error);\n }\n layerInstance = null;\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render circles at coordinate positions with data-driven radius / color.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ScatterplotLayer } from '@deck.gl/layers';\n import type { ScatterplotLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getRadius?: Accessor<D, number>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n radiusUnits?: 'meters' | 'common' | 'pixels';\n radiusScale?: number;\n radiusMinPixels?: number;\n radiusMaxPixels?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n stroked?: boolean;\n filled?: boolean;\n billboard?: boolean;\n antialiasing?: boolean;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n radiusUnits: 'meters',\n radiusScale: 1,\n radiusMinPixels: 0,\n radiusMaxPixels: Number.MAX_SAFE_INTEGER,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n stroked: false,\n filled: true,\n billboard: false,\n antialiasing: true,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ScatterplotLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getRadius: props.getRadius ?? 1,\n getFillColor: props.getFillColor ?? [255, 140, 0],\n getLineColor: props.getLineColor ?? [0, 0, 0],\n getLineWidth: props.getLineWidth ?? 1,\n radiusUnits: props.radiusUnits,\n radiusScale: props.radiusScale,\n radiusMinPixels: props.radiusMinPixels,\n radiusMaxPixels: props.radiusMaxPixels,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n stroked: props.stroked,\n filled: props.filled,\n billboard: props.billboard,\n antialiasing: props.antialiasing,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as ScatterplotLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getRadius,\n props.getFillColor,\n props.getLineColor,\n props.radiusScale,\n props.opacity,\n props.visible,\n props.stroked,\n props.filled,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render curved 3D arcs between coordinate pairs.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ArcLayer } from '@deck.gl/layers';\n import type { ArcLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getSourcePosition: Accessor<D, Position>;\n getTargetPosition: Accessor<D, Position>;\n getSourceColor?: Accessor<D, Color>;\n getTargetColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n getHeight?: Accessor<D, number>;\n getTilt?: Accessor<D, number>;\n greatCircle?: boolean;\n numSegments?: number;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n greatCircle: false,\n numSegments: 50,\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ArcLayer({\n id: props.id,\n data: props.data,\n getSourcePosition: props.getSourcePosition,\n getTargetPosition: props.getTargetPosition,\n getSourceColor: props.getSourceColor ?? [255, 140, 0],\n getTargetColor: props.getTargetColor ?? [0, 200, 255],\n getWidth: props.getWidth ?? 1,\n getHeight: props.getHeight ?? 1,\n getTilt: props.getTilt ?? 0,\n greatCircle: props.greatCircle,\n numSegments: props.numSegments,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as ArcLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getSourcePosition,\n props.getTargetPosition,\n props.getSourceColor,\n props.getTargetColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render GeoJSON FeatureCollections as deck.gl points/lines/polygons.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GeoJsonLayer } from '@deck.gl/layers';\n import type { PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D | string | Promise<D>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n getPointRadius?: Accessor<D, number>;\n getElevation?: Accessor<D, number>;\n getText?: Accessor<D, string>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n pointType?: string;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n lineJointRounded?: boolean;\n lineCapRounded?: boolean;\n lineMiterLimit?: number;\n pointRadiusUnits?: 'meters' | 'common' | 'pixels';\n pointRadiusScale?: number;\n pointRadiusMinPixels?: number;\n pointRadiusMaxPixels?: number;\n elevationScale?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n pointType: 'circle',\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n lineJointRounded: false,\n lineCapRounded: false,\n lineMiterLimit: 4,\n pointRadiusUnits: 'meters',\n pointRadiusScale: 1,\n pointRadiusMinPixels: 0,\n pointRadiusMaxPixels: Number.MAX_SAFE_INTEGER,\n elevationScale: 1,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GeoJsonLayer({\n id: props.id,\n data: props.data,\n getFillColor: props.getFillColor ?? [200, 200, 200, 200],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getLineWidth: props.getLineWidth ?? 1,\n getPointRadius: props.getPointRadius ?? 1,\n getElevation: props.getElevation ?? 1000,\n getText: props.getText,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n pointType: props.pointType,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n lineJointRounded: props.lineJointRounded,\n lineCapRounded: props.lineCapRounded,\n lineMiterLimit: props.lineMiterLimit,\n pointRadiusUnits: props.pointRadiusUnits,\n pointRadiusScale: props.pointRadiusScale,\n pointRadiusMinPixels: props.pointRadiusMinPixels,\n pointRadiusMaxPixels: props.pointRadiusMaxPixels,\n elevationScale: props.elevationScale,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof GeoJsonLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getFillColor,\n props.getLineColor,\n props.opacity,\n props.visible,\n props.extruded,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render a list of polylines with width-in-meters or width-in-pixels.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { PathLayer } from '@deck.gl/layers';\n import type { PathLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPath: Accessor<D, Position[]>;\n getColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n capRounded?: boolean;\n jointRounded?: boolean;\n billboard?: boolean;\n miterLimit?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n widthUnits: 'meters',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n capRounded: false,\n jointRounded: false,\n billboard: false,\n miterLimit: 4,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new PathLayer({\n id: props.id,\n data: props.data,\n getPath: props.getPath,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getWidth: props.getWidth ?? 1,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n capRounded: props.capRounded,\n jointRounded: props.jointRounded,\n billboard: props.billboard,\n miterLimit: props.miterLimit,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as PathLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPath,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render flat straight lines between coordinate pairs.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { LineLayer } from '@deck.gl/layers';\n import type { LineLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getSourcePosition: Accessor<D, Position>;\n getTargetPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new LineLayer({\n id: props.id,\n data: props.data,\n getSourcePosition: props.getSourcePosition,\n getTargetPosition: props.getTargetPosition,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getWidth: props.getWidth ?? 1,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as LineLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getSourcePosition,\n props.getTargetPosition,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render filled / stroked polygons with optional extrusion (cheaper than SolidPolygon).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { PolygonLayer } from '@deck.gl/layers';\n import type { PolygonLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPolygon: Accessor<D, Position[] | Position[][]>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n lineJointRounded?: boolean;\n lineMiterLimit?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n lineJointRounded: false,\n lineMiterLimit: 4,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new PolygonLayer({\n id: props.id,\n data: props.data,\n getPolygon: props.getPolygon,\n getFillColor: props.getFillColor ?? [200, 200, 200, 200],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getLineWidth: props.getLineWidth ?? 1,\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n lineJointRounded: props.lineJointRounded,\n lineMiterLimit: props.lineMiterLimit,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as PolygonLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPolygon,\n props.getFillColor,\n props.getLineColor,\n props.opacity,\n props.visible,\n props.extruded,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Triangulated solid polygons with extrusion (fastest filled polygons in deck.gl).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { SolidPolygonLayer } from '@deck.gl/layers';\n import type { SolidPolygonLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPolygon: Accessor<D, Position[] | Position[][]>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new SolidPolygonLayer({\n id: props.id,\n data: props.data,\n getPolygon: props.getPolygon,\n getFillColor: props.getFillColor ?? [0, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as SolidPolygonLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPolygon,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Sprite-sheet icon layer for many marker-like points (cheaper than DOM markers).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { IconLayer } from '@deck.gl/layers';\n import type { IconLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface IconMapping {\n [key: string]: {\n x: number;\n y: number;\n width: number;\n height: number;\n anchorX?: number;\n anchorY?: number;\n mask?: boolean;\n };\n }\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getIcon?: Accessor<D, string | object>;\n getSize?: Accessor<D, number>;\n getColor?: Accessor<D, Color>;\n getAngle?: Accessor<D, number>;\n iconAtlas?: string;\n iconMapping?: IconMapping | string;\n sizeScale?: number;\n sizeUnits?: 'meters' | 'common' | 'pixels';\n sizeMinPixels?: number;\n sizeMaxPixels?: number;\n billboard?: boolean;\n alphaCutoff?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeScale: 1,\n sizeUnits: 'pixels',\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n billboard: true,\n alphaCutoff: 0.05,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new IconLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getIcon: props.getIcon ?? 'marker',\n getSize: props.getSize ?? 1,\n getColor: props.getColor ?? [255, 255, 255, 255],\n getAngle: props.getAngle ?? 0,\n iconAtlas: props.iconAtlas,\n iconMapping: props.iconMapping,\n sizeScale: props.sizeScale,\n sizeUnits: props.sizeUnits,\n sizeMinPixels: props.sizeMinPixels,\n sizeMaxPixels: props.sizeMaxPixels,\n billboard: props.billboard,\n alphaCutoff: props.alphaCutoff,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as IconLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getIcon,\n props.getSize,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render bitmap-font text labels at coordinate positions.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TextLayer } from '@deck.gl/layers';\n import type { TextLayerProps } from '@deck.gl/layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getText: Accessor<D, string>;\n getSize?: Accessor<D, number>;\n getColor?: Accessor<D, Color>;\n getAngle?: Accessor<D, number>;\n getTextAnchor?: Accessor<D, 'start' | 'middle' | 'end'>;\n getAlignmentBaseline?: Accessor<D, 'top' | 'center' | 'bottom'>;\n getPixelOffset?: Accessor<D, [number, number]>;\n getBackgroundColor?: Accessor<D, Color>;\n getBorderColor?: Accessor<D, Color>;\n getBorderWidth?: Accessor<D, number>;\n background?: boolean;\n backgroundPadding?: [number, number] | [number, number, number, number];\n billboard?: boolean;\n sizeScale?: number;\n sizeUnits?: 'meters' | 'common' | 'pixels';\n sizeMinPixels?: number;\n sizeMaxPixels?: number;\n characterSet?: string | string[];\n fontFamily?: string;\n fontWeight?: string | number;\n lineHeight?: number;\n fontSettings?: {\n sdf?: boolean;\n fontSize?: number;\n buffer?: number;\n radius?: number;\n cutoff?: number;\n smoothing?: number;\n };\n wordBreak?: 'break-all' | 'break-word';\n maxWidth?: number;\n outlineWidth?: number;\n outlineColor?: Color;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n background: false,\n billboard: true,\n sizeScale: 1,\n sizeUnits: 'pixels',\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n characterSet: 'auto',\n fontFamily: 'Monaco, monospace',\n fontWeight: 'normal',\n lineHeight: 1,\n fontSettings: () => ({ sdf: true }),\n wordBreak: 'break-word',\n maxWidth: -1,\n outlineWidth: 0,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TextLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getText: props.getText,\n getSize: props.getSize ?? 32,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getAngle: props.getAngle ?? 0,\n getTextAnchor: props.getTextAnchor ?? 'middle',\n getAlignmentBaseline: props.getAlignmentBaseline ?? 'center',\n getPixelOffset: props.getPixelOffset ?? [0, 0],\n getBackgroundColor: props.getBackgroundColor,\n getBorderColor: props.getBorderColor,\n getBorderWidth: props.getBorderWidth,\n background: props.background,\n backgroundPadding: props.backgroundPadding,\n billboard: props.billboard,\n sizeScale: props.sizeScale,\n sizeUnits: props.sizeUnits,\n sizeMinPixels: props.sizeMinPixels,\n sizeMaxPixels: props.sizeMaxPixels,\n characterSet: props.characterSet,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n lineHeight: props.lineHeight,\n fontSettings: props.fontSettings,\n wordBreak: props.wordBreak,\n maxWidth: props.maxWidth,\n outlineWidth: props.outlineWidth,\n outlineColor: props.outlineColor,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as TextLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getText,\n props.getSize,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Extruded hexagonal / cylindrical columns at point positions.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ColumnLayer } from '@deck.gl/layers';\n import type { ColumnLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n diskResolution?: number;\n radius?: number;\n angle?: number;\n vertices?: Position[];\n offset?: [number, number];\n coverage?: number;\n elevationScale?: number;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n flatShading?: boolean;\n radiusUnits?: 'meters' | 'common' | 'pixels';\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n diskResolution: 20,\n radius: 1000,\n angle: 0,\n coverage: 1,\n elevationScale: 1,\n filled: true,\n stroked: false,\n extruded: true,\n wireframe: false,\n flatShading: false,\n radiusUnits: 'meters',\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ColumnLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n diskResolution: props.diskResolution,\n radius: props.radius,\n angle: props.angle,\n vertices: props.vertices,\n offset: props.offset,\n coverage: props.coverage,\n elevationScale: props.elevationScale,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n flatShading: props.flatShading,\n radiusUnits: props.radiusUnits,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as ColumnLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getFillColor,\n props.getElevation,\n props.radius,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render a single bitmap image at geographic bounds.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { BitmapLayer } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n image:\n | string\n | HTMLImageElement\n | ImageBitmap\n | HTMLCanvasElement\n | ImageData\n | HTMLVideoElement;\n bounds:\n | [number, number, number, number]\n | [Position, Position, Position, Position];\n loadOptions?: object;\n textureParameters?: object;\n desaturate?: number;\n transparentColor?: Color;\n tintColor?: Color;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n desaturate: 0,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new BitmapLayer({\n id: props.id,\n image: props.image,\n bounds: props.bounds,\n loadOptions: props.loadOptions,\n textureParameters: props.textureParameters,\n desaturate: props.desaturate,\n transparentColor: props.transparentColor ?? [0, 0, 0, 0],\n tintColor: props.tintColor ?? [255, 255, 255],\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof BitmapLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.image,\n props.bounds,\n props.desaturate,\n props.tintColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render arbitrary axis-aligned grid cells with extrusion.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GridCellLayer } from '@deck.gl/layers';\n import type { GridCellLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getFillColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n cellSize?: number;\n coverage?: number;\n elevationScale?: number;\n extruded?: boolean;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSize: 1000,\n coverage: 1,\n elevationScale: 1,\n extruded: true,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GridCellLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n cellSize: props.cellSize,\n coverage: props.coverage,\n elevationScale: props.elevationScale,\n extruded: props.extruded,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as GridCellLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getFillColor,\n props.getElevation,\n props.cellSize,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render xyz / xyz+rgb point clouds (small/medium size, no LOD).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { PointCloudLayer } from '@deck.gl/layers';\n import type { PointCloudLayerProps } from '@deck.gl/layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getNormal?: Accessor<D, [number, number, number]>;\n sizeUnits?: 'meters' | 'common' | 'pixels';\n pointSize?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeUnits: 'pixels',\n pointSize: 10,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new PointCloudLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getColor: props.getColor ?? [0, 0, 0, 255],\n getNormal: props.getNormal ?? [0, 0, 1],\n sizeUnits: props.sizeUnits,\n pointSize: props.pointSize,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as PointCloudLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getColor,\n props.pointSize,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Gaussian-kernel heatmap from point data, GPU-aggregated.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/aggregation-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/aggregation-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { HeatmapLayer } from '@deck.gl/aggregation-layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getWeight?: Accessor<D, number>;\n intensity?: number;\n radiusPixels?: number;\n colorRange?: Color[];\n threshold?: number;\n colorDomain?: [number, number];\n aggregation?: 'SUM' | 'MEAN';\n weightsTextureSize?: number;\n debounceTimeout?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n intensity: 1,\n radiusPixels: 30,\n threshold: 0.05,\n aggregation: 'SUM',\n weightsTextureSize: 2048,\n debounceTimeout: 500,\n opacity: 1,\n visible: true,\n pickable: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new HeatmapLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getWeight: props.getWeight ?? 1,\n intensity: props.intensity,\n radiusPixels: props.radiusPixels,\n colorRange: props.colorRange,\n threshold: props.threshold,\n colorDomain: props.colorDomain,\n aggregation: props.aggregation,\n weightsTextureSize: props.weightsTextureSize,\n debounceTimeout: props.debounceTimeout,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof HeatmapLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.getWeight,\n props.intensity,\n props.radiusPixels,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Aggregate points into screen-resolved hexagons with extrusion.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/aggregation-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/aggregation-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { HexagonLayer } from '@deck.gl/aggregation-layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getColorWeight?: Accessor<D, number>;\n getElevationWeight?: Accessor<D, number>;\n gpuAggregation?: boolean;\n radius?: number;\n elevationScale?: number;\n elevationRange?: [number, number];\n colorRange?: Color[];\n colorDomain?: [number, number];\n coverage?: number;\n extruded?: boolean;\n upperPercentile?: number;\n lowerPercentile?: number;\n elevationUpperPercentile?: number;\n elevationLowerPercentile?: number;\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n material?: boolean | object;\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX' | 'COUNT';\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX' | 'COUNT';\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n gpuAggregation: false,\n radius: 1000,\n elevationScale: 1,\n coverage: 1,\n extruded: false,\n upperPercentile: 100,\n lowerPercentile: 0,\n elevationUpperPercentile: 100,\n elevationLowerPercentile: 0,\n colorScaleType: 'quantize',\n colorAggregation: 'SUM',\n elevationAggregation: 'SUM',\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new HexagonLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getColorWeight: props.getColorWeight,\n getElevationWeight: props.getElevationWeight,\n gpuAggregation: props.gpuAggregation,\n radius: props.radius,\n elevationScale: props.elevationScale,\n elevationRange: props.elevationRange,\n colorRange: props.colorRange,\n colorDomain: props.colorDomain,\n coverage: props.coverage,\n extruded: props.extruded,\n upperPercentile: props.upperPercentile,\n lowerPercentile: props.lowerPercentile,\n elevationUpperPercentile: props.elevationUpperPercentile,\n elevationLowerPercentile: props.elevationLowerPercentile,\n colorScaleType: props.colorScaleType,\n material: props.material,\n colorAggregation: props.colorAggregation,\n elevationAggregation: props.elevationAggregation,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof HexagonLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.radius,\n props.elevationScale,\n props.opacity,\n props.visible,\n props.extruded,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Aggregate points into a regular square grid (GPU or CPU).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/aggregation-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/aggregation-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GridLayer } from '@deck.gl/aggregation-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getColorWeight?: Accessor<D, number>;\n getElevationWeight?: Accessor<D, number>;\n cellSize?: number;\n colorRange?: Color[];\n coverage?: number;\n elevationDomain?: [number, number];\n elevationRange?: [number, number];\n elevationScale?: number;\n extruded?: boolean;\n upperPercentile?: number;\n lowerPercentile?: number;\n elevationUpperPercentile?: number;\n elevationLowerPercentile?: number;\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n gpuAggregation?: boolean;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSize: 1000,\n coverage: 1,\n elevationScale: 1,\n extruded: false,\n upperPercentile: 100,\n lowerPercentile: 0,\n elevationUpperPercentile: 100,\n elevationLowerPercentile: 0,\n colorScaleType: 'quantize',\n colorAggregation: 'SUM',\n elevationAggregation: 'SUM',\n gpuAggregation: false,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GridLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getColorWeight: props.getColorWeight ?? 1,\n getElevationWeight: props.getElevationWeight ?? 1,\n cellSize: props.cellSize,\n colorRange: props.colorRange,\n coverage: props.coverage,\n elevationDomain: props.elevationDomain,\n elevationRange: props.elevationRange,\n elevationScale: props.elevationScale,\n extruded: props.extruded,\n upperPercentile: props.upperPercentile,\n lowerPercentile: props.lowerPercentile,\n elevationUpperPercentile: props.elevationUpperPercentile,\n elevationLowerPercentile: props.elevationLowerPercentile,\n colorScaleType: props.colorScaleType,\n colorAggregation: props.colorAggregation,\n elevationAggregation: props.elevationAggregation,\n gpuAggregation: props.gpuAggregation,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof GridLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.cellSize,\n props.colorRange,\n props.elevationScale,\n props.extruded,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Generate contour lines or isobands from point aggregations.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/aggregation-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/aggregation-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ContourLayer } from '@deck.gl/aggregation-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface ContourDefinition {\n threshold: number | [number, number];\n color?: Color;\n strokeWidth?: number;\n zIndex?: number;\n }\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getWeight?: Accessor<D, number>;\n cellSize?: number;\n contours: ContourDefinition[];\n gpuAggregation?: boolean;\n aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n zOffset?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSize: 1000,\n gpuAggregation: false,\n aggregation: 'SUM',\n zOffset: 0.005,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ContourLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getWeight: props.getWeight ?? 1,\n cellSize: props.cellSize,\n contours: props.contours,\n gpuAggregation: props.gpuAggregation,\n aggregation: props.aggregation,\n zOffset: props.zOffset,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof ContourLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.cellSize,\n props.contours,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Aggregate point data into a screen-aligned grid (zoom-dependent).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/aggregation-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/aggregation-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ScreenGridLayer } from '@deck.gl/aggregation-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPosition: Accessor<D, Position>;\n getWeight?: Accessor<D, number>;\n cellSizePixels?: number;\n cellMarginPixels?: number;\n colorRange?: Color[];\n colorDomain?: [number, number];\n gpuAggregation?: boolean;\n aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n cellSizePixels: 100,\n cellMarginPixels: 2,\n gpuAggregation: false,\n aggregation: 'SUM',\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new ScreenGridLayer({\n id: props.id,\n data: props.data,\n getPosition: props.getPosition,\n getWeight: props.getWeight ?? 1,\n cellSizePixels: props.cellSizePixels,\n cellMarginPixels: props.cellMarginPixels,\n colorRange: props.colorRange,\n colorDomain: props.colorDomain,\n gpuAggregation: props.gpuAggregation,\n aggregation: props.aggregation,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof ScreenGridLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPosition,\n props.cellSizePixels,\n props.colorRange,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Animated trail paths over time (vehicle / animal tracks).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TripsLayer } from '@deck.gl/geo-layers';\n import type { TripsLayerProps } from '@deck.gl/geo-layers';\n import type { PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import type { Color } from '../_shared/types';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getPath: Accessor<D, Position[]>;\n getTimestamps?: Accessor<D, number[]>;\n getColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n currentTime?: number;\n trailLength?: number;\n fadeTrail?: boolean;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n capRounded?: boolean;\n jointRounded?: boolean;\n billboard?: boolean;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n currentTime: 0,\n trailLength: 120,\n fadeTrail: true,\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n capRounded: false,\n jointRounded: false,\n billboard: false,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TripsLayer({\n id: props.id,\n data: props.data,\n getPath: props.getPath,\n getTimestamps: props.getTimestamps,\n getColor: props.getColor ?? [253, 128, 93],\n getWidth: props.getWidth ?? 1,\n currentTime: props.currentTime,\n trailLength: props.trailLength,\n fadeTrail: props.fadeTrail,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n capRounded: props.capRounded,\n jointRounded: props.jointRounded,\n billboard: props.billboard,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as TripsLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getPath,\n props.currentTime,\n props.trailLength,\n props.getColor,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render Uber H3 hexagons as individual filled cells.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { H3HexagonLayer } from '@deck.gl/geo-layers';\n import type { H3HexagonLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getHexagon: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n highPrecision?: boolean | 'auto';\n coverage?: number;\n elevationScale?: number;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n highPrecision: 'auto',\n coverage: 1,\n elevationScale: 1,\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new H3HexagonLayer({\n id: props.id,\n data: props.data,\n getHexagon: props.getHexagon,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n highPrecision: props.highPrecision,\n coverage: props.coverage,\n elevationScale: props.elevationScale,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as H3HexagonLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getHexagon,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render groups of contiguous H3 cells as merged polygons.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { H3ClusterLayer } from '@deck.gl/geo-layers';\n import type { H3ClusterLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getHexagons: Accessor<D, string[]>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new H3ClusterLayer({\n id: props.id,\n data: props.data,\n getHexagons: props.getHexagons,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as H3ClusterLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getHexagons,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Consume Mapbox Vector Tile (MVT / PBF) endpoints.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { MVTLayer } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: string | string[];\n minZoom?: number;\n maxZoom?: number;\n uniqueIdProperty?: string;\n highlightedFeatureId?: string | number;\n binary?: boolean;\n loadOptions?: object;\n // Sublayer props\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getLineWidth?: Accessor<D, number>;\n getPointRadius?: Accessor<D, number>;\n getElevation?: Accessor<D, number>;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n pointRadiusUnits?: 'meters' | 'common' | 'pixels';\n pointRadiusScale?: number;\n pointRadiusMinPixels?: number;\n pointRadiusMaxPixels?: number;\n stroked?: boolean;\n filled?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n pointType?: string;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n minZoom: 0,\n maxZoom: 23,\n binary: true,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n pointRadiusUnits: 'meters',\n pointRadiusScale: 1,\n pointRadiusMinPixels: 0,\n pointRadiusMaxPixels: Number.MAX_SAFE_INTEGER,\n stroked: true,\n filled: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n tileLoad: [tile: unknown];\n tileError: [error: Error, tile: unknown];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new MVTLayer({\n id: props.id,\n data: props.data,\n minZoom: props.minZoom,\n maxZoom: props.maxZoom,\n uniqueIdProperty: props.uniqueIdProperty,\n highlightedFeatureId: props.highlightedFeatureId,\n binary: props.binary,\n loadOptions: props.loadOptions,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getLineWidth: props.getLineWidth ?? 1,\n getPointRadius: props.getPointRadius ?? 1,\n getElevation: props.getElevation ?? 1000,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n pointRadiusUnits: props.pointRadiusUnits,\n pointRadiusScale: props.pointRadiusScale,\n pointRadiusMinPixels: props.pointRadiusMinPixels,\n pointRadiusMaxPixels: props.pointRadiusMaxPixels,\n stroked: props.stroked,\n filled: props.filled,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n pointType: props.pointType,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n onTileLoad: (tile: unknown) => emit('tileLoad', tile),\n onTileError: (error: Error, tile: unknown) =>\n emit('tileError', error, tile),\n } as unknown as ConstructorParameters<typeof MVTLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getFillColor,\n props.getLineColor,\n props.highlightedFeatureId,\n props.extruded,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Generic XYZ raster / vector tile viewer (deck.gl TileLayer).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TileLayer } from '@deck.gl/geo-layers';\n import type { TileLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo, Layer } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface TileData {\n x: number;\n y: number;\n z: number;\n url: string;\n signal: AbortSignal;\n bbox: {\n west: number;\n north: number;\n east: number;\n south: number;\n };\n }\n\n interface Props {\n id: string;\n data?: string | string[] | ((tileData: TileData) => Promise<unknown>);\n getTileData?: (tileData: TileData) => Promise<unknown>;\n renderSubLayers?: (props: object) => Layer | Layer[] | null;\n tileSize?: number;\n maxZoom?: number;\n minZoom?: number;\n maxCacheSize?: number;\n maxCacheByteSize?: number;\n refinementStrategy?: 'best-available' | 'no-overlap' | 'never';\n zRange?: [number, number];\n maxRequests?: number;\n extent?: [number, number, number, number];\n loadOptions?: object;\n zoomOffset?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n tileSize: 512,\n minZoom: 0,\n refinementStrategy: 'best-available',\n maxRequests: 6,\n zoomOffset: 0,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n viewportLoad: [tiles: unknown[]];\n tileLoad: [tile: unknown];\n tileUnload: [tile: unknown];\n tileError: [error: Error, tile: unknown];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TileLayer({\n id: props.id,\n data: props.data,\n getTileData: props.getTileData,\n renderSubLayers: props.renderSubLayers,\n tileSize: props.tileSize,\n maxZoom: props.maxZoom,\n minZoom: props.minZoom,\n maxCacheSize: props.maxCacheSize,\n maxCacheByteSize: props.maxCacheByteSize,\n refinementStrategy: props.refinementStrategy,\n zRange: props.zRange,\n maxRequests: props.maxRequests,\n extent: props.extent,\n loadOptions: props.loadOptions,\n zoomOffset: props.zoomOffset,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n onViewportLoad: (tiles: unknown[]) => emit('viewportLoad', tiles),\n onTileLoad: (tile: unknown) => emit('tileLoad', tile),\n onTileUnload: (tile: unknown) => emit('tileUnload', tile),\n onTileError: (error: Error, tile: unknown) =>\n emit('tileError', error, tile),\n } as TileLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.tileSize,\n props.maxZoom,\n props.minZoom,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * 3D Tiles (Cesium / Google Photorealistic) viewer powered by loaders.gl.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { Tile3DLayer } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n data: string;\n loader?: object;\n loadOptions?: object;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n opacity?: number;\n visible?: boolean;\n pointSize?: number;\n getPointColor?: Color | ((d: unknown) => Color);\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n pointSize: 1,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n tilesetLoad: [tileset: unknown];\n tileLoad: [tile: unknown];\n tileUnload: [tile: unknown];\n tileError: [error: Error, url: string, tile: unknown];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n const layerProps = {\n id: props.id,\n data: props.data,\n pointSize: props.pointSize,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n onTilesetLoad: (tileset: unknown) => emit('tilesetLoad', tileset),\n onTileLoad: (tile: unknown) => emit('tileLoad', tile),\n onTileUnload: (tile: unknown) => emit('tileUnload', tile),\n onTileError: (error: Error, url: string, tile: unknown) =>\n emit('tileError', error, url, tile),\n // Only include optional props when defined to avoid deck.gl bugs\n ...(props.loader !== undefined && { loader: props.loader }),\n ...(props.loadOptions !== undefined && {\n loadOptions: props.loadOptions,\n }),\n ...(props.highlightColor !== undefined && {\n highlightColor: props.highlightColor,\n }),\n ...(props.getPointColor !== undefined && {\n getPointColor: props.getPointColor,\n }),\n };\n return new Tile3DLayer(\n layerProps as unknown as ConstructorParameters<typeof Tile3DLayer>[0],\n );\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [props.data, props.pointSize, props.opacity, props.visible],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render terrain meshes from elevation tiles (terrain-rgb / mapbox-rgb).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { TerrainLayer } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n elevationData:\n | string\n | ((tileData: { x: number; y: number; z: number }) => string);\n texture?:\n | string\n | ((tileData: { x: number; y: number; z: number }) => string);\n meshMaxError?: number;\n elevationDecoder?: {\n rScaler: number;\n gScaler: number;\n bScaler: number;\n offset: number;\n };\n bounds?: [number, number, number, number];\n loadOptions?: object;\n workerUrl?: string;\n color?: Color;\n wireframe?: boolean;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n meshMaxError: 4.0,\n wireframe: false,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new TerrainLayer({\n id: props.id,\n elevationData: props.elevationData,\n texture: props.texture,\n meshMaxError: props.meshMaxError,\n elevationDecoder: props.elevationDecoder,\n bounds: props.bounds,\n loadOptions: props.loadOptions,\n workerUrl: props.workerUrl,\n color: props.color ?? [255, 255, 255],\n wireframe: props.wireframe,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as unknown as ConstructorParameters<typeof TerrainLayer>[0]);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.elevationData,\n props.texture,\n props.meshMaxError,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render great-circle arcs between coordinate pairs.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GreatCircleLayer } from '@deck.gl/geo-layers';\n import type { GreatCircleLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getSourcePosition: Accessor<D, Position>;\n getTargetPosition: Accessor<D, Position>;\n getSourceColor?: Accessor<D, Color>;\n getTargetColor?: Accessor<D, Color>;\n getWidth?: Accessor<D, number>;\n getHeight?: Accessor<D, number>;\n getTilt?: Accessor<D, number>;\n numSegments?: number;\n widthUnits?: 'meters' | 'common' | 'pixels';\n widthScale?: number;\n widthMinPixels?: number;\n widthMaxPixels?: number;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n numSegments: 50,\n widthUnits: 'pixels',\n widthScale: 1,\n widthMinPixels: 0,\n widthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GreatCircleLayer({\n id: props.id,\n data: props.data,\n getSourcePosition: props.getSourcePosition,\n getTargetPosition: props.getTargetPosition,\n getSourceColor: props.getSourceColor ?? [0, 0, 255],\n getTargetColor: props.getTargetColor ?? [0, 255, 0],\n getWidth: props.getWidth ?? 1,\n getHeight: props.getHeight ?? 1,\n getTilt: props.getTilt ?? 0,\n numSegments: props.numSegments,\n widthUnits: props.widthUnits,\n widthScale: props.widthScale,\n widthMinPixels: props.widthMinPixels,\n widthMaxPixels: props.widthMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as GreatCircleLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getSourcePosition,\n props.getTargetPosition,\n props.getSourceColor,\n props.getTargetColor,\n props.getWidth,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render Google S2 cells as deck.gl polygons.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { S2Layer } from '@deck.gl/geo-layers';\n import type { S2LayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getS2Token: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new S2Layer({\n id: props.id,\n data: props.data,\n getS2Token: props.getS2Token,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as S2LayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getS2Token,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render Geohash cells as deck.gl polygons.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { GeohashLayer } from '@deck.gl/geo-layers';\n import type { GeohashLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getGeohash: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new GeohashLayer({\n id: props.id,\n data: props.data,\n getGeohash: props.getGeohash,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as GeohashLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getGeohash,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Render Bing-style quadkey tiles as deck.gl polygons.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { QuadkeyLayer } from '@deck.gl/geo-layers';\n import type { QuadkeyLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n getQuadkey: Accessor<D, string>;\n getFillColor?: Accessor<D, Color>;\n getLineColor?: Accessor<D, Color>;\n getElevation?: Accessor<D, number>;\n filled?: boolean;\n stroked?: boolean;\n extruded?: boolean;\n wireframe?: boolean;\n elevationScale?: number;\n lineWidthUnits?: 'meters' | 'common' | 'pixels';\n lineWidthScale?: number;\n lineWidthMinPixels?: number;\n lineWidthMaxPixels?: number;\n material?: boolean | object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n filled: true,\n stroked: true,\n extruded: false,\n wireframe: false,\n elevationScale: 1,\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new QuadkeyLayer({\n id: props.id,\n data: props.data,\n getQuadkey: props.getQuadkey,\n getFillColor: props.getFillColor ?? [255, 0, 0, 255],\n getLineColor: props.getLineColor ?? [0, 0, 0, 255],\n getElevation: props.getElevation ?? 1000,\n filled: props.filled,\n stroked: props.stroked,\n extruded: props.extruded,\n wireframe: props.wireframe,\n elevationScale: props.elevationScale,\n lineWidthUnits: props.lineWidthUnits,\n lineWidthScale: props.lineWidthScale,\n lineWidthMinPixels: props.lineWidthMinPixels,\n lineWidthMaxPixels: props.lineWidthMaxPixels,\n material: props.material,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as QuadkeyLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.getQuadkey,\n props.getFillColor,\n props.getElevation,\n props.extruded,\n props.elevationScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Consume WMS endpoints as deck.gl tiles.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/geo-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/geo-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { _WMSLayer as WMSLayer } from '@deck.gl/geo-layers';\n import type { WMSLayerProps } from '@deck.gl/geo-layers';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n id: string;\n data: string;\n serviceType?: 'wms' | 'template';\n layers?: string[];\n srs?: string;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n serviceType: 'wms',\n srs: 'EPSG:4326',\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n return new WMSLayer({\n id: props.id,\n data: props.data,\n serviceType: props.serviceType,\n layers: props.layers,\n srs: props.srs,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n highlightColor: props.highlightColor,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n } as WMSLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [props.data, props.layers, props.srs, props.opacity, props.visible],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Instance a single 3D mesh (GLTF / OBJ) at many positions.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/mesh-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/mesh-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { SimpleMeshLayer } from '@deck.gl/mesh-layers';\n import type { SimpleMeshLayerProps } from '@deck.gl/mesh-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n mesh: string | object;\n getPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getOrientation?: Accessor<D, [number, number, number]>;\n getScale?: Accessor<D, [number, number, number] | number>;\n getTranslation?: Accessor<D, [number, number, number]>;\n getTransformMatrix?: Accessor<D, number[]>;\n texture?: string | object;\n sizeScale?: number;\n wireframe?: boolean;\n material?: boolean | object;\n loaders?: object[];\n loadOptions?: object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeScale: 1,\n wireframe: false,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n // Build layer props object, excluding undefined optional props to avoid deck.gl bugs\n // where it tries to call undefined as a function (e.g., getTransformMatrix)\n const layerProps = {\n id: props.id,\n data: props.data,\n mesh: props.mesh,\n getPosition: props.getPosition,\n getColor: props.getColor ?? [255, 255, 255, 255],\n getOrientation: props.getOrientation ?? [0, 0, 0],\n getScale: props.getScale ?? [1, 1, 1],\n getTranslation: props.getTranslation ?? [0, 0, 0],\n sizeScale: props.sizeScale,\n wireframe: props.wireframe,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n // Only include optional props if defined\n ...(props.getTransformMatrix !== undefined && {\n getTransformMatrix: props.getTransformMatrix,\n }),\n ...(props.texture !== undefined && { texture: props.texture }),\n ...(props.material !== undefined && { material: props.material }),\n ...(props.loaders !== undefined && { loaders: props.loaders }),\n ...(props.loadOptions !== undefined && {\n loadOptions: props.loadOptions,\n }),\n ...(props.highlightColor !== undefined && {\n highlightColor: props.highlightColor,\n }),\n ...(props.beforeId !== undefined && { beforeId: props.beforeId }),\n };\n\n return new SimpleMeshLayer(layerProps as SimpleMeshLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.mesh,\n props.getPosition,\n props.getColor,\n props.getOrientation,\n props.getScale,\n props.sizeScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Instance an animated GLTF scenegraph at many positions.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/mesh-layers`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/mesh-layers`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import { ScenegraphLayer } from '@deck.gl/mesh-layers';\n import type { ScenegraphLayerProps } from '@deck.gl/mesh-layers';\n import type { Color, PickingInfo, Position } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n type Accessor<In, Out> = Out | ((object: In) => Out);\n\n interface Props<D = unknown> {\n id: string;\n data: D[] | string | Promise<D[]>;\n scenegraph: string | object;\n getPosition: Accessor<D, Position>;\n getColor?: Accessor<D, Color>;\n getOrientation?: Accessor<D, [number, number, number]>;\n getScale?: Accessor<D, [number, number, number] | number>;\n getTranslation?: Accessor<D, [number, number, number]>;\n getTransformMatrix?: Accessor<D, number[]>;\n sizeScale?: number;\n sizeMinPixels?: number;\n sizeMaxPixels?: number;\n animator?: object;\n loaders?: object[];\n loadOptions?: object;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n autoHighlight?: boolean;\n highlightColor?: Color;\n beforeId?: string;\n // Animation and lighting options\n _animations?: Record<\n string,\n { playing?: boolean; speed?: number; startTime?: number }\n >;\n _lighting?: 'flat' | 'pbr';\n }\n\n const props = withDefaults(defineProps<Props>(), {\n sizeScale: 1,\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n opacity: 1,\n visible: true,\n pickable: true,\n autoHighlight: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const createLayer = () => {\n // Build layer props object, excluding undefined optional props to avoid deck.gl bugs\n // where it tries to call undefined as a function (e.g., getTransformMatrix)\n const layerProps = {\n id: props.id,\n data: props.data,\n scenegraph: props.scenegraph,\n getPosition: props.getPosition,\n getColor: props.getColor ?? [255, 255, 255, 255],\n getOrientation: props.getOrientation ?? [0, 0, 0],\n getScale: props.getScale ?? [1, 1, 1],\n getTranslation: props.getTranslation ?? [0, 0, 0],\n sizeScale: props.sizeScale,\n sizeMinPixels: props.sizeMinPixels,\n sizeMaxPixels: props.sizeMaxPixels,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n autoHighlight: props.autoHighlight,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n // Only include optional props if defined\n ...(props.getTransformMatrix !== undefined && {\n getTransformMatrix: props.getTransformMatrix,\n }),\n ...(props.animator !== undefined && { animator: props.animator }),\n ...(props.loaders !== undefined && { loaders: props.loaders }),\n ...(props.loadOptions !== undefined && {\n loadOptions: props.loadOptions,\n }),\n ...(props.highlightColor !== undefined && {\n highlightColor: props.highlightColor,\n }),\n ...(props.beforeId !== undefined && { beforeId: props.beforeId }),\n ...(props._animations !== undefined && {\n _animations: props._animations,\n }),\n ...(props._lighting !== undefined && { _lighting: props._lighting }),\n };\n\n return new ScenegraphLayer(layerProps as ScenegraphLayerProps);\n };\n\n const initializeLayer = () => {\n addLayer(createLayer());\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.data,\n props.scenegraph,\n props.getPosition,\n props.getColor,\n props.getOrientation,\n props.getScale,\n props.sizeScale,\n props.opacity,\n props.visible,\n ],\n () => updateLayer(props.id, createLayer()),\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Single Cloud-Optimized GeoTIFF (COG) viewer with automatic CRS reprojection.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n * @requires `@developmentseed/deck.gl-geotiff`\n * @requires `@developmentseed/deck.gl-raster`\n * @requires `@developmentseed/geotiff`\n * @requires `@developmentseed/proj`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj`\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n toRaw,\n markRaw,\n } from 'vue';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey, requirePeer } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n const COG_PEER_INSTALL =\n 'pnpm add @deck.gl/core @deck.gl/layers @deck.gl/mapbox @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj';\n\n interface Props {\n id: string;\n /**\n * GeoTIFF source - URL string, ArrayBuffer, Blob, or geotiff.js instance\n */\n geotiff: string | ArrayBuffer | Blob | object;\n /**\n * Tile size in pixels\n */\n tileSize?: number;\n /**\n * Maximum zoom level\n */\n maxZoom?: number;\n /**\n * Minimum zoom level\n */\n minZoom?: number;\n /**\n * Maximum number of tiles to cache\n */\n maxCacheSize?: number;\n /**\n * Refinement strategy for tile loading\n */\n refinementStrategy?: 'best-available' | 'no-overlap' | 'never';\n /**\n * Maximum concurrent requests\n */\n maxRequests?: number;\n /**\n * Layer opacity (0-1)\n */\n opacity?: number;\n /**\n * Layer visibility\n */\n visible?: boolean;\n /**\n * Enable picking on this layer\n */\n pickable?: boolean;\n /**\n * Auto highlight on hover\n */\n autoHighlight?: boolean;\n /**\n * Highlight color when autoHighlight is enabled\n */\n highlightColor?: Color;\n /**\n * Insert layer before this layer id\n */\n beforeId?: string;\n /**\n * Show debug overlay on tiles\n */\n debug?: boolean;\n /**\n * Opacity of debug overlay (0-1)\n */\n debugOpacity?: number;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n tileSize: 256,\n minZoom: 0,\n refinementStrategy: 'best-available',\n maxRequests: 6,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n debug: false,\n debugOpacity: 0.25,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n geotiffLoad: [\n tiff: unknown,\n options: {\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n // Store module references\n const COGLayerClass = shallowRef<\n typeof import('@developmentseed/deck.gl-geotiff').COGLayer | null\n >(null);\n const epsgResolverFn = shallowRef<\n typeof import('@developmentseed/proj').epsgResolver | null\n >(null);\n\n const createLayer = () => {\n if (!COGLayerClass.value) return null;\n\n const layerProps: Record<string, unknown> = {\n id: toRaw(props.id),\n geotiff: toRaw(props.geotiff),\n opacity: toRaw(props.opacity),\n visible: toRaw(props.visible),\n pickable: toRaw(props.pickable),\n autoHighlight: toRaw(props.autoHighlight),\n debug: toRaw(props.debug),\n debugOpacity: toRaw(props.debugOpacity),\n };\n\n if (epsgResolverFn.value) {\n layerProps.epsgResolver = epsgResolverFn.value;\n }\n\n layerProps.onGeoTIFFLoad = (\n tiff: unknown,\n options: {\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ) => {\n emit('geotiffLoad', tiff, options);\n };\n\n if (props.tileSize !== 256) layerProps.tileSize = toRaw(props.tileSize);\n if (props.maxZoom !== undefined) layerProps.maxZoom = toRaw(props.maxZoom);\n if (props.minZoom !== 0) layerProps.minZoom = toRaw(props.minZoom);\n if (props.maxCacheSize !== undefined)\n layerProps.maxCacheSize = toRaw(props.maxCacheSize);\n if (props.refinementStrategy !== 'best-available')\n layerProps.refinementStrategy = toRaw(props.refinementStrategy);\n if (props.maxRequests !== 6)\n layerProps.maxRequests = toRaw(props.maxRequests);\n if (props.highlightColor !== undefined)\n layerProps.highlightColor = toRaw(props.highlightColor);\n if (props.beforeId !== undefined)\n layerProps.beforeId = toRaw(props.beforeId);\n\n const layer = new COGLayerClass.value(layerProps);\n return markRaw(layer);\n };\n\n const initializeLayer = async () => {\n try {\n const [geotiffModule, projModule] = await Promise.all([\n requirePeer(\n '@developmentseed/deck.gl-geotiff',\n () => import('@developmentseed/deck.gl-geotiff'),\n COG_PEER_INSTALL,\n ),\n requirePeer(\n '@developmentseed/proj',\n () => import('@developmentseed/proj'),\n COG_PEER_INSTALL,\n ),\n ]);\n\n COGLayerClass.value = markRaw(geotiffModule.COGLayer);\n epsgResolverFn.value = projModule.epsgResolver;\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-raster] Error loading COGLayer:', error);\n console.error('Make sure @developmentseed/deck.gl-geotiff is installed');\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.geotiff,\n props.tileSize,\n props.maxZoom,\n props.minZoom,\n props.opacity,\n props.visible,\n props.debug,\n props.debugOpacity,\n ],\n () => {\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Client-side COG mosaic for STAC items — GPU-rendered, no tile server required.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n * @requires `@developmentseed/deck.gl-geotiff`\n * @requires `@developmentseed/deck.gl-raster`\n * @requires `@developmentseed/geotiff`\n * @requires `@developmentseed/proj`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj`\n */\n /**\n * VLayerDeckglMosaic - Client-side COG mosaic layer for STAC items\n *\n * Uses @developmentseed/deck.gl-geotiff v0.3.0 MosaicLayer for efficient\n * client-side rendering of multiple COGs from STAC APIs.\n *\n * @see https://github.com/developmentseed/deck.gl-raster/blob/main/examples/naip-mosaic/src/App.tsx\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n markRaw,\n toRaw,\n } from 'vue';\n import type { Color, PickingInfo } from '@deck.gl/core';\n import type { GeoTIFF, Overview } from '@developmentseed/geotiff';\n import type { Texture } from '@luma.gl/core';\n import type { RasterModule } from '@developmentseed/deck.gl-raster';\n import type { ShaderModule } from '@luma.gl/shadertools';\n import type {\n COGLayerProps,\n GetTileDataOptions,\n MosaicLayerProps,\n MosaicSource as BaseMosaicSource,\n } from '@developmentseed/deck.gl-geotiff';\n import type { EpsgResolver } from '@developmentseed/proj';\n import { injectStrict, MapKey, requirePeer } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n const MOSAIC_PEER_INSTALL =\n 'pnpm add @deck.gl/core @deck.gl/layers @deck.gl/mapbox @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj';\n\n /**\n * A STAC-like item with bounding box and COG asset URL\n * Extends the base MosaicSource from deck.gl-geotiff with asset info\n */\n export interface MosaicSource extends BaseMosaicSource {\n /** Asset containing the COG URL */\n assets: {\n image: { href: string };\n };\n }\n\n /**\n * Render mode for the mosaic layer\n */\n export type MosaicRenderMode = 'trueColor' | 'falseColor' | 'ndvi' | 'custom';\n\n /**\n * Custom render module for advanced band manipulation\n */\n export interface RenderModule {\n module: { name: string; inject?: Record<string, string> };\n props?: Record<string, unknown>;\n }\n\n interface Props {\n id: string;\n /**\n * Array of STAC-like items with bbox and COG asset URLs\n */\n sources: MosaicSource[];\n /**\n * Render mode: trueColor (RGB), falseColor (NIR-R-G), ndvi (with colormap)\n */\n renderMode?: MosaicRenderMode;\n /**\n * Custom render modules (only used when renderMode is 'custom')\n */\n customRenderModules?: (texture: Texture) => RenderModule[];\n /**\n * Custom colormap data for NDVI (Uint8ClampedArray of RGBA values, 256 colors)\n * @reserved Currently not implemented - NDVI uses built-in cfastie colormap.\n */\n colormapData?: Uint8ClampedArray;\n /**\n * Maximum number of tiles to cache\n */\n maxCacheSize?: number;\n /**\n * Layer opacity (0-1)\n */\n opacity?: number;\n /**\n * Layer visibility\n */\n visible?: boolean;\n /**\n * Enable picking on this layer\n */\n pickable?: boolean;\n /**\n * Auto highlight on hover\n */\n autoHighlight?: boolean;\n /**\n * Highlight color when autoHighlight is enabled\n */\n highlightColor?: Color;\n /**\n * NDVI range filter: pixels outside [min, max] are discarded.\n * Only applies when renderMode is 'ndvi'. Range: [-1, 1].\n */\n ndviRange?: [number, number];\n /**\n * Insert layer before this layer id\n */\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n renderMode: 'trueColor',\n maxCacheSize: Infinity,\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n ndviRange: () => [-1, 1] as [number, number],\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n sourceLoad: [source: MosaicSource];\n error: [error: Error, source?: MosaicSource];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer } = useDeckOverlay(map);\n let activeLayerId = '';\n\n interface TextureData {\n texture: Texture;\n width: number;\n height: number;\n }\n\n interface LoadedModules {\n MosaicLayer: typeof import('@developmentseed/deck.gl-geotiff').MosaicLayer;\n COGLayer: typeof import('@developmentseed/deck.gl-geotiff').COGLayer;\n CreateTexture: RasterModule['module'];\n fromUrl: typeof GeoTIFF.fromUrl;\n resolveEpsg: EpsgResolver;\n }\n\n const modules = shallowRef<LoadedModules | null>(null);\n\n // Shader modules for different render modes\n const SetAlpha1 = {\n name: 'set-alpha-1',\n inject: { 'fs:DECKGL_FILTER_COLOR': `color = vec4(color.rgb, 1.0);` },\n };\n\n const FalseColorInfrared = {\n name: 'false-color-infrared',\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n float nir = color[3];\n float red = color[0];\n float green = color[1];\n color.rgb = vec3(nir, red, green);\n `,\n },\n };\n\n // --- NDVI Pipeline: 3 separate modules matching upstream pattern ---\n // Uniforms update per-draw via MeshTextureLayer.draw() → setProps() without\n // re-rendering tiles. Baked constants don't work because renderTile only runs\n // when tiles are FIRST FETCHED — cached tiles keep old shader modules.\n\n // Step 1: Compute NDVI from raw RGBA bands, store in color.r\n const NDVICompute = {\n name: 'ndvi-compute',\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n float nir_c = color[3];\n float red_c = color[0];\n float sum_c = nir_c + red_c;\n float ndvi_c = sum_c > 0.001 ? (nir_c - red_c) / sum_c : 0.0;\n color = vec4(ndvi_c, ndvi_c, ndvi_c, 1.0);\n `,\n },\n };\n\n // Step 2: Filter by NDVI range — uniforms update per-draw without tile re-render\n const ndviFilterUniformBlock = `\\\nuniform ndviFilterUniforms {\n float ndviMin;\n float ndviMax;\n} ndviFilter;\n`;\n\n const NDVIFilter = {\n name: 'ndviFilter',\n fs: ndviFilterUniformBlock,\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n if (color.r < ndviFilter.ndviMin || color.r > ndviFilter.ndviMax) {\n discard;\n }\n `,\n },\n uniformTypes: {\n ndviMin: 'f32',\n ndviMax: 'f32',\n },\n getUniforms: (uniformProps: Record<string, unknown>) => ({\n ndviMin: (uniformProps.ndviMin as number) ?? -1.0,\n ndviMax: (uniformProps.ndviMax as number) ?? 1.0,\n }),\n } as const satisfies ShaderModule<{ ndviMin: number; ndviMax: number }>;\n\n // Step 3: Apply cfastie-inspired colormap gradient from color.r (NDVI value)\n const NDVIColormap = {\n name: 'ndvi-colormap',\n inject: {\n 'fs:DECKGL_FILTER_COLOR': `\n float t = clamp((color.r + 1.0) / 2.0, 0.0, 1.0);\n \n vec3 result;\n if (t < 0.4) {\n float localT = t / 0.4;\n result = mix(vec3(0.0, 0.0, 0.5), vec3(0.5, 0.8, 0.9), localT);\n } else if (t < 0.5) {\n float localT = (t - 0.4) / 0.1;\n result = mix(vec3(0.5, 0.8, 0.9), vec3(0.9, 0.9, 0.4), localT);\n } else if (t < 0.6) {\n float localT = (t - 0.5) / 0.1;\n result = mix(vec3(0.9, 0.9, 0.4), vec3(0.6, 0.8, 0.2), localT);\n } else if (t < 0.75) {\n float localT = (t - 0.6) / 0.15;\n result = mix(vec3(0.6, 0.8, 0.2), vec3(0.1, 0.6, 0.1), localT);\n } else {\n float localT = (t - 0.75) / 0.25;\n result = mix(vec3(0.1, 0.6, 0.1), vec3(0.0, 0.3, 0.0), localT);\n }\n \n color.rgb = result;\n `,\n },\n };\n\n function getRenderModules(\n mode: MosaicRenderMode,\n texture: Texture,\n mods: {\n CreateTexture: RasterModule['module'];\n },\n ndviRange: [number, number],\n customModules?: (texture: Texture) => RenderModule[],\n ): RasterModule[] {\n if (mode === 'custom' && customModules) {\n return customModules(texture) as RasterModule[];\n }\n\n const base: RasterModule[] = [\n { module: mods.CreateTexture, props: { textureName: texture } },\n ];\n\n if (mode === 'trueColor') {\n return [...base, { module: SetAlpha1 }];\n }\n\n if (mode === 'falseColor') {\n return [...base, { module: FalseColorInfrared }, { module: SetAlpha1 }];\n }\n\n // NDVI pipeline: compute → filter → colormap → alpha\n // NDVIFilter uses uniformTypes + getUniforms so uniform values update\n // per-draw via MeshTextureLayer.draw() WITHOUT re-rendering tiles.\n return [\n ...base,\n { module: NDVICompute },\n {\n module: NDVIFilter,\n props: { ndviMin: ndviRange[0], ndviMax: ndviRange[1] },\n },\n { module: NDVIColormap },\n { module: SetAlpha1 },\n ];\n }\n\n function createLayer() {\n const mods = modules.value;\n if (!mods || !props.sources.length) return null;\n\n const { MosaicLayer, COGLayer, CreateTexture, fromUrl, resolveEpsg } = mods;\n\n const rawSources = toRaw(props.sources);\n const renderMode = toRaw(props.renderMode);\n const ndviRange = toRaw(props.ndviRange) as [number, number];\n const customRenderModules = props.customRenderModules;\n\n // Fixed ID matching upstream pattern — deck.gl diffs old vs new layer\n // via setProps, detecting changed renderSource/renderTile callbacks.\n const newId = `${toRaw(props.id)}-mosaic`;\n const layer = new MosaicLayer<MosaicSource, GeoTIFF>({\n id: newId,\n sources: rawSources,\n maxCacheSize: toRaw(props.maxCacheSize),\n\n getSource: async (source) => {\n try {\n const tiff = await fromUrl(source.assets.image.href);\n emit('sourceLoad', source);\n return tiff;\n } catch (error) {\n emit('error', error as Error, source);\n throw error;\n }\n },\n\n renderSource: (source, { data, signal }) => {\n if (!data) return null;\n\n return new COGLayer<TextureData>({\n id: `cog-${source.assets.image.href}-${renderMode}`,\n geotiff: data,\n epsgResolver: resolveEpsg,\n getTileData: async (\n image: GeoTIFF | Overview,\n options: GetTileDataOptions,\n ) => {\n const { device, x, y } = options;\n const tile = await image.fetchTile(x, y, {\n signal,\n boundless: false,\n });\n const { array } = tile;\n if (array.layout === 'band-separate') {\n throw new Error('Band-separate COGs are not supported');\n }\n const texture = device.createTexture({\n data: array.data,\n format: 'rgba8unorm',\n width: array.width,\n height: array.height,\n });\n return {\n texture,\n width: array.width,\n height: array.height,\n };\n },\n renderTile: (tileData: TextureData) => ({\n image: tileData.texture,\n renderPipeline: getRenderModules(\n renderMode,\n tileData.texture,\n { CreateTexture },\n ndviRange,\n customRenderModules,\n ),\n }),\n signal,\n } as COGLayerProps<TextureData>);\n },\n } as MosaicLayerProps<MosaicSource, GeoTIFF>);\n\n return layer;\n }\n\n async function initializeLayer() {\n try {\n const [geotiffModule, rasterModule, devGeotiff, projModule] =\n await Promise.all([\n requirePeer(\n '@developmentseed/deck.gl-geotiff',\n () => import('@developmentseed/deck.gl-geotiff'),\n MOSAIC_PEER_INSTALL,\n ),\n requirePeer(\n '@developmentseed/deck.gl-raster',\n () => import('@developmentseed/deck.gl-raster/gpu-modules'),\n MOSAIC_PEER_INSTALL,\n ),\n requirePeer(\n '@developmentseed/geotiff',\n () => import('@developmentseed/geotiff'),\n MOSAIC_PEER_INSTALL,\n ),\n requirePeer(\n '@developmentseed/proj',\n () => import('@developmentseed/proj'),\n MOSAIC_PEER_INSTALL,\n ),\n ]);\n\n modules.value = markRaw({\n MosaicLayer: geotiffModule.MosaicLayer,\n COGLayer: geotiffModule.COGLayer,\n CreateTexture: rasterModule.CreateTexture,\n fromUrl: devGeotiff.GeoTIFF.fromUrl,\n resolveEpsg: projModule.epsgResolver,\n });\n\n const layer = createLayer();\n if (layer) {\n activeLayerId = (layer as { id: string }).id;\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-mosaic] Error loading MosaicLayer:', error);\n console.error(\n 'Make sure @developmentseed/deck.gl-geotiff, @developmentseed/deck.gl-raster, and @developmentseed/geotiff are installed',\n );\n emit('error', error as Error);\n }\n }\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.sources,\n props.renderMode,\n props.ndviRange,\n props.opacity,\n props.visible,\n ],\n () => {\n if (modules.value) {\n const layer = createLayer();\n if (layer) {\n activeLayerId = (layer as { id: string }).id;\n addLayer(layer);\n }\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n if (activeLayerId) {\n removeLayer(activeLayerId);\n }\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Multi-band split-resolution COG compositor (e.g. Sentinel-2 band combinations).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@deck.gl/layers`\n * @requires `@developmentseed/deck.gl-geotiff`\n * @requires `@developmentseed/deck.gl-raster`\n * @requires `@developmentseed/geotiff`\n * @requires `@developmentseed/proj`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @deck.gl/layers @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj`\n */\n /**\n * VLayerDeckglMultiCOG — multi-band split-resolution COG compositing.\n *\n * Wraps @developmentseed/deck.gl-geotiff MultiCOGLayer.\n * Use case: render Sentinel-2 or other multi-band imagery where bands live in\n * separate COGs at different native resolutions. The layer opens all sources\n * in parallel, picks the finest as the primary tileset, and the GPU\n * resamples lower-resolution bands to match.\n *\n * @see https://github.com/developmentseed/deck.gl-raster/blob/main/examples/sentinel-2/src/App.tsx\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n markRaw,\n toRaw,\n } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import type { RasterModule } from '@developmentseed/deck.gl-raster';\n import type { MultiCOGSourceConfig } from '@developmentseed/deck.gl-geotiff';\n import type { GeoTIFF } from '@developmentseed/geotiff';\n import { injectStrict, MapKey, requirePeer } from '../../../utils';\n\n const MULTICOG_PEER_INSTALL =\n 'pnpm add @deck.gl/core @deck.gl/layers @deck.gl/mapbox @developmentseed/deck.gl-geotiff @developmentseed/deck.gl-raster @developmentseed/geotiff @developmentseed/proj';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n /**\n * Maps source band names to RGB(A) output channels for the compositing step.\n */\n export interface MultiCOGComposite {\n r: string;\n g?: string;\n b?: string;\n a?: string;\n }\n\n interface Props {\n id: string;\n /**\n * Named sources — each key is the band name. Pass at least one entry per\n * band referenced in `composite`.\n */\n sources: Record<string, MultiCOGSourceConfig>;\n /**\n * Map source band names to RGB(A) output channels. Defaults to passing\n * the first source through to all channels (greyscale) if omitted.\n */\n composite?: MultiCOGComposite;\n /**\n * Post-processing render pipeline modules applied after band compositing\n * (e.g. LinearRescale, ColormapSprite, NDVI).\n */\n renderPipeline?: RasterModule[];\n /** Max reprojection error in pixels for mesh refinement. */\n maxError?: number;\n /** Maximum number of tiles to cache. */\n maxCacheSize?: number;\n /** Maximum cached tile byte size. */\n maxCacheByteSize?: number;\n /** Maximum concurrent tile requests. */\n maxRequests?: number;\n /** Tile fetch debounce (ms). */\n debounceTime?: number;\n /** Tile refinement strategy. */\n refinementStrategy?: 'best-available' | 'no-overlap' | 'never';\n /** Layer opacity (0-1). */\n opacity?: number;\n /** Layer visibility. */\n visible?: boolean;\n /** Enable picking. */\n pickable?: boolean;\n /** Auto-highlight on hover. */\n autoHighlight?: boolean;\n /** Insert layer before this layer id. */\n beforeId?: string;\n /** Show debug overlay on tiles. */\n debug?: boolean;\n /** Debug overlay opacity (0-1). */\n debugOpacity?: number;\n /** Debug verbosity: 1=coords, 2=+uv/tiles, 3=+stitched-size/meters/px. */\n debugLevel?: 1 | 2 | 3;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n maxError: 0.125,\n maxRequests: 6,\n refinementStrategy: 'best-available',\n opacity: 1,\n visible: true,\n pickable: false,\n autoHighlight: false,\n debug: false,\n debugOpacity: 0.5,\n debugLevel: 1,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n geotiffLoad: [\n sources: Map<string, GeoTIFF>,\n options: {\n primaryKey: string;\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const MultiCOGLayerClass = shallowRef<\n typeof import('@developmentseed/deck.gl-geotiff').MultiCOGLayer | null\n >(null);\n const epsgResolverFn = shallowRef<\n typeof import('@developmentseed/proj').epsgResolver | null\n >(null);\n\n const createLayer = () => {\n if (!MultiCOGLayerClass.value) return null;\n\n const layerProps: Record<string, unknown> = {\n id: toRaw(props.id),\n sources: toRaw(props.sources),\n opacity: toRaw(props.opacity),\n visible: toRaw(props.visible),\n pickable: toRaw(props.pickable),\n autoHighlight: toRaw(props.autoHighlight),\n debug: toRaw(props.debug),\n debugOpacity: toRaw(props.debugOpacity),\n debugLevel: toRaw(props.debugLevel),\n maxError: toRaw(props.maxError),\n };\n\n if (epsgResolverFn.value) {\n layerProps.epsgResolver = epsgResolverFn.value;\n }\n\n if (props.composite) {\n layerProps.composite = toRaw(props.composite);\n }\n if (props.renderPipeline) {\n layerProps.renderPipeline = toRaw(props.renderPipeline);\n }\n if (props.maxCacheSize !== undefined)\n layerProps.maxCacheSize = toRaw(props.maxCacheSize);\n if (props.maxCacheByteSize !== undefined)\n layerProps.maxCacheByteSize = toRaw(props.maxCacheByteSize);\n if (props.maxRequests !== 6)\n layerProps.maxRequests = toRaw(props.maxRequests);\n if (props.debounceTime !== undefined)\n layerProps.debounceTime = toRaw(props.debounceTime);\n if (props.refinementStrategy !== 'best-available')\n layerProps.refinementStrategy = toRaw(props.refinementStrategy);\n if (props.beforeId !== undefined)\n layerProps.beforeId = toRaw(props.beforeId);\n\n layerProps.onGeoTIFFLoad = (\n sources: Map<string, GeoTIFF>,\n options: {\n primaryKey: string;\n geographicBounds: {\n west: number;\n south: number;\n east: number;\n north: number;\n };\n },\n ) => {\n emit('geotiffLoad', sources, options);\n };\n\n const layer = new MultiCOGLayerClass.value(layerProps);\n return markRaw(layer);\n };\n\n const initializeLayer = async () => {\n try {\n const [geotiffModule, projModule] = await Promise.all([\n requirePeer(\n '@developmentseed/deck.gl-geotiff',\n () => import('@developmentseed/deck.gl-geotiff'),\n MULTICOG_PEER_INSTALL,\n ),\n requirePeer(\n '@developmentseed/proj',\n () => import('@developmentseed/proj'),\n MULTICOG_PEER_INSTALL,\n ),\n ]);\n\n MultiCOGLayerClass.value = markRaw(geotiffModule.MultiCOGLayer);\n epsgResolverFn.value = projModule.epsgResolver;\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-raster] Error loading MultiCOGLayer:', error);\n console.error(\n 'Make sure @developmentseed/deck.gl-geotiff and @developmentseed/proj are installed',\n );\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.sources,\n props.composite,\n props.renderPipeline,\n props.opacity,\n props.visible,\n props.debug,\n props.debugOpacity,\n props.debugLevel,\n props.maxError,\n ],\n () => {\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * GeoZarr tile renderer with optional reprojection (caller supplies the store).\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `@developmentseed/deck.gl-raster`\n * @requires `@developmentseed/deck.gl-zarr`\n * @requires `@developmentseed/proj`\n * @requires `zarrita`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox @developmentseed/deck.gl-raster @developmentseed/deck.gl-zarr @developmentseed/proj zarrita`\n */\n /**\n * VLayerDeckglZarr — GeoZarr tile rendering with reprojection.\n *\n * Wraps @developmentseed/deck.gl-zarr ZarrLayer.\n * The caller MUST open the zarr store with zarrita and pass the opened\n * Array/Group as `node`, plus `selection` for non-spatial dims, plus\n * `getTileData` + `renderTile` callbacks. This wrapper is intentionally\n * thin — ZarrLayer is data-format / shader-pipeline agnostic by design.\n *\n * @see https://github.com/developmentseed/deck.gl-raster/blob/main/examples/dynamical-zarr-ecmwf/src/App.tsx\n */\n import {\n onMounted,\n onBeforeUnmount,\n watch,\n shallowRef,\n markRaw,\n toRaw,\n } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import type {\n MinimalTileData,\n RenderTileResult,\n } from '@developmentseed/deck.gl-raster';\n import type {\n GetTileDataOptions,\n SliceInput,\n } from '@developmentseed/deck.gl-zarr';\n import type * as zarr from 'zarrita';\n import { injectStrict, MapKey, requirePeer } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n const ZARR_PEER_INSTALL =\n 'pnpm add @deck.gl/core @deck.gl/layers @deck.gl/mapbox @developmentseed/deck.gl-raster @developmentseed/deck.gl-zarr @developmentseed/proj zarrita';\n\n interface Props {\n id: string;\n /**\n * Pre-opened zarrita Array OR Group. The caller builds the store\n * (e.g. zarr.FetchStore + withConsolidatedMetadata) and opens it.\n */\n node: zarr.Array<zarr.DataType, zarr.Readable> | zarr.Group<zarr.Readable>;\n /**\n * Optional path to a variable within the store. Only used when `node`\n * is a Group. Ignored for direct Array nodes.\n */\n variable?: string;\n /**\n * Selection for non-spatial dims. One entry per non-spatial dim.\n * Use a number to pin to an index, `zarr.Slice` for a range, or `null`\n * for zarrita's default. For pure spatial arrays, pass `{}`.\n */\n selection: Record<string, SliceInput>;\n /**\n * Optional raw group attrs override. Use when the data source lacks\n * GeoZarr metadata and you want to inject it.\n */\n metadata?: unknown;\n /**\n * Tile fetcher. Receives the zarr Array for the chosen zoom level and\n * a pre-built sliceSpec. Must return a tile-shaped `DataT`.\n */\n getTileData: (\n arr: zarr.Array<zarr.DataType, zarr.Readable>,\n options: GetTileDataOptions,\n ) => Promise<MinimalTileData>;\n /**\n * Convert a loaded tile into a `RenderTileResult` (either `{ image }`\n * or `{ renderPipeline }`).\n */\n renderTile: (data: MinimalTileData) => RenderTileResult;\n /** Layer opacity (0-1). */\n opacity?: number;\n /** Layer visibility. */\n visible?: boolean;\n /** Enable picking. */\n pickable?: boolean;\n /** Insert layer before this layer id. */\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n opacity: 1,\n visible: true,\n pickable: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const ZarrLayerClass = shallowRef<\n typeof import('@developmentseed/deck.gl-zarr').ZarrLayer | null\n >(null);\n const epsgResolverFn = shallowRef<\n typeof import('@developmentseed/proj').epsgResolver | null\n >(null);\n\n const createLayer = () => {\n if (!ZarrLayerClass.value) return null;\n\n const layerProps: Record<string, unknown> = {\n id: toRaw(props.id),\n node: toRaw(props.node),\n selection: toRaw(props.selection),\n getTileData: props.getTileData,\n renderTile: props.renderTile,\n opacity: toRaw(props.opacity),\n visible: toRaw(props.visible),\n pickable: toRaw(props.pickable),\n };\n\n if (epsgResolverFn.value) {\n layerProps.epsgResolver = epsgResolverFn.value;\n }\n if (props.variable !== undefined) {\n layerProps.variable = toRaw(props.variable);\n }\n if (props.metadata !== undefined) {\n layerProps.metadata = toRaw(props.metadata);\n }\n if (props.beforeId !== undefined) {\n layerProps.beforeId = toRaw(props.beforeId);\n }\n\n const layer = new ZarrLayerClass.value(layerProps);\n return markRaw(layer);\n };\n\n const initializeLayer = async () => {\n try {\n const [zarrModule, projModule] = await Promise.all([\n requirePeer(\n '@developmentseed/deck.gl-zarr',\n () => import('@developmentseed/deck.gl-zarr'),\n ZARR_PEER_INSTALL,\n ),\n requirePeer(\n '@developmentseed/proj',\n () => import('@developmentseed/proj'),\n ZARR_PEER_INSTALL,\n ),\n ]);\n\n ZarrLayerClass.value = markRaw(zarrModule.ZarrLayer);\n epsgResolverFn.value = projModule.epsgResolver;\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n }\n } catch (error) {\n console.error('[deck.gl-raster] Error loading ZarrLayer:', error);\n console.error(\n 'Make sure @developmentseed/deck.gl-zarr, @developmentseed/proj, and zarrita are installed',\n );\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => [\n props.node,\n props.variable,\n props.selection,\n props.metadata,\n props.opacity,\n props.visible,\n ],\n () => {\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * GPU-animated wind/current particle field on top of a vector field texture.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n * @requires `maplibre-gl-wind`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox maplibre-gl-wind`\n */\n import { ref, computed, onMounted, onBeforeUnmount, watch } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n import { WindParticleLayer, generateWindTexture } from 'maplibre-gl-wind';\n import type { ColorStop, WindDataPoint } from 'maplibre-gl-wind';\n import type { Color } from '../_shared/types';\n\n interface Props {\n id: string;\n imageUrl?: string;\n windData?: WindDataPoint[];\n bounds?: [number, number, number, number];\n uMin?: number;\n uMax?: number;\n vMin?: number;\n vMax?: number;\n numParticles?: number;\n maxAge?: number;\n speedFactor?: number;\n color?: Color;\n colorRamp?: ColorStop[];\n speedRange?: [number, number];\n width?: number;\n animate?: boolean;\n opacity?: number;\n visible?: boolean;\n pickable?: boolean;\n beforeId?: string;\n }\n\n const props = withDefaults(defineProps<Props>(), {\n bounds: () => [-180, -90, 180, 90],\n uMin: -50,\n uMax: 50,\n vMin: -50,\n vMax: 50,\n numParticles: 8192,\n maxAge: 30,\n speedFactor: 50,\n color: () => [255, 255, 255, 200] as Color,\n colorRamp: () =>\n [\n [0.0, [59, 130, 189, 255]],\n [0.1, [102, 194, 165, 255]],\n [0.2, [171, 221, 164, 255]],\n [0.3, [230, 245, 152, 255]],\n [0.4, [254, 224, 139, 255]],\n [0.5, [253, 174, 97, 255]],\n [0.6, [244, 109, 67, 255]],\n [1.0, [213, 62, 79, 255]],\n ] as ColorStop[],\n speedRange: () => [0, 30],\n width: 1.5,\n animate: true,\n opacity: 1,\n visible: true,\n pickable: false,\n });\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n loaded: [];\n error: [error: Error];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const isLayerAdded = ref(false);\n const currentImageUrl = ref<string | null>(null);\n const windMetadata = ref({\n uMin: props.uMin,\n uMax: props.uMax,\n vMin: props.vMin,\n vMax: props.vMax,\n });\n\n const imageUnscale = computed(() => {\n const uRange = windMetadata.value.uMax - windMetadata.value.uMin;\n const vRange = windMetadata.value.vMax - windMetadata.value.vMin;\n return [Math.min(uRange, vRange) * -1, Math.max(uRange, vRange)];\n });\n\n const createLayer = () => {\n if (!currentImageUrl.value) return null;\n\n return new WindParticleLayer({\n id: props.id,\n image: currentImageUrl.value,\n bounds: props.bounds,\n imageUnscale: imageUnscale.value,\n numParticles: props.numParticles,\n maxAge: props.maxAge,\n speedFactor: props.speedFactor,\n color: props.color,\n colorRamp: props.colorRamp,\n speedRange: props.speedRange,\n width: props.width,\n animate: props.animate,\n wrapLongitude: true,\n opacity: props.opacity,\n visible: props.visible,\n pickable: props.pickable,\n beforeId: props.beforeId,\n onClick: (info: PickingInfo) => emit('click', info),\n onHover: (info: PickingInfo) => emit('hover', info),\n });\n };\n\n const processWindData = (data: WindDataPoint[]) => {\n try {\n const result = generateWindTexture(data, {\n width: 360,\n height: 180,\n bounds: props.bounds,\n });\n\n windMetadata.value = {\n uMin: result.uMin,\n uMax: result.uMax,\n vMin: result.vMin,\n vMax: result.vMax,\n };\n\n currentImageUrl.value = result.canvas.toDataURL('image/png');\n return true;\n } catch (err) {\n emit('error', err instanceof Error ? err : new Error(String(err)));\n return false;\n }\n };\n\n const initializeLayer = () => {\n if (props.windData && props.windData.length > 0) {\n if (!processWindData(props.windData)) return;\n } else if (props.imageUrl) {\n currentImageUrl.value = props.imageUrl;\n windMetadata.value = {\n uMin: props.uMin,\n uMax: props.uMax,\n vMin: props.vMin,\n vMax: props.vMax,\n };\n } else {\n return;\n }\n\n const layer = createLayer();\n if (layer) {\n addLayer(layer);\n isLayerAdded.value = true;\n emit('loaded');\n }\n };\n\n const updateWindLayer = () => {\n if (!isLayerAdded.value) return;\n\n const layer = createLayer();\n if (layer) {\n updateLayer(props.id, layer);\n }\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => props.windData,\n (newData) => {\n if (newData && newData.length > 0) {\n if (processWindData(newData)) {\n updateWindLayer();\n }\n }\n },\n { deep: true },\n );\n\n watch(\n () => props.imageUrl,\n (newUrl) => {\n if (newUrl && !props.windData) {\n currentImageUrl.value = newUrl;\n windMetadata.value = {\n uMin: props.uMin,\n uMax: props.uMax,\n vMin: props.vMin,\n vMax: props.vMax,\n };\n updateWindLayer();\n }\n },\n );\n\n watch(\n () => [\n props.numParticles,\n props.maxAge,\n props.speedFactor,\n props.color,\n props.colorRamp,\n props.speedRange,\n props.width,\n props.animate,\n props.opacity,\n props.visible,\n ],\n () => {\n updateWindLayer();\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(props.id);\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n /**\n * Generic deck.gl layer wrapper — supply your own deck.gl Layer instance via the `layer` prop.\n *\n * @requires `@deck.gl/core`\n * @requires `@deck.gl/mapbox`\n *\n * Install with:\n * `pnpm add @deck.gl/core @deck.gl/mapbox`\n */\n import { onMounted, onBeforeUnmount, watch } from 'vue';\n import type { PickingInfo } from '@deck.gl/core';\n import { injectStrict, MapKey } from '../../../utils';\n import { useDeckOverlay } from '../_shared/useDeckOverlay';\n\n interface Props {\n layer: unknown;\n }\n\n const props = defineProps<Props>();\n\n const emit = defineEmits<{\n click: [info: PickingInfo];\n hover: [info: PickingInfo];\n }>();\n\n const map = injectStrict(MapKey);\n const { addLayer, removeLayer, updateLayer } = useDeckOverlay(map);\n\n const getLayerId = (layer: unknown): string => {\n return (layer as { id: string }).id;\n };\n\n const initializeLayer = () => {\n addLayer(props.layer);\n };\n\n onMounted(() => {\n if (map.value?.isStyleLoaded()) {\n initializeLayer();\n } else {\n map.value?.once('style.load', initializeLayer);\n }\n });\n\n watch(\n () => props.layer,\n (newLayer, oldLayer) => {\n const oldId = oldLayer ? getLayerId(oldLayer) : null;\n const newId = getLayerId(newLayer);\n\n if (oldId && oldId !== newId) {\n removeLayer(oldId);\n addLayer(newLayer);\n } else {\n updateLayer(newId, newLayer);\n }\n },\n { deep: true },\n );\n\n onBeforeUnmount(() => {\n removeLayer(getLayerId(props.layer));\n });\n</script>\n\n<template>\n <slot></slot>\n</template>\n","<script setup lang=\"ts\">\n import maplibregl, { Map } from 'maplibre-gl';\n import { Protocol } from 'pmtiles';\n import { onMounted, provide, ref, shallowRef } from 'vue';\n import type { MapOptions, MapEventType } from 'maplibre-gl';\n import type { Ref } from 'vue';\n import { mapEvents } from '../constants/events';\n import { MapKey, PMTileProtocolKey } from '../utils/symbols';\n import { useDeckOverlay } from '../layers/deckgl/_shared/useDeckOverlay';\n\n const props = withDefaults(\n defineProps<{\n options: MapOptions;\n supportPmtiles?: boolean;\n }>(),\n {\n options: () => ({ container: 'map' }) as MapOptions,\n supportPmtiles: false,\n },\n );\n const emit = defineEmits(['loaded', ...mapEvents]);\n\n if (props.supportPmtiles) {\n const protocol = new Protocol({ metadata: true });\n maplibregl.addProtocol('pmtiles', protocol.tile);\n provide(PMTileProtocolKey, protocol);\n }\n\n const map: Ref<Map | null> = shallowRef(null); // Initialize as null\n const loaded: Ref<boolean> = ref(false);\n const events: Ref<Array<keyof MapEventType>> = ref(mapEvents);\n\n // Provide the map reference immediately\n provide(MapKey, map);\n\n // Initialize deck.gl overlay at VMap level so all children can access it\n // This provides DeckOverlayKey and DeckLayersKey to all descendants\n useDeckOverlay(map);\n\n onMounted(() => {\n map.value = new Map(props.options);\n loaded.value = true;\n listenMapEvents();\n });\n\n const listenMapEvents = () => {\n if (!map.value) return;\n\n events.value.forEach((e) => {\n map.value?.on(e, (evt) => {\n switch (e) {\n case 'load':\n emit('loaded', map.value);\n break;\n default:\n emit(e, evt);\n break;\n }\n });\n });\n };\n</script>\n\n<template>\n <div :id=\"`${options?.container}`\" class=\"v-map-container\">\n <slot v-if=\"loaded\">\n <slot></slot>\n </slot>\n </div>\n</template>\n\n<style scoped>\n canvas {\n outline: none;\n }\n\n .v-map-container {\n width: 100%;\n height: 100%;\n }\n</style>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { ref, onMounted, onBeforeUnmount, watch } from 'vue';\n import type { LngLatLike, Marker, PopupOptions, Map } from 'maplibre-gl';\n import { Popup } from 'maplibre-gl';\n import { popupEvents } from '../constants/events';\n import { injectStrict, MapKey } from '../utils';\n\n const props = withDefaults(\n defineProps<{\n options: PopupOptions;\n coordinates: LngLatLike;\n marker?: Marker;\n }>(),\n {\n options: () => ({}) as PopupOptions,\n coordinates: () => ({}) as LngLatLike,\n marker: () => ({}) as Marker,\n },\n );\n\n const emit = defineEmits<{\n (e: 'added', payload: { popup: Popup }): void;\n (e: 'removed' | 'open' | 'close'): void;\n }>();\n\n const map = injectStrict(MapKey);\n const popup = new Popup(props.options);\n const loaded: Ref<boolean> = ref(true);\n const content = ref<HTMLElement | null>(null);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const setPopupContent = (): void => {\n try {\n if (content.value) {\n popup.setDOMContent(content.value);\n }\n } catch (error) {\n console.error('Error setting popup content:', error);\n }\n };\n\n const setPopupCoordinates = (): void => {\n try {\n popup.setLngLat(props.coordinates);\n } catch (error) {\n console.error('Error setting popup coordinates:', error);\n }\n };\n\n const addToMarker = (): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n if ('setPopup' in props.marker) {\n props.marker.setPopup(popup);\n } else {\n popup.addTo(mapInstance);\n }\n emit('added', { popup });\n } catch (error) {\n console.error('Error adding popup to marker:', error);\n }\n };\n\n const remove = (): void => {\n try {\n popup.remove();\n emit('removed');\n } catch (error) {\n console.error('Error removing popup:', error);\n }\n };\n\n const listenPopupEvents = (): void => {\n try {\n popupEvents.forEach((event) => {\n popup.on(event, () => {\n emit(event);\n });\n });\n } catch (error) {\n console.error('Error setting up popup events:', error);\n }\n };\n\n const removePopupEvents = (): void => {\n try {\n popupEvents.forEach((event) => {\n popup.off(event, () => {\n emit(event);\n });\n });\n } catch (error) {\n console.error('Error removing popup events:', error);\n }\n };\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n // Watch for coordinates changes\n watch(\n () => props.coordinates,\n () => {\n setPopupCoordinates();\n },\n { deep: true },\n );\n\n // Lifecycle hooks\n onMounted(() => {\n if (loaded.value) {\n try {\n setPopupContent();\n setPopupCoordinates();\n addToMarker();\n listenPopupEvents();\n } catch (error) {\n console.error('Error initializing popup:', error);\n }\n } else {\n remove();\n removePopupEvents();\n }\n });\n\n onBeforeUnmount(() => {\n remove();\n removePopupEvents();\n });\n</script>\n\n<template>\n <section :id=\"`popup-${Date.now()}`\" ref=\"content\">\n <slot></slot>\n </section>\n</template>\n","<script setup lang=\"ts\">\n import type { Ref } from 'vue';\n import { ref, watch, onMounted, onBeforeUnmount, useSlots } from 'vue';\n import type {\n LngLatLike,\n MarkerOptions,\n PopupOptions,\n Map,\n } from 'maplibre-gl';\n import { Marker } from 'maplibre-gl';\n import VPopup from '../popups/VPopup.vue';\n import { markerDOMEvents, markerMapEvents } from '../constants/events';\n import { injectStrict, MapKey } from '../utils';\n\n const slots = useSlots();\n\n const props = withDefaults(\n defineProps<{\n coordinates: LngLatLike;\n options?: MarkerOptions;\n popupOptions?: PopupOptions;\n cursor?: string;\n }>(),\n {\n options: () => ({}),\n popupOptions: () => ({}),\n cursor: 'pointer',\n },\n );\n\n const emit = defineEmits([\n 'added',\n 'update:coordinates',\n 'removed',\n ...markerMapEvents,\n ...markerDOMEvents,\n ]);\n\n const map = injectStrict(MapKey);\n const marker: Ref<Marker | null> = ref(null);\n const loaded = ref(true);\n const isMarkerAvailable = ref(false);\n const slotRef = ref<HTMLElement | null>(null);\n\n // Helper function to safely get map instance\n const getMapInstance = (): Map | null => {\n return map.value || null;\n };\n\n // Setup functions\n const setupMap = (mapInstance: Map) => {\n if (!mapInstance) return;\n\n mapInstance.on('style.load', () => {\n const styleTimeout = () => {\n if (!mapInstance.isStyleLoaded()) {\n loaded.value = false;\n setTimeout(styleTimeout, 200);\n } else {\n loaded.value = true;\n }\n };\n styleTimeout();\n });\n };\n\n const setSlotRef = (el: HTMLElement | Element | null) => {\n if (el instanceof HTMLElement) {\n slotRef.value = el;\n }\n };\n\n const setMarkerCoordinates = (markerInstance: Marker): void => {\n try {\n markerInstance.setLngLat(props.coordinates);\n } catch (error) {\n console.error('Error setting marker coordinates:', error);\n }\n };\n\n const setCursorPointer = (markerInstance: Marker): void => {\n try {\n markerInstance.getElement().style.cursor = props.cursor || 'default';\n } catch (error) {\n console.error('Error setting cursor:', error);\n }\n };\n\n const addToMap = (markerInstance: Marker): void => {\n const mapInstance = getMapInstance();\n if (!mapInstance) return;\n\n try {\n markerInstance.addTo(mapInstance);\n emit('added', { marker: markerInstance });\n } catch (error) {\n console.error('Error adding marker to map:', error);\n }\n };\n\n const removeFromMap = (markerInstance: Marker): void => {\n try {\n markerInstance.remove();\n emit('removed');\n } catch (error) {\n console.error('Error removing marker from map:', error);\n }\n };\n\n const listenMarkerEvents = (markerInstance: Marker): void => {\n try {\n let coordinates: LngLatLike;\n markerMapEvents.forEach((event: string) => {\n markerInstance.on(event, (e: { target: Marker }) => {\n if (event === 'dragend') {\n if (Array.isArray(props.coordinates)) {\n coordinates = [\n e.target.getLngLat().lng,\n e.target.getLngLat().lat,\n ];\n } else {\n coordinates = e.target.getLngLat();\n }\n emit('update:coordinates', coordinates);\n }\n emit(event, e);\n });\n });\n\n markerDOMEvents.forEach((event: string) => {\n markerInstance.getElement().addEventListener(event, (e) => {\n emit(event, e);\n });\n });\n } catch (error) {\n console.error('Error setting up marker events:', error);\n }\n };\n\n // Watchers\n watch(marker, (markerValue) => {\n isMarkerAvailable.value = markerValue !== null && '_map' in markerValue;\n });\n\n // Watch for map instance changes\n watch(\n map,\n (newMap) => {\n if (newMap) {\n setupMap(newMap);\n }\n },\n { immediate: true },\n );\n\n const initMarker = (element?: HTMLElement) => {\n if (!loaded.value || marker.value) return;\n\n try {\n const markerOptions: MarkerOptions = {\n ...props.options,\n element: element || undefined,\n };\n marker.value = new Marker(markerOptions);\n setMarkerCoordinates(marker.value);\n addToMap(marker.value);\n setCursorPointer(marker.value);\n listenMarkerEvents(marker.value);\n } catch (error) {\n console.error('Error initializing marker:', error);\n }\n };\n\n watch(slotRef, (el) => {\n if (el && !marker.value) {\n initMarker(el);\n }\n });\n\n onMounted(() => {\n const hasCustomElement = !!slots.markers;\n if (!hasCustomElement) {\n initMarker();\n }\n });\n\n onBeforeUnmount(() => {\n if (marker.value) {\n removeFromMap(marker.value);\n }\n });\n</script>\n\n<template>\n <section :id=\"`marker-${Date.now()}`\" class=\"absolute\">\n <slot :set-ref=\"setSlotRef\" name=\"markers\"></slot>\n <template v-if=\"isMarkerAvailable && $slots.default\">\n <v-popup\n :marker=\"marker!\"\n :options=\"popupOptions\"\n :coordinates=\"coordinates\"\n >\n <slot></slot>\n </v-popup>\n </template>\n </section>\n</template>\n\n<style>\n .absolute {\n position: absolute !important;\n }\n</style>\n","import {\n VControlAttribution,\n VControlFullscreen,\n VControlGeolocate,\n VControlNavigation,\n VControlScale,\n VControlLidar,\n VControlLayer,\n VControlLayerGroup,\n VControlLegend,\n} from './controls';\n\nimport {\n VLayerMaplibreCanvas,\n VLayerMaplibreGeojson,\n VLayerMaplibreCluster,\n VLayerMaplibreImage,\n VLayerMaplibreRaster,\n VLayerMaplibreVector,\n VLayerMaplibreVideo,\n VLayerMaplibrePmtile,\n VLayerMaplibreRoute,\n VLayerMaplibreIsochrone,\n VLayerMaplibreStarfield,\n} from './layers';\n\nimport VMap from './map/VMap.vue';\nimport VMarker from './markers/VMarker.vue';\nimport VPopup from './popups/VPopup.vue';\n\nexport { requirePeer } from './utils';\n\nexport {\n VMap,\n VMarker,\n VPopup,\n VLayerMaplibreCanvas,\n VLayerMaplibreGeojson,\n VLayerMaplibreCluster,\n VLayerMaplibreImage,\n VLayerMaplibreRaster,\n VLayerMaplibreVector,\n VLayerMaplibreVideo,\n VLayerMaplibrePmtile,\n VLayerMaplibreRoute,\n VLayerMaplibreIsochrone,\n VLayerMaplibreStarfield,\n VControlAttribution,\n VControlFullscreen,\n VControlGeolocate,\n VControlNavigation,\n VControlScale,\n VControlLidar,\n VControlLayer,\n VControlLayerGroup,\n VControlLegend,\n};\n\nexport type {\n LidarControlOptions,\n ColorScheme,\n ColorSchemeType,\n ColorSchemeConfig,\n CopcLoadingMode,\n ColormapName,\n ColorRangeConfig,\n PointCloudInfo,\n PointCloudBounds,\n StreamingProgress,\n StreamingLoaderOptions,\n LayerControlOptions,\n LayerType,\n ControlPosition,\n LayerConfig,\n LegendType,\n CategoryLegendItem,\n GradientLegendItem,\n SizeLegendItem,\n TableLegendItem,\n LegendControlOptions,\n FilterState,\n} from './controls';\n\nexport * from './layers/deckgl';\n\nexport default VMap;\n"],"mappings":"inDASA,SAAgB,EAAgB,EAAsB,EAAiB,CACrE,IAAM,EAAW,EAAO,EAAK,EAAS,CACtC,GAAI,CAAC,EACH,MAAU,MAAM,qBAAqB,EAAI,cAAc,CAEzD,OAAO,ECwBT,eAAsB,EACpB,EACA,EACA,EACY,CACZ,GAAI,CACF,OAAO,MAAM,GAAQ,OACd,EAAO,CACd,IAAM,EAAU,GAAkB,YAAY,IACxC,EAAS,aAAiB,MAAQ,EAAM,QAAU,OAAO,EAAM,CAC/D,EAAY,MAChB,yDAAyD,EAAY,sBAC/C,EAAQ,oBAAoB,IACnD,CAID,MAHI,aAAiB,OAAS,EAAM,QAClC,EAAM,MAAQ,GAAG,EAAM,QAAQ,eAAe,EAAM,SAEhD,GCxCV,MAAa,EACX,OAAO,cAAc,CAEV,EAKR,OAAO,aAAa,CAiBzB,SAAgB,EACd,EACA,EAAiC,EAAE,CACb,CACtB,GAAM,CAAE,cAAc,IAAU,EAE1B,EAAkB,EAAO,EAAgB,KAAK,CAC9C,EAAyB,EAAO,EAAe,KAAK,CAE1D,GAAI,GAAmB,EACrB,MAAO,CACL,QAAS,EACT,cAAe,EAAI,GAAK,CACxB,OAAQ,EAAI,EAAE,CAAC,CACf,gBAAmB,QAAQ,SAAS,CACpC,GAAG,EACJ,CAGH,IAAM,EAAU,EAAiC,KAAK,CAChD,EAAS,EAAe,EAAE,CAAC,CAC3B,EAAgB,EAAI,GAAM,CAC5B,EAAoC,KACpC,EAAoD,KAQxD,SAAS,EAAqB,EAAwB,CACpD,EAAgB,GAAqB,CACnC,GAAI,CAAC,EAAQ,MAAO,OACpB,IAAM,EAAO,EAAQ,MAAM,WAAW,CACpC,EAAG,EAAE,MAAM,EACX,EAAG,EAAE,MAAM,EACX,OAAQ,EACT,CAAC,CACF,GAAI,CAAC,GAAM,MAAO,OAGlB,IAAM,EADa,EAAK,MAA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