{"version":3,"file":"ngx-gaia-gis.mjs","sources":["../../../projects/gaia-gis/src/lib/interfaces/MapDesignsGaia.model.ts","../../../projects/gaia-gis/src/lib/gaia-gis/gaia-gis.service.ts","../../../projects/gaia-gis/src/lib/gaia-gis/gaia-gis.component.ts","../../../projects/gaia-gis/src/lib/gaia-gis/gaia-gis.component.html","../../../projects/gaia-gis/src/public-api.ts","../../../projects/gaia-gis/src/ngx-gaia-gis.ts"],"sourcesContent":["export enum MapsDesign {\n  CARTOCDN = 'https://{1-4}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png',\n  GNOSIS_EARTH = 'https://maps.gnosis.earth/ogcapi/collections/NaturalEarth:raster:HYP_HR_SR_OB_DR/map/tiles/WebMercatorQuad',\n  OSM = 'OSM',\n}\n","import {\n  Injectable,\n  signal,\n  computed,\n  linkedSignal,\n  inject,\n  PLATFORM_ID,\n} from '@angular/core';\nimport TileLayer from 'ol/layer/Tile';\nimport { XYZ } from 'ol/source';\nimport { transformExtent, fromLonLat, toLonLat } from 'ol/proj';\nimport { Feature, Map, View } from 'ol';\nimport { Style, Icon, Circle as CircleStyle, Fill, Stroke } from 'ol/style';\nimport { Point, Polygon } from 'ol/geom';\nimport VectorLayer from 'ol/layer/Vector';\nimport { FitOptions } from 'ol/View';\nimport 'ol/ol.css';\nimport VectorSource from 'ol/source/Vector';\nimport { MapsDesign, Option, PolygonGaia } from '../interfaces';\nimport OSM from 'ol/source/OSM';\nimport { jsPDF } from 'jspdf';\nimport Overlay from 'ol/Overlay';\nimport { PointGaia } from '../interfaces/PointGaia.model';\nimport Draw from 'ol/interaction/Draw';\nimport { unByKey } from 'ol/Observable';\nimport { isPlatformServer } from '@angular/common';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class GaiaGisService {\n  private readonly platform = inject(PLATFORM_ID);\n  private map!: Map;\n  private labels = new TileLayer({\n    source: new XYZ({\n      attributions:\n        'Gaia-GIS by © <a href=\"https://carto.com/attribution\">Olympus Analytics</a>',\n    }),\n  });\n  private rasterLayers: TileLayer[] = [];\n  private pointLayer!: VectorLayer<VectorSource>;\n  private popup!: Overlay;\n\n  // Polygon drawing properties\n  private polygonLayer!: VectorLayer<VectorSource>;\n  private drawInteraction: Draw | null = null;\n  private keyListener: any = null;\n\n  // Highlight layer for the starting point\n  private highlightLayer!: VectorLayer<VectorSource>;\n  private startPointFeature: Feature | null = null;\n\n  // 🔥 Angular 20 Signals for reactive state management\n\n  /**\n   * Signal to track if polygon drawing is active\n   */\n  public readonly isDrawingPolygon = signal<boolean>(false);\n\n  /**\n   * Signal to store the current polygon being drawn\n   */\n  public readonly currentPolygon = signal<PolygonGaia | null>(null);\n\n  /**\n   * Signal to store all completed polygons\n   */\n  public readonly completedPolygons = signal<PolygonGaia[]>([]);\n\n  /**\n   * Signal to track drawing mode state\n   */\n  public readonly drawingState = signal<\n    'idle' | 'drawing' | 'completing' | 'cancelled'\n  >('idle');\n\n  /**\n   * Computed signal for drawing status message\n   */\n  public readonly drawingStatus = computed(() => {\n    const state = this.drawingState();\n    const isDrawing = this.isDrawingPolygon();\n\n    switch (state) {\n      case 'idle':\n        return 'Ready to draw';\n      case 'drawing':\n        return 'Click to add vertices. Press Enter or click start point to complete.';\n      case 'completing':\n        return 'Polygon completed!';\n      case 'cancelled':\n        return 'Drawing cancelled';\n      default:\n        return 'Ready to draw';\n    }\n  });\n\n  /**\n   * Computed signal for polygon count\n   */\n  public readonly polygonCount = computed(\n    () => this.completedPolygons().length\n  );\n\n  // 🔥 Linked signal to handle auto-reset of drawing state\n  private readonly autoResetState = linkedSignal(() => {\n    const state = this.drawingState();\n\n    if (state === 'completing' || state === 'cancelled') {\n      console.log(`Drawing state changed: ${state}, auto-resetting in 2s`);\n      setTimeout(() => {\n        this.drawingState.set('idle');\n      }, 2000);\n    }\n\n    return state;\n  });\n\n  // 🔥 Linked signal to track polygon count changes\n  private readonly polygonLogger = linkedSignal(() => {\n    const polygons = this.completedPolygons();\n    const count = polygons.length;\n\n    if (count > 0) {\n      console.log(`Total polygons: ${count}`);\n      console.log('Latest polygon:', polygons[count - 1]);\n    }\n\n    return count;\n  });\n\n  // 🔥 Public computed signals that activate the linkedSignals by consuming them\n  public readonly stateStatus = computed(() => {\n    // This computed consumes the autoResetState linkedSignal, keeping it active\n    const state = this.autoResetState();\n    return `Current state: ${state}`;\n  });\n\n  public readonly polygonLogger$ = computed(() => {\n    // This computed consumes the polygonLogger linkedSignal, keeping it active\n    return this.polygonLogger();\n  });\n\n  constructor() {\n    if (isPlatformServer(this.platform)) return; // Skip initialization on server side\n    this.pointLayer = new VectorLayer({\n      source: new VectorSource(),\n    });\n\n    // 🔥 LinkedSignals will be activated when accessed by computeds\n\n    this.polygonLayer = new VectorLayer({\n      source: new VectorSource(),\n      style: new Style({\n        stroke: new Stroke({\n          color: '#ff0000',\n          width: 2,\n        }),\n        fill: new Fill({\n          color: 'rgba(255, 0, 0, 0.1)',\n        }),\n      }),\n    });\n\n    // Layer for highlighting the starting point\n    this.highlightLayer = new VectorLayer({\n      source: new VectorSource(),\n      style: new Style({\n        image: new CircleStyle({\n          radius: 8,\n          fill: new Fill({\n            color: 'rgba(0, 255, 0, 0.8)', // Bright green\n          }),\n          stroke: new Stroke({\n            color: '#00ff00',\n            width: 3,\n          }),\n        }),\n      }),\n      zIndex: 1000, // Ensure it's on top\n    });\n  }\n\n  /**\n   * Initializes the map with the specified target, center, zoom level, and design.\n   * @param {string} target - The target element ID for the map.\n   * @param {Object} options - Options for configuring the map.\n   * @param {[number, number]} [options.center=[0, 0]] - The initial center of the map.\n   * @param {number} [options.zoom=2] - The initial zoom level of the map.\n   * @param {string} [options.design=MapsDesign.CARTOCDN] - The design of the map.\n   */\n  initializeMap(target: string, options: Option = {}): void {\n    if (isPlatformServer(this.platform)) return; // Skip initialization on server side\n    const { center = [0, 0], zoom = 2, design = MapsDesign.CARTOCDN } = options;\n\n    let baseLayer: TileLayer;\n\n    if (\n      design.includes('{z}') &&\n      design.includes('{x}') &&\n      design.includes('{y}')\n    ) {\n      baseLayer = new TileLayer({\n        source: new XYZ({\n          url: design,\n          crossOrigin: 'anonymous',\n        }),\n      });\n    } else {\n      baseLayer = new TileLayer({\n        source: new OSM(),\n      });\n    }\n\n    this.labels = new TileLayer({\n      source: new XYZ({\n        url: 'https://{1-4}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png',\n        attributions:\n          'Gaia-GIS by © <a href=\"https://carto.com/attribution\">Olympus Analytics</a>',\n        crossOrigin: 'anonymous',\n      }),\n    });\n\n    this.map = new Map({\n      target: target,\n      layers: [\n        baseLayer,\n        this.pointLayer,\n        this.polygonLayer,\n        this.highlightLayer, // Add highlight layer on top\n      ],\n      view: new View({\n        center: fromLonLat(center),\n        zoom: zoom,\n      }),\n    });\n\n    this.initializePopup();\n  }\n\n  /**\n   * Initializes the popup overlay for the map.\n   */\n  private initializePopup(): void {\n    if (isPlatformServer(this.platform)) return; // Skip initialization on server side\n    const container = document.getElementById('popup')!;\n    const content = document.getElementById('popup-content')!;\n    this.popup = new Overlay({\n      element: container,\n      autoPan: true,\n    });\n    this.map.addOverlay(this.popup);\n\n    let isPopupVisible = false;\n\n    this.map.on('click', (event) => {\n      const feature = this.map.forEachFeatureAtPixel(\n        event.pixel,\n        (feat) => feat\n      );\n      if (feature && feature.get('info')) {\n        const coordinates = (feature.getGeometry() as Point).getCoordinates();\n        content.innerHTML = feature.get('info');\n        this.popup.setPosition(coordinates);\n\n        if (!isPopupVisible) {\n          container.classList.remove('hide');\n          container.classList.add('show');\n          isPopupVisible = true;\n        }\n      } else {\n        if (isPopupVisible) {\n          container.classList.remove('show');\n          container.classList.add('hide');\n          isPopupVisible = false;\n        }\n        setTimeout(() => {\n          this.popup.setPosition(undefined);\n        }, 300);\n      }\n    });\n\n    this.map.on('pointermove', (event) => {\n      this.map.getTargetElement().style.cursor = this.map.hasFeatureAtPixel(\n        event.pixel\n      )\n        ? 'pointer'\n        : '';\n    });\n  }\n\n  /**\n   * Highlights the starting point of the polygon being drawn\n   * @param {[number, number]} coordinate - The coordinate to highlight\n   */\n  private highlightStartPoint(coordinate: [number, number]): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    this.clearStartPointHighlight();\n\n    this.startPointFeature = new Feature({\n      geometry: new Point(coordinate),\n    });\n\n    // Add pulsing animation effect\n    const style = new Style({\n      image: new CircleStyle({\n        radius: 8,\n        fill: new Fill({\n          color: 'rgba(0, 255, 0, 0.8)',\n        }),\n        stroke: new Stroke({\n          color: '#00ff00',\n          width: 3,\n        }),\n      }),\n    });\n\n    this.startPointFeature.setStyle(style);\n    this.highlightLayer.getSource()!.addFeature(this.startPointFeature);\n\n    // Add pulsing effect with CSS-like animation\n    this.animateStartPoint();\n  }\n\n  /**\n   * Animates the starting point with a pulsing effect\n   */\n  private animateStartPoint(): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    if (!this.startPointFeature || !this.isDrawingPolygon()) {\n      return;\n    }\n\n    let radius = 8;\n    let growing = true;\n    const animate = () => {\n      if (!this.startPointFeature || !this.isDrawingPolygon()) {\n        return;\n      }\n\n      if (growing) {\n        radius += 0.5;\n        if (radius >= 12) growing = false;\n      } else {\n        radius -= 0.5;\n        if (radius <= 8) growing = true;\n      }\n\n      const style = new Style({\n        image: new CircleStyle({\n          radius: radius,\n          fill: new Fill({\n            color: 'rgba(0, 255, 0, 0.6)',\n          }),\n          stroke: new Stroke({\n            color: '#00ff00',\n            width: 3,\n          }),\n        }),\n      });\n\n      this.startPointFeature.setStyle(style);\n\n      if (this.isDrawingPolygon()) {\n        setTimeout(animate, 100);\n      }\n    };\n\n    animate();\n  }\n\n  /**\n   * Clears the starting point highlight\n   */\n  private clearStartPointHighlight(): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    const source = this.highlightLayer.getSource();\n    if (source) {\n      source.clear();\n    }\n    this.startPointFeature = null;\n  }\n\n  /**\n   * 🔥 Starts polygon drawing mode using signals for state management.\n   * Users can click to add vertices and complete the polygon by clicking the first point again or pressing Enter.\n   */\n  startPolygonDraw(): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    if (this.isDrawingPolygon()) {\n      this.cancelPolygonDraw();\n    }\n\n    // 🔥 Update signals\n    this.isDrawingPolygon.set(true);\n    this.drawingState.set('drawing');\n    this.currentPolygon.set(null);\n\n    this.map.getTargetElement().style.cursor = 'crosshair';\n\n    // Create draw interaction for polygons\n    this.drawInteraction = new Draw({\n      source: this.polygonLayer.getSource()!,\n      type: 'Polygon',\n      style: new Style({\n        stroke: new Stroke({\n          color: '#ff0000',\n          width: 2,\n        }),\n        fill: new Fill({\n          color: 'rgba(255, 0, 0, 0.1)',\n        }),\n      }),\n    });\n\n    // Handle drawing start to highlight the first point\n    this.drawInteraction.on('drawstart', (event) => {\n      // Listen for the first coordinate\n      const geometry = event.feature.getGeometry() as Polygon;\n\n      // Use a small delay to ensure the coordinate is set\n      setTimeout(() => {\n        const coordinates = geometry.getCoordinates()[0];\n        if (coordinates && coordinates.length > 0) {\n          const firstCoord = coordinates[0] as [number, number];\n          this.highlightStartPoint(firstCoord);\n        }\n      }, 50);\n    });\n\n    // Handle polygon completion\n    this.drawInteraction.on('drawend', (event) => {\n      const feature = event.feature;\n      const geometry = feature.getGeometry() as Polygon;\n      const coordinates = geometry.getCoordinates()[0]; // Get outer ring coordinates\n\n      // Convert coordinates from EPSG:3857 to EPSG:4326 (lat/lng)\n      const latLngCoordinates: [number, number][] = coordinates.map(\n        (coord) => toLonLat(coord) as [number, number]\n      );\n\n      // Create polygon data with unique ID\n      const polygonId = Date.now();\n      const polygonData: PolygonGaia = {\n        coordinates: latLngCoordinates,\n        properties: {\n          id: polygonId,\n          createdAt: new Date().toISOString(),\n        },\n      };\n\n      // 🔥 Associate the feature with the polygon ID for later removal\n      feature.set('polygonId', polygonId);\n      feature.set('polygonData', polygonData);\n\n      // 🔥 Update signals\n      this.currentPolygon.set(polygonData);\n      this.completedPolygons.update((polygons) => [...polygons, polygonData]);\n      this.drawingState.set('completing');\n\n      // Clean up\n      this.stopPolygonDraw();\n    });\n\n    // Add the draw interaction to the map\n    this.map.addInteraction(this.drawInteraction);\n\n    // Add keyboard listener for Enter key to complete polygon\n    this.keyListener = (event: KeyboardEvent) => {\n      if (event.key === 'Enter' && this.isDrawingPolygon()) {\n        this.drawInteraction?.finishDrawing();\n      } else if (event.key === 'Escape' && this.isDrawingPolygon()) {\n        this.cancelPolygonDraw();\n      }\n    };\n\n    document.addEventListener('keydown', this.keyListener);\n  }\n\n  /**\n   * 🔥 Cancels the current polygon drawing operation using signals.\n   */\n  cancelPolygonDraw(): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    if (!this.isDrawingPolygon()) {\n      return;\n    }\n\n    // 🔥 Update signals\n    this.drawingState.set('cancelled');\n    this.currentPolygon.set(null);\n\n    this.stopPolygonDraw();\n\n    // Clear any incomplete drawing\n    const source = this.polygonLayer.getSource();\n    if (source) {\n      source.clear();\n    }\n  }\n\n  /**\n   * Stops polygon drawing mode and cleans up resources.\n   */\n  private stopPolygonDraw(): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    // 🔥 Update signal\n    this.isDrawingPolygon.set(false);\n\n    this.map.getTargetElement().style.cursor = '';\n\n    if (this.drawInteraction) {\n      this.map.removeInteraction(this.drawInteraction);\n      this.drawInteraction = null;\n    }\n\n    if (this.keyListener) {\n      document.removeEventListener('keydown', this.keyListener);\n      this.keyListener = null;\n    }\n\n    // Clear the starting point highlight\n    this.clearStartPointHighlight();\n  }\n\n  /**\n   * 🔥 Clears all drawn polygons from the map using signals.\n   */\n  clearPolygons(): void {\n    if (isPlatformServer(this.platform)) return; // Skip on server side\n    console.log(`🗑️ Clearing all polygons...`);\n\n    const source = this.polygonLayer.getSource();\n    if (source) {\n      const featureCount = source.getFeatures().length;\n      source.clear();\n      console.log(`🗑️ Cleared ${featureCount} features from map`);\n    }\n\n    // 🔥 Reset signals\n    const polygonCount = this.completedPolygons().length;\n    this.completedPolygons.set([]);\n    this.currentPolygon.set(null);\n    console.log(`📊 Cleared ${polygonCount} polygons from signals`);\n\n    // Also clear any highlights\n    this.clearStartPointHighlight();\n  }\n\n  /**\n   * 🔥 Get the latest completed polygon using signals\n   */\n  getLatestPolygon(): PolygonGaia | null {\n    const polygons = this.completedPolygons();\n    return polygons.length > 0 ? polygons[polygons.length - 1] : null;\n  }\n\n  /**\n   * 🔥 Remove a specific polygon by ID using signals\n   */\n  removePolygonById(id: number): void {\n    console.log(`🗑️ Removing polygon with ID: ${id}`);\n\n    // First remove from the map layer\n    const source = this.polygonLayer.getSource();\n    if (source) {\n      const features = source.getFeatures();\n      console.log(`📋 Total features on map: ${features.length}`);\n\n      const featureToRemove = features.find((feature) => {\n        const featureId = feature.get('polygonId');\n        console.log(`🔍 Checking feature with ID: ${featureId}`);\n        return featureId === id;\n      });\n\n      if (featureToRemove) {\n        console.log(`✅ Found feature to remove with ID: ${id}`);\n        source.removeFeature(featureToRemove);\n        console.log(`🗑️ Feature removed from map`);\n      } else {\n        console.warn(`❌ Feature with ID ${id} not found on map`);\n\n        // If we can't find by polygonId, try alternative approach\n        const polygonToRemove = this.completedPolygons().find(\n          (p) => p.properties?.['id'] === id\n        );\n        if (polygonToRemove) {\n          // Remove all features and re-add the remaining ones\n          console.log(`🔄 Rebuilding map features...`);\n          source.clear();\n\n          const remainingPolygons = this.completedPolygons().filter(\n            (p) => p.properties?.['id'] !== id\n          );\n          this.rebuildMapFeatures(remainingPolygons);\n        }\n      }\n    }\n\n    // Then update the signals\n    this.completedPolygons.update((polygons) => {\n      const filtered = polygons.filter(\n        (polygon) => polygon.properties?.['id'] !== id\n      );\n      console.log(`📊 Polygons after removal: ${filtered.length}`);\n      return filtered;\n    });\n  }\n\n  /**\n   * 🔥 Rebuilds map features from polygon data\n   */\n  private rebuildMapFeatures(polygons: PolygonGaia[]): void {\n    const source = this.polygonLayer.getSource();\n    if (!source) return;\n\n    polygons.forEach((polygonData) => {\n      // Convert lat/lng coordinates back to map coordinates\n      const mapCoordinates = polygonData.coordinates.map((coord) =>\n        fromLonLat(coord)\n      );\n\n      // Close the polygon if not already closed\n      const lastCoord = mapCoordinates[mapCoordinates.length - 1];\n      const firstCoord = mapCoordinates[0];\n      if (lastCoord[0] !== firstCoord[0] || lastCoord[1] !== firstCoord[1]) {\n        mapCoordinates.push(firstCoord);\n      }\n\n      // Create the feature\n      const feature = new Feature({\n        geometry: new Polygon([mapCoordinates]),\n      });\n\n      // Set the polygon ID and data for future removal\n      feature.set('polygonId', polygonData.properties?.['id']);\n      feature.set('polygonData', polygonData);\n\n      // Add to the map\n      source.addFeature(feature);\n    });\n\n    console.log(`✅ Rebuilt ${polygons.length} features on map`);\n  }\n\n  /**\n   * Adds a raster layer to the map using a given URL.\n   * @param {string} url - The URL of the GeoTIFF file.\n   * @returns {Promise<void>}\n   */\n  async addRasterLayer(url: string): Promise<void> {\n    try {\n      const encodedUrl = encodeURIComponent(url);\n      const boundsUrl = `https://tiles.rdnt.io/bounds?url=${encodedUrl}`;\n      const response = await fetch(boundsUrl);\n      if (!response.ok) {\n        throw new Error('Network response was not ok');\n      }\n      const result = await response.json();\n      const extent = transformExtent(result.bounds, 'EPSG:4326', 'EPSG:3857');\n      this.map.getView().fit(extent, this.map.getSize() as FitOptions);\n\n      const tilesUrl = this.createTilesUrl(encodedUrl);\n      const cogLayer = new TileLayer({\n        source: new XYZ({\n          url: tilesUrl,\n        }),\n      });\n\n      const layers = this.map.getLayers();\n      if (layers.getLength() > 2) {\n        layers.removeAt(2);\n      }\n      this.map.addLayer(cogLayer);\n      this.rasterLayers.push(cogLayer);\n    } catch (error) {\n      console.error('Error al cargar el archivo GeoTIFF:', error);\n      alert(`Request failed. Are you sure '${url}' is a valid COG?`);\n    }\n  }\n\n  /**\n   * Creates a tiles URL for the given encoded URL.\n   * @param {string} url - The encoded URL of the GeoTIFF file.\n   * @returns {string} - The tiles URL.\n   */\n  private createTilesUrl(url: string): string {\n    return `https://tiles.rdnt.io/tiles/{z}/{x}/{y}?url=${url}`;\n  }\n\n  /**\n   * Removes a raster layer from the map by its index.\n   * @param {number} index - The index of the raster layer to remove.\n   */\n  removeRasterLayer(index: number): void {\n    const layer = this.rasterLayers[index];\n    if (layer) {\n      this.map.removeLayer(layer);\n      this.rasterLayers.splice(index, 1);\n    }\n  }\n\n  /**\n   * Sets the view of the map to a given center and zoom level.\n   * @param {[number, number]} center - The new center of the map.\n   * @param {number} zoom - The new zoom level of the map.\n   */\n  setView(center: [number, number], zoom: number): void {\n    this.map.getView().setCenter(fromLonLat(center));\n    this.map.getView().setZoom(zoom);\n  }\n\n  /**\n   * Zooms the map to fit a given extent.\n   * @param {[number, number, number, number]} extent - The extent to fit the map to.\n   */\n  zoomToExtent(extent: [number, number, number, number]): void {\n    this.map.getView().fit(extent);\n  }\n\n  /**\n   * Adds a list of points to the map with an optional icon.\n   * @param {Array<{ coords: [number, number], info?: string }>} points - The list of points to add to the map.\n   * @param {string} [iconUrl] - The URL of the icon to use for the points.\n   */\n  addPoints(points: PointGaia[], iconUrl?: string): void {\n    console.log('Adding points to the map...');\n    const features = points.map((point) => {\n      const feature = new Feature({\n        geometry: new Point(fromLonLat(point.coords)),\n      });\n      if (point.info) {\n        feature.set('info', point.info);\n      }\n      if (iconUrl) {\n        feature.setStyle(\n          new Style({\n            image: new Icon({\n              src: iconUrl,\n              scale: 0.1,\n            }),\n          })\n        );\n      } else {\n        feature.setStyle(\n          new Style({\n            image: new CircleStyle({\n              radius: 5,\n              fill: new Fill({ color: 'red' }),\n              stroke: new Stroke({ color: 'black', width: 1 }),\n            }),\n          })\n        );\n      }\n      return feature;\n    });\n\n    const source = this.pointLayer.getSource();\n    if (source) {\n      source.addFeatures(features);\n    } else {\n      console.error('La fuente de pointLayer no está disponible.');\n    }\n  }\n\n  /**\n   * Exports the current map view to a PDF file.\n   */\n  exportGaiaMapToPdf(): void {\n    this.map.once('rendercomplete', () => {\n      const mapCanvas = document.createElement('canvas');\n      const size = this.map.getSize()!;\n      mapCanvas.width = size[0];\n      mapCanvas.height = size[1];\n      const mapContext = mapCanvas.getContext('2d')!;\n\n      const canvases = document.querySelectorAll(\n        '.ol-layer canvas'\n      ) as NodeListOf<HTMLCanvasElement>;\n      canvases.forEach((canvas) => {\n        if (canvas.width > 0) {\n          const opacity = canvas.parentElement?.style.opacity || '1';\n          mapContext.globalAlpha = parseFloat(opacity);\n\n          const transform = canvas.style.transform;\n          const matrix = transform\n            .match(/^matrix\\(([^)]+)\\)$/)?.[1]\n            .split(',')\n            .map(Number);\n\n          if (matrix) {\n            const domMatrix = new DOMMatrix(matrix);\n            mapContext.setTransform(domMatrix);\n          } else {\n            mapContext.setTransform(1, 0, 0, 1, 0, 0);\n          }\n\n          mapContext.drawImage(canvas, 0, 0);\n        }\n      });\n\n      const dataUrl = mapCanvas.toDataURL('image/png');\n      const pdf = new jsPDF('landscape', undefined, 'a4');\n      pdf.addImage(dataUrl, 'PNG', 0, 0, 297, 210);\n      pdf.save('map.pdf');\n    });\n\n    this.map.renderSync();\n  }\n}\n","import {\n  Component,\n  inject,\n  Input,\n  OnInit,\n  output,\n  computed,\n  linkedSignal,\n  PLATFORM_ID,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { GaiaGisService } from './gaia-gis.service';\nimport { Option, PolygonGaia } from '../interfaces';\n\n@Component({\n  selector: 'gaia-gis',\n  standalone: true,\n  imports: [],\n  templateUrl: './gaia-gis.component.html',\n  styleUrl: './gaia-gis.component.css',\n})\nexport class GaiaGisComponent implements OnInit {\n  @Input() options?: Option;\n\n  // 🔥 Output event for polygon drawing (for backward compatibility)\n  polygonDrawn = output<PolygonGaia>();\n\n  // 🔥 Inject the service with signals\n  private readonly gaiaGisService = inject(GaiaGisService);\n  private readonly platformId = inject(PLATFORM_ID);\n\n  // 🔥 Expose service signals for template usage\n  public readonly isDrawingPolygon = this.gaiaGisService.isDrawingPolygon;\n  public readonly drawingStatus = this.gaiaGisService.drawingStatus;\n  public readonly polygonCount = this.gaiaGisService.polygonCount;\n  public readonly completedPolygons = this.gaiaGisService.completedPolygons;\n  public readonly currentPolygon = this.gaiaGisService.currentPolygon;\n  public readonly drawingState = this.gaiaGisService.drawingState;\n\n  // 🔥 Computed signal for UI state\n  public readonly canStartDrawing = computed(\n    () => !this.isDrawingPolygon() && this.drawingState() !== 'completing'\n  );\n\n  public readonly showCancelButton = computed(\n    () => this.isDrawingPolygon() && this.drawingState() === 'drawing'\n  );\n\n  // 🔥 Linked signal to emit events for backward compatibility\n  private readonly polygonEmitter = linkedSignal(() => {\n    const currentPolygon = this.currentPolygon();\n    const state = this.drawingState();\n\n    if (currentPolygon && state === 'completing') {\n      this.polygonDrawn.emit(currentPolygon);\n    }\n\n    return currentPolygon;\n  });\n\n  ngOnInit(): void {\n    if (isPlatformBrowser(this.platformId)) {\n      this.initializeMap();\n    }\n  }\n\n  initializeMap(): void {\n    if (isPlatformBrowser(this.platformId)) {\n      if (this.options) {\n        this.gaiaGisService.initializeMap('map', this.options);\n      } else {\n        this.gaiaGisService.initializeMap('map');\n      }\n    }\n  }\n\n  /**\n   * 🔥 Starts polygon drawing mode using the service signals.\n   */\n  startPolygonDraw(): void {\n    if (isPlatformBrowser(this.platformId)) {\n      this.gaiaGisService.startPolygonDraw();\n    }\n  }\n\n  /**\n   * 🔥 Cancels polygon drawing using the service signals.\n   */\n  cancelPolygonDraw(): void {\n    if (isPlatformBrowser(this.platformId)) {\n      this.gaiaGisService.cancelPolygonDraw();\n    }\n  }\n\n  /**\n   * 🔥 Clears all drawn polygons using the service signals.\n   */\n  clearPolygons(): void {\n    if (isPlatformBrowser(this.platformId)) {\n      this.gaiaGisService.clearPolygons();\n    }\n  }\n\n  /**\n   * 🔥 Gets the latest polygon using signals\n   */\n  getLatestPolygon(): PolygonGaia | null {\n    return isPlatformBrowser(this.platformId)\n      ? this.gaiaGisService.getLatestPolygon()\n      : null;\n  }\n\n  /**\n   * 🔥 Removes a polygon by ID using signals\n   */\n  removePolygonById(id: number): void {\n    if (isPlatformBrowser(this.platformId)) {\n      this.gaiaGisService.removePolygonById(id);\n    }\n  }\n}\n","<div id=\"map\" style=\"width: 100%; height: 100%\"></div>\n<div id=\"popup\" class=\"ol-popup\">\n  <div id=\"popup-content\"></div>\n</div>\n","/*\n * Public API Surface of gaia-gis\n */\n\nimport { GaiaGisComponent } from './lib/gaia-gis/gaia-gis.component';\nexport { GaiaGisService } from './lib/gaia-gis/gaia-gis.service';\nexport * from './lib/interfaces';\n\nexport { GaiaGisComponent };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["CircleStyle"],"mappings":";;;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,UAAA,CAAA,GAAA,mEAA8E;AAC9E,IAAA,UAAA,CAAA,cAAA,CAAA,GAAA,4GAA2H;AAC3H,IAAA,UAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAJW,UAAU,KAAV,UAAU,GAIrB,EAAA,CAAA,CAAA;;MC0BY,cAAc,CAAA;AACR,IAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;AACvC,IAAA,GAAG;IACH,MAAM,GAAG,IAAI,SAAS,CAAC;QAC7B,MAAM,EAAE,IAAI,GAAG,CAAC;AACd,YAAA,YAAY,EACV,6EAA6E;SAChF,CAAC;AACH,KAAA,CAAC;IACM,YAAY,GAAgB,EAAE;AAC9B,IAAA,UAAU;AACV,IAAA,KAAK;;AAGL,IAAA,YAAY;IACZ,eAAe,GAAgB,IAAI;IACnC,WAAW,GAAQ,IAAI;;AAGvB,IAAA,cAAc;IACd,iBAAiB,GAAmB,IAAI;;AAIhD;;AAEG;AACa,IAAA,gBAAgB,GAAG,MAAM,CAAU,KAAK,4DAAC;AAEzD;;AAEG;AACa,IAAA,cAAc,GAAG,MAAM,CAAqB,IAAI,0DAAC;AAEjE;;AAEG;AACa,IAAA,iBAAiB,GAAG,MAAM,CAAgB,EAAE,6DAAC;AAE7D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