diff --git a/apps/datafeeder/src/app/presentation/components/data-import-validation-map-panel/data-import-validation-map-panel.component.ts b/apps/datafeeder/src/app/presentation/components/data-import-validation-map-panel/data-import-validation-map-panel.component.ts index bbda583a1d..4dd3f60b7d 100644 --- a/apps/datafeeder/src/app/presentation/components/data-import-validation-map-panel/data-import-validation-map-panel.component.ts +++ b/apps/datafeeder/src/app/presentation/components/data-import-validation-map-panel/data-import-validation-map-panel.component.ts @@ -10,7 +10,7 @@ import { ViewChild, } from '@angular/core' import { ThemeService } from '@geonetwork-ui/util/shared' -import type { Feature } from 'geojson' +import type { Feature as FeatureType } from 'geojson' import { asArray, asString } from 'ol/color' import { isEmpty } from 'ol/extent' import GeoJSON from 'ol/format/GeoJSON' @@ -18,11 +18,13 @@ import { Geometry } from 'ol/geom' import TileLayer from 'ol/layer/Tile' import VectorLayer from 'ol/layer/Vector' import Map from 'ol/Map' +import Feature from 'ol/Feature' import OSM from 'ol/source/OSM' import VectorSource from 'ol/source/Vector' import { Fill, RegularShape, Stroke, Style } from 'ol/style' import { StyleLike } from 'ol/style/Style' import View from 'ol/View' +import { FeatureLike } from 'ol/Feature' const DEFAULT_PRIMARY_COLOR = '#9a9a9a' const PADDING = 50 @@ -41,7 +43,7 @@ export class DataImportValidationMapPanelComponent @Input() headerLabel = '' @Input() footerLabel = '' @Input() footerList = [] - @Input() geoJson?: Feature + @Input() geoJson?: FeatureType @Input() footerValue = '' @Input() padding = [] @@ -50,8 +52,8 @@ export class DataImportValidationMapPanelComponent selectedValue: any private map: Map - private source: VectorSource - private vectorLayer: VectorLayer> + private source: VectorSource + private vectorLayer: VectorLayer>> private format: any = new GeoJSON({}) ngOnInit(): void { @@ -158,8 +160,8 @@ export class DataImportValidationMapPanelComponent ] } - private buildVectorLayer(): VectorLayer> { - this.source = new VectorSource({}) + private buildVectorLayer(): VectorLayer>> { + this.source = new VectorSource>({}) if (this.geoJson) { this.source.addFeatures( this.format.readFeatures(this.geoJson, { @@ -168,7 +170,7 @@ export class DataImportValidationMapPanelComponent ) } return new VectorLayer({ - source: this.source, + source: this.source as VectorSource>, style: this.getDefaultStyle(), }) } diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index 0a0c695e94..a2d823b853 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -373,15 +373,18 @@ describe('dataset pages', () => { }) }) it('downloads a file on click', () => { + cy.intercept( + 'GET', + 'https://www.geo2france.fr/geoserver/insee/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=csv' + ).as('downloadRequest') + cy.get('datahub-record-downloads') .find('gn-ui-download-item') .first() .click() - cy.exec('ls cypress/downloads').then((result) => { - const fileList = result.stdout.split('\n') - const isFileDownloaded = fileList[0] - expect(/\S/.test(isFileDownloaded)).to.be.true + cy.wait('@downloadRequest').then((interception) => { + expect(interception.response.statusCode).to.equal(200) }) }) it('displays the full list after clicking two times on one filter', () => { diff --git a/jest.preset.js b/jest.preset.js index 197970e0f1..a7b8a3c70c 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -4,7 +4,7 @@ module.exports = { ...nxPreset, coverageReporters: ['text'], setupFiles: ['jest-canvas-mock'], - transformIgnorePatterns: ['node_modules/(?!(ol|@mapbox|.*.mjs$))'], + transformIgnorePatterns: ['node_modules/(?!(color-*|ol|@mapbox|.*.mjs$))'], transform: { '^.+\\.(ts|mjs|js|html)$': [ 'jest-preset-angular', diff --git a/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.spec.ts b/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.spec.ts index 43b07dfb0d..ea5334ff02 100644 --- a/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.spec.ts +++ b/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.spec.ts @@ -12,7 +12,8 @@ import { MapManagerService, } from '@geonetwork-ui/feature/map' import { FEATURE_COLLECTION_POINT_FIXTURE_4326 } from '@geonetwork-ui/common/fixtures' -import { Map } from 'ol' +import Map from 'ol/Map' +import Feature from 'ol/Feature' import GeoJSON from 'ol/format/GeoJSON' import TileLayer from 'ol/layer/Tile' import VectorLayer from 'ol/layer/Vector' @@ -21,6 +22,7 @@ import XYZ from 'ol/source/XYZ' import { Subject } from 'rxjs' import { GeoTableViewComponent } from './geo-table-view.component' +import { Geometry } from 'ol/geom' const vectorLayer = new VectorLayer({ source: new VectorSource({ @@ -31,7 +33,7 @@ const vectorLayer = new VectorLayer({ dataProjection: 'EPSG:4326', } ), - }), + }) as VectorSource>, }) const mapMock = new Map({ diff --git a/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts b/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts index 03784eec33..77665bfd89 100644 --- a/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +++ b/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts @@ -44,8 +44,8 @@ export class GeoTableViewComponent implements OnInit, AfterViewInit, OnDestroy { private map: Map private view: View - private vectorLayer: VectorLayer> - private vectorSource: VectorSource + private vectorLayer: VectorLayer>> + private vectorSource: VectorSource> private features: Feature[] tableData: TableItemModel[] @@ -76,7 +76,7 @@ export class GeoTableViewComponent implements OnInit, AfterViewInit, OnDestroy { const map = (this.map = this.manager.map) this.view = map.getView() this.vectorLayer = this.manager.map.getLayers().item(1) as VectorLayer< - VectorSource + VectorSource> > this.vectorLayer.setStyle(this.styleFn.bind(this)) this.vectorSource = this.vectorLayer.getSource() diff --git a/libs/feature/dataviz/src/test-setup.ts b/libs/feature/dataviz/src/test-setup.ts index 70e41af1c8..19b403b6c7 100644 --- a/libs/feature/dataviz/src/test-setup.ts +++ b/libs/feature/dataviz/src/test-setup.ts @@ -13,3 +13,10 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: false } } ) + +class ResizeObserverMock { + observe = jest.fn() + unobserve = jest.fn() +} + +;(window as any).ResizeObserver = ResizeObserverMock diff --git a/libs/feature/map/src/lib/map-context/map-context.service.spec.ts b/libs/feature/map/src/lib/map-context/map-context.service.spec.ts index 6923ed4f86..0bc5494d30 100644 --- a/libs/feature/map/src/lib/map-context/map-context.service.spec.ts +++ b/libs/feature/map/src/lib/map-context/map-context.service.spec.ts @@ -32,6 +32,7 @@ import { DEFAULT_VIEW, MapContextService, } from './map-context.service' +import Feature from 'ol/Feature' const mapStyleServiceMock = { createDefaultStyle: jest.fn(() => new Style()), @@ -319,7 +320,9 @@ describe('MapContextService', () => { }) it('add one WFS layer from config on top of baselayer', () => { const layerWFSSource = ( - map.getLayers().item(2) as VectorLayer> + map.getLayers().item(2) as VectorLayer< + VectorSource> + > ).getSource() expect(layerWFSSource).toBeInstanceOf(VectorSource) }) diff --git a/libs/feature/map/src/lib/map-context/map-context.service.ts b/libs/feature/map/src/lib/map-context/map-context.service.ts index 57cc12c6e6..b717585757 100644 --- a/libs/feature/map/src/lib/map-context/map-context.service.ts +++ b/libs/feature/map/src/lib/map-context/map-context.service.ts @@ -23,6 +23,8 @@ import { FeatureCollection } from 'geojson' import { fromLonLat } from 'ol/proj' import WMTS from 'ol/source/WMTS' import { removeSearchParams } from '@geonetwork-ui/util/shared' +import { Geometry } from 'ol/geom' +import Feature from 'ol/Feature' export const DEFAULT_BASELAYER_CONTEXT: MapContextLayerXyzModel = { type: MapContextLayerTypeEnum.XYZ, @@ -136,7 +138,7 @@ export class MapContextService { } const features = this.mapUtils.readFeatureCollection( geojson as FeatureCollection - ) + ) as Feature[] return new VectorLayer({ source: new VectorSource({ features, diff --git a/libs/feature/map/src/lib/utils/map-utils-wms.service.spec.ts b/libs/feature/map/src/lib/utils/map-utils-wms.service.spec.ts index 335b42880c..7ab53a94a2 100644 --- a/libs/feature/map/src/lib/utils/map-utils-wms.service.spec.ts +++ b/libs/feature/map/src/lib/utils/map-utils-wms.service.spec.ts @@ -2,6 +2,7 @@ import { TestBed } from '@angular/core/testing' import { readFirst } from '@nx/angular/testing' import { MapUtilsWMSService } from './map-utils-wms.service' +import { fromEPSGCode } from 'ol/proj/proj4' jest.mock('@camptocamp/ogc-client', () => ({ WmsEndpoint: class { @@ -22,6 +23,24 @@ jest.mock('@camptocamp/ogc-client', () => ({ }, })) +jest.mock('ol/proj/proj4', () => { + const fromEPSGCodeMock = jest.fn() + const registerMock = jest.fn() + return { + fromEPSGCode: fromEPSGCodeMock, + register: registerMock, + } +}) + +jest.mock('ol/proj', () => { + const extent = [1, 2, 3, 4] + const transformExtentMock = jest.fn().mockReturnValue(extent) + + return { + transformExtent: transformExtentMock, + } +}) + describe('MapUtilsWMSService', () => { let service: MapUtilsWMSService @@ -80,8 +99,8 @@ describe('MapUtilsWMSService', () => { } }) it('returns CRS:84 bbox', async () => { - const extent = service.getLonLatBBox(wmsLayerFull) - expect(extent).toEqual(['2.3', '50.6', '2.8', '50.9']) + const extent = await service.getLonLatBBox(wmsLayerFull) + expect(extent).toStrictEqual(['2.3', '50.6', '2.8', '50.9']) }) }) describe('bbox in EPSG:4326', () => { @@ -94,8 +113,8 @@ describe('MapUtilsWMSService', () => { } }) it('returns EPSG:4326 bbox', async () => { - const extent = service.getLonLatBBox(wmsLayerFull) - expect(extent).toEqual(['1', '2.6', '3.3', '4.2']) + const extent = await service.getLonLatBBox(wmsLayerFull) + expect(extent).toStrictEqual(['1', '2.6', '3.3', '4.2']) }) }) describe('no lon lat bbox', () => { @@ -106,9 +125,10 @@ describe('MapUtilsWMSService', () => { }, } }) - it('returns EPSG:4326 bbox', async () => { - const extent = service.getLonLatBBox(wmsLayerFull) - expect(extent).toBeUndefined() + it('transforms to EPSG:4326 bbox', async () => { + const extent = await service.getLonLatBBox(wmsLayerFull) + expect(fromEPSGCode).toHaveBeenCalled() + expect(extent).toStrictEqual([1, 2, 3, 4]) }) }) }) diff --git a/libs/feature/map/src/lib/utils/map-utils-wms.service.ts b/libs/feature/map/src/lib/utils/map-utils-wms.service.ts index 8b6d11d4d1..1b03dc36e7 100644 --- a/libs/feature/map/src/lib/utils/map-utils-wms.service.ts +++ b/libs/feature/map/src/lib/utils/map-utils-wms.service.ts @@ -3,8 +3,12 @@ import { WmsEndpoint, WmsLayerFull } from '@camptocamp/ogc-client' import { MapContextLayerWmsModel } from '../map-context/map-context.model' import { ProxyService } from '@geonetwork-ui/util/shared' import { from, Observable } from 'rxjs' -import { map } from 'rxjs/operators' +import { map, switchMap } from 'rxjs/operators' import { LONLAT_CRS_CODES } from './projections' +import { fromEPSGCode, register } from 'ol/proj/proj4' +import { Extent } from 'ol/extent' +import proj4 from 'proj4/dist/proj4' +import { transformExtent } from 'ol/proj' @Injectable({ providedIn: 'root', @@ -24,17 +28,31 @@ export class MapUtilsWMSService { getLayerLonLatBBox(layer: MapContextLayerWmsModel) { return this.getLayerFull(layer).pipe( - map((wmsLayerFull) => this.getLonLatBBox(wmsLayerFull)) + switchMap((wmsLayerFull) => from(this.getLonLatBBox(wmsLayerFull))) ) } - getLonLatBBox(wmsLayerFull: WmsLayerFull) { + async getLonLatBBox(wmsLayerFull: WmsLayerFull): Promise { const { boundingBoxes } = wmsLayerFull const lonLatCRS = Object.keys(boundingBoxes)?.find((crs) => LONLAT_CRS_CODES.includes(crs) ) if (lonLatCRS) { return boundingBoxes[lonLatCRS] + } else { + const availableEPSGCode = Object.keys(boundingBoxes)[0] + register(proj4) + const proj = await fromEPSGCode(availableEPSGCode) + proj4.defs(availableEPSGCode, proj) + + const bboxWithFiniteNumbers = [ + parseFloat(boundingBoxes[availableEPSGCode][0]), + parseFloat(boundingBoxes[availableEPSGCode][1]), + parseFloat(boundingBoxes[availableEPSGCode][2]), + parseFloat(boundingBoxes[availableEPSGCode][3]), + ] + const extent = transformExtent(bboxWithFiniteNumbers, proj, 'EPSG:4326') + return extent } } } diff --git a/libs/feature/map/src/lib/utils/map-utils.service.spec.ts b/libs/feature/map/src/lib/utils/map-utils.service.spec.ts index 14b1014b0c..2dc0bf257a 100644 --- a/libs/feature/map/src/lib/utils/map-utils.service.spec.ts +++ b/libs/feature/map/src/lib/utils/map-utils.service.spec.ts @@ -28,6 +28,15 @@ import { import { DatasetServiceDistribution } from '@geonetwork-ui/common/domain/model/record' import MapBrowserEvent from 'ol/MapBrowserEvent' +jest.mock('ol/proj/proj4', () => { + const fromEPSGCodeMock = jest.fn() + const registerMock = jest.fn() + return { + fromEPSGCode: fromEPSGCodeMock, + register: registerMock, + } +}) + const wmsUtilsMock = { getLayerLonLatBBox: jest.fn(() => of([1.33, 48.81, 4.3, 51.1])), } @@ -146,7 +155,7 @@ describe('MapUtilsService', () => { }) it('returns true', () => { expect(url).toEqual( - 'url?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=layerName&LAYERS=layerName&INFO_FORMAT=application%2Fjson&I=50&J=50&CRS=EPSG%3A3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=-1697932.4932933417%2C4610319.813853541%2C1332067.5067066583%2C7640319.813853541' + 'url?QUERY_LAYERS=layerName&INFO_FORMAT=application%2Fjson&REQUEST=GetFeatureInfo&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=true&LAYERS=layerName&I=50&J=50&WIDTH=101&HEIGHT=101&CRS=EPSG%3A3857&BBOX=-1697932.4932933417%2C4610319.813853541%2C1332067.5067066583%2C7640319.813853541' ) }) }) diff --git a/libs/feature/map/src/lib/utils/map-utils.service.ts b/libs/feature/map/src/lib/utils/map-utils.service.ts index c90e6be388..03871ce085 100644 --- a/libs/feature/map/src/lib/utils/map-utils.service.ts +++ b/libs/feature/map/src/lib/utils/map-utils.service.ts @@ -2,7 +2,7 @@ import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' import type { FeatureCollection } from 'geojson' import { extend, Extent, isEmpty } from 'ol/extent' -import OlFeature from 'ol/Feature' +import OlFeature, { FeatureLike } from 'ol/Feature' import GeoJSON from 'ol/format/GeoJSON' import { Geometry } from 'ol/geom' import Layer from 'ol/layer/Layer' @@ -50,7 +50,7 @@ export class MapUtilsService { featureCollection: FeatureCollection, featureProjection = FEATURE_PROJECTION, dataProjection = DATA_PROJECTION - ): OlFeature[] => { + ): FeatureLike[] => { const olFeatures = new GeoJSON().readFeatures(featureCollection, { featureProjection, dataProjection, diff --git a/libs/feature/map/src/test-setup.ts b/libs/feature/map/src/test-setup.ts index 70e41af1c8..19b403b6c7 100644 --- a/libs/feature/map/src/test-setup.ts +++ b/libs/feature/map/src/test-setup.ts @@ -13,3 +13,10 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: false } } ) + +class ResizeObserverMock { + observe = jest.fn() + unobserve = jest.fn() +} + +;(window as any).ResizeObserver = ResizeObserverMock diff --git a/libs/feature/record/src/lib/map-view/map-view.component.spec.ts b/libs/feature/record/src/lib/map-view/map-view.component.spec.ts index a056787d47..d8a495eda7 100644 --- a/libs/feature/record/src/lib/map-view/map-view.component.spec.ts +++ b/libs/feature/record/src/lib/map-view/map-view.component.spec.ts @@ -745,25 +745,28 @@ describe('MapViewComponent', () => { }) }) - const vectorLayer = new VectorLayer({ - source: new VectorSource({ - features: new GeoJSON().readFeatures( - FEATURE_COLLECTION_POINT_FIXTURE_4326, - { - featureProjection: 'EPSG:3857', - dataProjection: 'EPSG:4326', - } - ), - }), - }) - const selectionFeatures = [ - vectorLayer - .getSource() - .getFeatures() - .find((feature) => feature.getId() === 2), - ] - describe('feature info', () => { + let selectionFeatures + beforeEach(() => { + const vectorLayer = new VectorLayer({ + source: new VectorSource({ + features: new GeoJSON().readFeatures( + FEATURE_COLLECTION_POINT_FIXTURE_4326, + { + featureProjection: 'EPSG:3857', + dataProjection: 'EPSG:4326', + } + ), + }), + }) + selectionFeatures = [ + vectorLayer + .getSource() + .getFeatures() + .find((feature) => feature.getId() === 2), + ] + }) + it('creates selection style', () => { expect(component['selectionStyle']).toBeTruthy() }) diff --git a/package-lock.json b/package-lock.json index f6c7aa4f96..2d8c9ee083 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,9 +55,10 @@ "ngx-chips": "3.0.0", "ngx-dropzone": "^3.0.0", "ngx-translate-messageformat-compiler": "~6.5.0", - "ol": "^6.6.1", + "ol": "^8.2.0", "papaparse": "^5.3.1", "pg": "^8.9.0", + "proj4": "^2.9.2", "reflect-metadata": "^0.1.13", "rxjs": "^7.0.0", "tippy.js": "^6.3.7", @@ -5081,45 +5082,6 @@ "node": ">=8" } }, - "node_modules/@mapbox/jsonlint-lines-primitives": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", - "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/@mapbox/mapbox-gl-style-spec": { - "version": "13.28.0", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-style-spec/-/mapbox-gl-style-spec-13.28.0.tgz", - "integrity": "sha512-B8xM7Fp1nh5kejfIl4SWeY0gtIeewbuRencqO3cJDrCHZpaPg7uY+V8abuR+esMeuOjRl5cLhVTP40v+1ywxbg==", - "dependencies": { - "@mapbox/jsonlint-lines-primitives": "~2.0.2", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/unitbezier": "^0.0.0", - "csscolorparser": "~1.0.2", - "json-stringify-pretty-compact": "^2.0.0", - "minimist": "^1.2.6", - "rw": "^1.3.3", - "sort-object": "^0.3.2" - }, - "bin": { - "gl-style-composite": "bin/gl-style-composite.js", - "gl-style-format": "bin/gl-style-format.js", - "gl-style-migrate": "bin/gl-style-migrate.js", - "gl-style-validate": "bin/gl-style-validate.js" - } - }, - "node_modules/@mapbox/point-geometry": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", - "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" - }, - "node_modules/@mapbox/unitbezier": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", - "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==" - }, "node_modules/@material/animation": { "version": "15.0.0-canary.90291f2e2.0", "resolved": "https://registry.npmjs.org/@material/animation/-/animation-15.0.0-canary.90291f2e2.0.tgz", @@ -8254,9 +8216,9 @@ } }, "node_modules/@petamoriken/float16": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.2.tgz", - "integrity": "sha512-TrVOB6T9kIrmGCp+mUIej7VJgQbB5MRWEj1ZksfR7hPSyc338xHxLO50spgpGBlbmk8D3kWOGnCHDfnaPV+Sng==" + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.4.tgz", + "integrity": "sha512-kB+NJ5Br56ZhElKsf0pM7/PQfrDdDVMRz8f0JM6eVOGE+L89z9hwcst9QvWBBnazzuqGTGtPsJNZoQ1JdNiGSQ==" }, "node_modules/@phenomnomnominal/tsquery": { "version": "5.0.1", @@ -15627,6 +15589,28 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", + "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "dependencies": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "node_modules/color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, "node_modules/color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", @@ -16409,11 +16393,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/csscolorparser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", - "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==" - }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -17375,6 +17354,11 @@ "resolved": "https://registry.npmjs.org/duration-relativetimeformat/-/duration-relativetimeformat-2.0.4.tgz", "integrity": "sha512-EW2eKxRm0IhOmJiBDx50PV5MKVhHGGLqQ4fLbinItdYmoZcVDFRqomCbYfZFEbBXiQdvaRUU+/E2CMlvz5/u5A==" }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -19216,44 +19200,28 @@ } }, "node_modules/geotiff": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.0.4.tgz", - "integrity": "sha512-aG8h9bJccGusioPsEWsEqx8qdXpZN71A20WCvRKGxcnHSOWLKmC5ZmsAmodfxb9TRQvs+89KikGuPzxchhA+Uw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.0.tgz", + "integrity": "sha512-B/iFJuFfRpmPHXf8aIRPRgUWwfaNb6dlsynkM8SWeHAPu7CpyvfqEa43KlBt7xxq5OTVysQacFHxhCn3SZhRKQ==", "dependencies": { "@petamoriken/float16": "^3.4.7", "lerc": "^3.0.0", - "lru-cache": "^6.0.0", "pako": "^2.0.4", "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", "web-worker": "^1.2.0", - "xml-utils": "^1.0.2" + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" }, "engines": { - "browsers": "defaults", "node": ">=10.19" } }, - "node_modules/geotiff/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/geotiff/node_modules/pako": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, - "node_modules/geotiff/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -23074,11 +23042,6 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, - "node_modules/json-stringify-pretty-compact": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz", - "integrity": "sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ==" - }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -23793,11 +23756,6 @@ "integrity": "sha512-0aF7ZmVon1igznGI4VS30yugpduQW3y3GkcgGJOp7d8x8QrizhigUxjI/m2UojsXXto+jLAH3KSz+xOJTiORjg==", "dev": true }, - "node_modules/mapbox-to-css-font": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.2.tgz", - "integrity": "sha512-f+NBjJJY4T3dHtlEz1wCG7YFlkODEjFIYlxDdLIDMNpkSksqTt+l/d4rjuwItxuzkuMFvPyrjzV2lxRM4ePcIA==" - }, "node_modules/mark.js": { "version": "8.11.1", "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", @@ -23898,6 +23856,11 @@ "node": ">= 0.6" } }, + "node_modules/mgrs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz", + "integrity": "sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA==" + }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -25776,12 +25739,14 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==" }, "node_modules/ol": { - "version": "6.15.1", - "resolved": "https://registry.npmjs.org/ol/-/ol-6.15.1.tgz", - "integrity": "sha512-ZG2CKTpJ8Q+tPywYysVwPk+yevwJzlbwjRKhoCvd7kLVWMbfBl1O/+Kg/yrZZrhG9FNXbFH4GeOZ5yVRqo3P4w==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", + "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", "dependencies": { - "geotiff": "2.0.4", - "ol-mapbox-style": "^8.0.5", + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", "pbf": "3.2.1", "rbush": "^3.0.1" }, @@ -25790,15 +25755,6 @@ "url": "https://opencollective.com/openlayers" } }, - "node_modules/ol-mapbox-style": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-8.2.1.tgz", - "integrity": "sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==", - "dependencies": { - "@mapbox/mapbox-gl-style-spec": "^13.23.1", - "mapbox-to-css-font": "^2.4.1" - } - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -27360,6 +27316,15 @@ "node": ">=0.4.0" } }, + "node_modules/proj4": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.9.2.tgz", + "integrity": "sha512-bdyfNmtlWjQN/rHEHEiqFvpTUHhuzDaeQ6Uu1G4sPGqk+Xkxae6ahh865fClJokSGPBmlDOQWWaO6465TCfv5Q==", + "dependencies": { + "mgrs": "1.0.0", + "wkt-parser": "^1.3.3" + } + }, "node_modules/promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -27651,6 +27616,17 @@ } ] }, + "node_modules/quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/quickselect": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", @@ -28580,11 +28556,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/rw": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", - "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" - }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -29151,34 +29122,6 @@ "node": ">= 10" } }, - "node_modules/sort-asc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz", - "integrity": "sha512-jBgdDd+rQ+HkZF2/OHCmace5dvpos/aWQpcxuyRs9QUbPRnkEJmYVo81PIGpjIdpOcsnJ4rGjStfDHsbn+UVyw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-desc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.1.1.tgz", - "integrity": "sha512-jfZacW5SKOP97BF5rX5kQfJmRVZP5/adDUTY8fCSPvNcXDVpUEe2pr/iKGlcyZzchRJZrswnp68fgk3qBXgkJw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-object": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-0.3.2.tgz", - "integrity": "sha512-aAQiEdqFTTdsvUFxXm3umdo04J7MRljoVGbBlkH7BgNsMvVNAJyGj7C/wV1A8wHWAJj/YikeZbfuCKqhggNWGA==", - "dependencies": { - "sort-asc": "^0.1.0", - "sort-desc": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -32997,6 +32940,11 @@ "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==" }, + "node_modules/wkt-parser": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.3.3.tgz", + "integrity": "sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw==" + }, "node_modules/wmf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", @@ -33367,6 +33315,11 @@ "dependencies": { "tslib": "^2.3.0" } + }, + "node_modules/zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" } } } diff --git a/package.json b/package.json index b517cf045f..d30199c687 100644 --- a/package.json +++ b/package.json @@ -90,9 +90,10 @@ "ngx-chips": "3.0.0", "ngx-dropzone": "^3.0.0", "ngx-translate-messageformat-compiler": "~6.5.0", - "ol": "^6.6.1", + "ol": "^8.2.0", "papaparse": "^5.3.1", "pg": "^8.9.0", + "proj4": "^2.9.2", "reflect-metadata": "^0.1.13", "rxjs": "^7.0.0", "tippy.js": "^6.3.7",