ngx-gaia-gis
Version:
GaiaGisService is an Angular library that simplifies the integration of interactive maps using OpenLayers. It allows for visualizing raster maps, adding custom points, and adjusting views easily, making it ideal for developers who need to implement geospa
1 lines • 20.7 kB
Source Map (JSON)
{"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 {\r\n CARTOCDN = 'https://{1-4}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png',\r\n GNOSIS_EARTH = 'https://maps.gnosis.earth/ogcapi/collections/NaturalEarth:raster:HYP_HR_SR_OB_DR/map/tiles/WebMercatorQuad',\r\n OSM = 'OSM',\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport TileLayer from 'ol/layer/Tile';\r\nimport { XYZ } from 'ol/source';\r\nimport { transformExtent, fromLonLat } from 'ol/proj';\r\nimport { Feature, Map, View } from 'ol';\r\nimport { Style, Icon, Circle as CircleStyle, Fill, Stroke } from 'ol/style';\r\nimport { Point } from 'ol/geom';\r\nimport VectorLayer from 'ol/layer/Vector';\r\nimport { FitOptions } from 'ol/View';\r\nimport 'ol/ol.css';\r\nimport VectorSource from 'ol/source/Vector';\r\nimport { MapsDesign, Option } from '../interfaces';\r\nimport OSM from 'ol/source/OSM';\r\nimport { jsPDF } from 'jspdf';\r\nimport Overlay from 'ol/Overlay';\r\nimport { PointGaia } from '../interfaces/PointGaia.model';\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class GaiaGisService {\r\n private map!: Map;\r\n private labels = new TileLayer({\r\n source: new XYZ({\r\n attributions:\r\n 'Gaia-GIS by © <a href=\"https://carto.com/attribution\">Olympus Analytics</a>',\r\n }),\r\n });\r\n private rasterLayers: TileLayer[] = [];\r\n private pointLayer: VectorLayer<VectorSource>;\r\n private popup!: Overlay;\r\n\r\n constructor() {\r\n this.pointLayer = new VectorLayer({\r\n source: new VectorSource(),\r\n });\r\n }\r\n\r\n /**\r\n * Initializes the map with the specified target, center, zoom level, and design.\r\n * @param {string} target - The target element ID for the map.\r\n * @param {Object} options - Options for configuring the map.\r\n * @param {[number, number]} [options.center=[0, 0]] - The initial center of the map.\r\n * @param {number} [options.zoom=2] - The initial zoom level of the map.\r\n * @param {string} [options.design=MapsDesign.CARTOCDN] - The design of the map.\r\n */\r\n initializeMap(target: string, options: Option = {}): void {\r\n const { center = [0, 0], zoom = 2, design = MapsDesign.CARTOCDN } = options;\r\n\r\n let baseLayer: TileLayer;\r\n\r\n if (\r\n design.includes('{z}') &&\r\n design.includes('{x}') &&\r\n design.includes('{y}')\r\n ) {\r\n baseLayer = new TileLayer({\r\n source: new XYZ({\r\n url: design,\r\n crossOrigin: 'anonymous', // Add this line\r\n }),\r\n });\r\n } else {\r\n baseLayer = new TileLayer({\r\n source: new OSM(),\r\n });\r\n }\r\n\r\n this.labels = new TileLayer({\r\n source: new XYZ({\r\n url: 'https://{1-4}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png',\r\n attributions:\r\n 'Gaia-GIS by © <a href=\"https://carto.com/attribution\">Olympus Analytics</a>',\r\n crossOrigin: 'anonymous', // Add this line\r\n }),\r\n });\r\n\r\n this.map = new Map({\r\n target: target,\r\n layers: [\r\n baseLayer,\r\n this.pointLayer, // Add pointLayer here\r\n ],\r\n view: new View({\r\n center: fromLonLat(center),\r\n zoom: zoom,\r\n }),\r\n });\r\n\r\n this.initializePopup();\r\n }\r\n\r\n /**\r\n * Initializes the popup overlay for the map.\r\n */\r\n private initializePopup(): void {\r\n const container = document.getElementById('popup')!;\r\n const content = document.getElementById('popup-content')!;\r\n this.popup = new Overlay({\r\n element: container,\r\n autoPan: true,\r\n });\r\n this.map.addOverlay(this.popup);\r\n\r\n // Variable para controlar si el popup está visible\r\n let isPopupVisible = false;\r\n\r\n this.map.on('click', (event) => {\r\n const feature = this.map.forEachFeatureAtPixel(\r\n event.pixel,\r\n (feat) => feat\r\n );\r\n if (feature && feature.get('info')) {\r\n const coordinates = (feature.getGeometry() as Point).getCoordinates();\r\n content.innerHTML = feature.get('info');\r\n this.popup.setPosition(coordinates);\r\n\r\n // Mostrar el popup con animación\r\n if (!isPopupVisible) {\r\n container.classList.remove('hide');\r\n container.classList.add('show');\r\n isPopupVisible = true;\r\n }\r\n } else {\r\n if (isPopupVisible) {\r\n // Ocultar el popup con animación\r\n container.classList.remove('show');\r\n container.classList.add('hide');\r\n isPopupVisible = false;\r\n }\r\n // Asegurarse de que el popup se ocultará completamente después de la transición\r\n setTimeout(() => {\r\n this.popup.setPosition(undefined);\r\n }, 300); // Tiempo debe coincidir con la duración de la transición CSS\r\n }\r\n });\r\n\r\n // Cerrar el popup al hacer clic en el mapa en un área sin features\r\n this.map.on('pointermove', (event) => {\r\n this.map.getTargetElement().style.cursor = this.map.hasFeatureAtPixel(\r\n event.pixel\r\n )\r\n ? 'pointer'\r\n : '';\r\n });\r\n }\r\n\r\n /**\r\n * Adds a raster layer to the map using a given URL.\r\n * @param {string} url - The URL of the GeoTIFF file.\r\n * @returns {Promise<void>}\r\n */\r\n async addRasterLayer(url: string): Promise<void> {\r\n try {\r\n const encodedUrl = encodeURIComponent(url);\r\n const boundsUrl = `https://tiles.rdnt.io/bounds?url=${encodedUrl}`;\r\n const response = await fetch(boundsUrl);\r\n if (!response.ok) {\r\n throw new Error('Network response was not ok');\r\n }\r\n const result = await response.json();\r\n const extent = transformExtent(result.bounds, 'EPSG:4326', 'EPSG:3857');\r\n this.map.getView().fit(extent, this.map.getSize() as FitOptions);\r\n\r\n const tilesUrl = this.createTilesUrl(encodedUrl);\r\n const cogLayer = new TileLayer({\r\n source: new XYZ({\r\n url: tilesUrl,\r\n }),\r\n });\r\n\r\n const layers = this.map.getLayers();\r\n if (layers.getLength() > 2) {\r\n layers.removeAt(2); // Remove the previous COG map\r\n }\r\n this.map.addLayer(cogLayer);\r\n this.rasterLayers.push(cogLayer);\r\n } catch (error) {\r\n console.error('Error al cargar el archivo GeoTIFF:', error);\r\n alert(`Request failed. Are you sure '${url}' is a valid COG?`);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a tiles URL for the given encoded URL.\r\n * @param {string} url - The encoded URL of the GeoTIFF file.\r\n * @returns {string} - The tiles URL.\r\n */\r\n private createTilesUrl(url: string): string {\r\n return `https://tiles.rdnt.io/tiles/{z}/{x}/{y}?url=${url}`;\r\n }\r\n\r\n /**\r\n * Removes a raster layer from the map by its index.\r\n * @param {number} index - The index of the raster layer to remove.\r\n */\r\n removeRasterLayer(index: number): void {\r\n const layer = this.rasterLayers[index];\r\n if (layer) {\r\n this.map.removeLayer(layer);\r\n this.rasterLayers.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the view of the map to a given center and zoom level.\r\n * @param {[number, number]} center - The new center of the map.\r\n * @param {number} zoom - The new zoom level of the map.\r\n */\r\n setView(center: [number, number], zoom: number): void {\r\n this.map.getView().setCenter(fromLonLat(center));\r\n this.map.getView().setZoom(zoom);\r\n }\r\n\r\n /**\r\n * Zooms the map to fit a given extent.\r\n * @param {[number, number, number, number]} extent - The extent to fit the map to.\r\n */\r\n zoomToExtent(extent: [number, number, number, number]): void {\r\n this.map.getView().fit(extent);\r\n }\r\n\r\n /**\r\n * Adds a list of points to the map with an optional icon.\r\n * @param {Array<{ coords: [number, number], info?: string }>} points - The list of points to add to the map.\r\n * @param {string} [iconUrl] - The URL of the icon to use for the points.\r\n */\r\n addPoints(points: PointGaia[], iconUrl?: string): void {\r\n console.log('Adding points to the map...');\r\n const features = points.map((point) => {\r\n const feature = new Feature({\r\n geometry: new Point(fromLonLat(point.coords)),\r\n });\r\n if (point.info) {\r\n feature.set('info', point.info);\r\n }\r\n if (iconUrl) {\r\n feature.setStyle(\r\n new Style({\r\n image: new Icon({\r\n src: iconUrl,\r\n scale: 0.1,\r\n }),\r\n })\r\n );\r\n } else {\r\n feature.setStyle(\r\n new Style({\r\n image: new CircleStyle({\r\n radius: 5,\r\n fill: new Fill({ color: 'red' }),\r\n stroke: new Stroke({ color: 'black', width: 1 }),\r\n }),\r\n })\r\n );\r\n }\r\n return feature;\r\n });\r\n\r\n const source = this.pointLayer.getSource();\r\n if (source) {\r\n source.addFeatures(features);\r\n } else {\r\n console.error('La fuente de pointLayer no está disponible.');\r\n }\r\n }\r\n /**\r\n * Exports the current map view to a PDF file.\r\n */\r\n exportGaiaMapToPdf(): void {\r\n this.map.once('rendercomplete', () => {\r\n const mapCanvas = document.createElement('canvas');\r\n const size = this.map.getSize()!;\r\n mapCanvas.width = size[0];\r\n mapCanvas.height = size[1];\r\n const mapContext = mapCanvas.getContext('2d')!;\r\n\r\n const canvases = document.querySelectorAll(\r\n '.ol-layer canvas'\r\n ) as NodeListOf<HTMLCanvasElement>;\r\n canvases.forEach((canvas) => {\r\n if (canvas.width > 0) {\r\n const opacity = canvas.parentElement?.style.opacity || '1';\r\n mapContext.globalAlpha = parseFloat(opacity);\r\n\r\n const transform = canvas.style.transform;\r\n const matrix = transform\r\n .match(/^matrix\\(([^)]+)\\)$/)?.[1]\r\n .split(',')\r\n .map(Number);\r\n\r\n if (matrix) {\r\n const domMatrix = new DOMMatrix(matrix);\r\n mapContext.setTransform(domMatrix);\r\n } else {\r\n mapContext.setTransform(1, 0, 0, 1, 0, 0);\r\n }\r\n\r\n mapContext.drawImage(canvas, 0, 0);\r\n }\r\n });\r\n\r\n const dataUrl = mapCanvas.toDataURL('image/png');\r\n const pdf = new jsPDF('landscape', undefined, 'a4');\r\n pdf.addImage(dataUrl, 'PNG', 0, 0, 297, 210);\r\n pdf.save('map.pdf');\r\n });\r\n\r\n this.map.renderSync();\r\n }\r\n}\r\n","import { Component, inject, Input, input, OnInit } from '@angular/core';\r\nimport { GaiaGisService } from './gaia-gis.service';\r\nimport { Option } from '../interfaces/OptionsGaia.model';\r\n\r\n@Component({\r\n selector: 'gaia-gis',\r\n standalone: true,\r\n imports: [],\r\n templateUrl: './gaia-gis.component.html',\r\n styleUrl: './gaia-gis.component.css',\r\n})\r\nexport class GaiaGisComponent implements OnInit {\r\n @Input() options?: Option;\r\n GaiaGisService = inject(GaiaGisService);\r\n ngOnInit(): void {\r\n this.initilizeMap();\r\n }\r\n initilizeMap(): void {\r\n if (this.options) {\r\n this.GaiaGisService.initializeMap('map', this.options);\r\n } else {\r\n this.GaiaGisService.initializeMap('map');\r\n }\r\n }\r\n}\r\n","<div id=\"map\" style=\"width: 100%; height: 100%\"></div>\r\n<div id=\"popup\" class=\"ol-popup\">\r\n <div id=\"popup-content\"></div>\r\n</div>\r\n","/*\r\n * Public API Surface of gaia-gis\r\n */\r\n\r\nimport { GaiaGisComponent } from './lib/gaia-gis/gaia-gis.component';\r\nexport * from './lib/gaia-gis/gaia-gis.service';\r\nexport * from './lib/interfaces';\r\n\r\nexport { GaiaGisComponent };\r\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;;MCeY,cAAc,CAAA;AACjB,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;A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