From 0c0e3cb7ed6dd7d7e5d8eb385feff4d9072e4211 Mon Sep 17 00:00:00 2001 From: Jeremy Eychenne Date: Tue, 10 Dec 2024 18:14:14 +0100 Subject: [PATCH] feat: update openlayers to `~7.5.2` BREAKING CHANGE: `ol` peer dep is now `~7.5.2` BREAKING CHANGE: see all breaking changes from `ol` `7.0.0` (https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#700) BREAKING CHANGE: see all breaking changes from `ol` `7.1.0` (https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#710) BREAKING CHANGE: see all breaking changes from `ol` `7.2.0` (https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#720) BREAKING CHANGE: see all breaking changes from `ol` `7.5.0` (https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#750) --- package.json | 2 +- projects/ngx-openlayers/package.json | 2 +- .../lib/controls/mouseposition.component.ts | 2 + .../src/lib/controls/scaleline.component.ts | 3 +- .../lib/layers/layervectortile.component.ts | 4 +- .../src/lib/sources/bingmaps.component.ts | 2 + .../src/lib/styles/text.component.ts | 2 +- .../image-static/image-static.component.ts | 4 +- yarn.lock | 48 +++++++++++++------ 9 files changed, 45 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index a3efc737..a662a721 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@angular/platform-browser-dynamic": "^15.2.10", "@angular/router": "^15.2.10", "hammerjs": "^2.0.8", - "ol": "~6.15.1", + "ol": "~7.5.2", "rxjs": "~7.5.0", "tslib": "^2.5.0", "zone.js": "~0.11.4" diff --git a/projects/ngx-openlayers/package.json b/projects/ngx-openlayers/package.json index 93114dbd..d3ca74d1 100644 --- a/projects/ngx-openlayers/package.json +++ b/projects/ngx-openlayers/package.json @@ -7,6 +7,6 @@ "peerDependencies": { "@angular/common": ">=6.0.0 <=15.x.x", "@angular/core": ">=6.0.0 <=15.x.x", - "ol": "~6.15.1" + "ol": "~7.5.2" } } diff --git a/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts b/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts index 0a5f21c8..565690ee 100644 --- a/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts @@ -13,6 +13,8 @@ export class ControlMousePositionComponent implements OnInit, OnDestroy { coordinateFormat: CoordinateFormat; @Input() projection: ProjectionLike; + @Input() + wrapX: boolean; target: HTMLElement; instance: MousePosition; diff --git a/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts b/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts index 3f91e137..a135d038 100644 --- a/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts @@ -1,6 +1,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { ScaleLine } from 'ol/control'; import { MapComponent } from '../map.component'; +import { Units } from 'ol/control/ScaleLine'; @Component({ selector: 'aol-control-scaleline', @@ -8,7 +9,7 @@ import { MapComponent } from '../map.component'; }) export class ControlScaleLineComponent implements OnInit, OnDestroy { @Input() - units: string; + units: Units; instance: ScaleLine; diff --git a/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts b/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts index 82f9e354..6d1d64bc 100644 --- a/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts @@ -6,9 +6,7 @@ import { StyleFunction } from 'ol/style/Style'; import { MapComponent } from '../map.component'; import { LayerComponent } from './layer.component'; import { LayerGroupComponent } from './layergroup.component'; -import VectorTileRenderType from 'ol/layer/VectorTileRenderType'; - -type VectorTileRenderType = typeof VectorTileRenderType; +import { VectorTileRenderType } from 'ol/layer/VectorTile'; @Component({ selector: 'aol-layer-vectortile', diff --git a/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts b/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts index 56c08bf8..39ee7431 100644 --- a/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts @@ -28,6 +28,8 @@ export class SourceBingmapsComponent extends SourceComponent implements OnInit { tileLoadFunction: LoadFunction; @Input() wrapX: boolean; + @Input() + placeholderTiles = false; instance: BingMaps; diff --git a/projects/ngx-openlayers/src/lib/styles/text.component.ts b/projects/ngx-openlayers/src/lib/styles/text.component.ts index b69e1d10..74064456 100644 --- a/projects/ngx-openlayers/src/lib/styles/text.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/text.component.ts @@ -22,7 +22,7 @@ export class StyleTextComponent implements OnInit, OnChanges { @Input() text: string | undefined; @Input() - textAlign: string | undefined; + textAlign: CanvasTextAlign | undefined; @Input() textBaseLine: string | undefined; diff --git a/src/app/image-static/image-static.component.ts b/src/app/image-static/image-static.component.ts index a6247064..a87edf17 100644 --- a/src/app/image-static/image-static.component.ts +++ b/src/app/image-static/image-static.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { Extent, getCenter } from 'ol/extent'; -import Projection from 'ol/proj/Projection'; +import Projection, { Options } from 'ol/proj/Projection'; @Component({ selector: 'app-root', @@ -47,7 +47,7 @@ export class ImageStaticComponent { public opacity = 1.0; extent: Extent = [0, 0, 1024, 968]; - po = { + po: Options = { code: 'xkcd-image', units: 'pixels', extent: [0, 0, 1024, 968], diff --git a/yarn.lock b/yarn.lock index 9f2679e2..8817f911 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4163,6 +4163,11 @@ dunder-proto@^1.0.0: es-errors "^1.3.0" gopd "^1.2.0" +earcut@^2.2.3: + version "2.2.4" + resolved "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz#6d02fd4d68160c114825d06890a92ecaae60343a" + integrity sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -5063,18 +5068,19 @@ gensync@^1.0.0-beta.2: resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -geotiff@2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/geotiff/-/geotiff-2.0.4.tgz#d6f231fdd76186aba21c61823ed759fcbf5d4f86" - integrity sha512-aG8h9bJccGusioPsEWsEqx8qdXpZN71A20WCvRKGxcnHSOWLKmC5ZmsAmodfxb9TRQvs+89KikGuPzxchhA+Uw== +geotiff@^2.0.7: + version "2.1.3" + resolved "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz#993f40f2aa6aa65fb1e0451d86dd22ca8e66910c" + integrity sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA== 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" + zstddec "^0.1.0" get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" @@ -7302,21 +7308,23 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -ol-mapbox-style@^8.0.5: - version "8.2.1" - resolved "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-8.2.1.tgz#0f0c252b6495853a137d7e4dd3f915fab664b356" - integrity sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw== +ol-mapbox-style@^10.1.0: + version "10.7.0" + resolved "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-10.7.0.tgz#8837912da2a16fbd22992d76cbc4f491c838b973" + integrity sha512-S/UdYBuOjrotcR95Iq9AejGYbifKeZE85D9VtH11ryJLQPTZXZSW1J5bIXcr4AlAH6tyjPPHTK34AdkwB32Myw== dependencies: "@mapbox/mapbox-gl-style-spec" "^13.23.1" mapbox-to-css-font "^2.4.1" + ol "^7.3.0" -ol@~6.15.1: - version "6.15.1" - resolved "https://registry.npmjs.org/ol/-/ol-6.15.1.tgz#364f459939ef71f970b2376a821a896529f65e3a" - integrity sha512-ZG2CKTpJ8Q+tPywYysVwPk+yevwJzlbwjRKhoCvd7kLVWMbfBl1O/+Kg/yrZZrhG9FNXbFH4GeOZ5yVRqo3P4w== +ol@^7.3.0, ol@~7.5.2: + version "7.5.2" + resolved "https://registry.npmjs.org/ol/-/ol-7.5.2.tgz#2e40a16b45331dbee86ca86876fcc7846be0dbb7" + integrity sha512-HJbb3CxXrksM6ct367LsP3N+uh+iBBMdP3DeGGipdV9YAYTP0vTJzqGnoqQ6C2IW4qf8krw9yuyQbc9fjOIaOQ== dependencies: - geotiff "2.0.4" - ol-mapbox-style "^8.0.5" + earcut "^2.2.3" + geotiff "^2.0.7" + ol-mapbox-style "^10.1.0" pbf "3.2.1" rbush "^3.0.1" @@ -7933,6 +7941,11 @@ quick-lru@^4.0.1: resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +quick-lru@^6.1.1: + version "6.1.2" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz#e9a90524108629be35287d0b864e7ad6ceb3659e" + integrity sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ== + quickselect@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz#f19680a486a5eefb581303e023e98faaf25dd018" @@ -9964,3 +9977,8 @@ zone.js@~0.11.4: integrity sha512-82bctBg2hKcEJ21humWIkXRlLBBmrc3nN7DFh5LGGhcyycO2S7FN8NmdvlcKaGFDNVL4/9kFLmwmInTavdJERA== dependencies: tslib "^2.3.0" + +zstddec@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz#7050f3f0e0c3978562d0c566b3e5a427d2bad7ec" + integrity sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==