Skip to content

Commit 73b3d7f

Browse files
Integrate projections in MapState (#288)
* ci: update actions and use node 24 * feat(services-map-state): export basic projection helpers and definitions #204 * refactor: use new definitions and constants from services-map-state for projections #204 * BREAKING CHANGE(ngx-ukis-ui-clarity): projection-switch and mouse-position now needs inputs of mapSvc and mapState * BREAKING CHANGE(map-cesium): not used option geographic removed from service.getCurrentExtent() * feat(services-map-state): add functionality to setProjection and nativeExtent #204 * BREAKING CHANGE(map-ol): params of service.setProjection changed to register proj4 projections and use inputs of MapState.setProjection #204 * fix: set global of exported ProjDefs * feat(services-map-state): export interface for MapStateProjection * feat: add registered projections in services-map-state and adjust map-ol to use it #204 * refactor(ngx-ukis-ui-clarity): MousePosition and ProjectionSwitch to use MapStateService for projections #204 * refactor(demo-maps): projection example to use MapStateService #204 * refactor(demo-maps): examples where map-ol projections were used to MapStateService #204 * refactor: MapState projection props #204 * docs: fix naming in changelog * fix: tests for new set projection #204 * ci: try to fix publish for GitHub Packages * build: set ukis version 16.0.0-next.6 * build: update npm look * ci: try to fix WebGL error in actions test * ci: fix specify a tag when publishing a prerelease version * fix(map-ol): set init view on map in service for early subscriptions * fix(services-map-state): duplicated exported type 'TGeoExtent' removed - this was announced in v7.0.0 see CHANGELOG.md * feat(services-layers): Add nativeBbox to Layer and LayerGroup * fix(services-map-state): emit getProjection only on change #204 * fix(map-ol): set bbox and nativeBbox to olLayer for reprojecting * feat(ngx-ukis-ui-clarity): use bbox and nativeBbox in zoom to layer - LayerControl * feat: update demo-maps projection example for use of layer.nativeBbox and bbox * build: set ukis version 16.0.0-next.7 * fix(services-map-state): the state.proj should always be present, the initial values ​​are set. * fix(services-map-state): sub to project changes only if EPSG is changed. * fix(map-ol): check if cases of setLayerExtentAfterProjection and use stops for transformExtent * ci: try to fix github packages publish - env on each step * build: set ukis version v16.0.0-next.8 * fix(services-map-state): test for proj.epsg and pass fitOptions * fix: cesium developer error * fix: adjust cesium destroy function * fix: layer parameter --------- Co-authored-by: ange_lu <lucas.angermann@dlr.de>
1 parent f17586b commit 73b3d7f

66 files changed

Lines changed: 1223 additions & 496 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gh-pages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
1313
- name: Setup Pages
1414
uses: actions/configure-pages@v5
15-
- uses: actions/setup-node@v4
15+
- uses: actions/setup-node@v6
1616
with:
17-
node-version: 22
17+
node-version: 24
1818

1919
# This builds the project for projects/demo-maps and outputs the result to the 'dist' folder.
2020
# https://github.com/angular/angular-cli/issues/9016#issuecomment-526825531

.github/workflows/package-release.yml

Lines changed: 63 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
needs: checkHeadBranch_pr
3737
if: github.event_name == 'pull_request' # Only for PRs
3838
steps:
39-
# - uses: actions/checkout@v4
39+
# - uses: actions/checkout@v6
4040
# needs uses: actions/checkout@ if script/module is required
4141
- name: checkTitelTag
42-
uses: actions/github-script@v7
42+
uses: actions/github-script@v8
4343
id: get-tag
4444
with:
4545
result-encoding: string
@@ -74,14 +74,14 @@ jobs:
7474
needs: [checkHeadBranch_pr, checkTitelTag_pr]
7575
if: github.event_name == 'pull_request' && needs.checkTitelTag_pr.outputs.VERSION_TAG != ''
7676
steps:
77-
- uses: actions/checkout@v4
77+
- uses: actions/checkout@v6
7878
- name: checkout tag
7979
run: |
8080
git fetch --all --tags
8181
git checkout ${{ needs.checkTitelTag_pr.outputs.VERSION_TAG }}
82-
- uses: actions/setup-node@v4
82+
- uses: actions/setup-node@v6
8383
with:
84-
node-version: 22
84+
node-version: 24
8585
- run: rm -f .npmrc
8686
- uses: ./.github/actions/check-tag-on-npm
8787
with:
@@ -93,14 +93,14 @@ jobs:
9393
runs-on: ubuntu-latest
9494
if: needs.checkTitelTag_pr.outputs.VERSION_TAG != ''
9595
steps:
96-
- uses: actions/checkout@v4
96+
- uses: actions/checkout@v6
9797
- name: checkout tag
9898
run: |
9999
git fetch --all --tags
100100
git checkout ${{ needs.checkTitelTag_pr.outputs.VERSION_TAG }}
101-
- uses: actions/setup-node@v4
101+
- uses: actions/setup-node@v6
102102
with:
103-
node-version: 22
103+
node-version: 24
104104
- name: build
105105
run: |
106106
npm ci
@@ -117,7 +117,7 @@ jobs:
117117
needs: [build_pr]
118118
steps:
119119
- name: checkLabel
120-
uses: actions/github-script@v7
120+
uses: actions/github-script@v8
121121
with:
122122
script: |
123123
if(context.payload.pull_request.labels){
@@ -146,47 +146,62 @@ jobs:
146146
publish-gpr_pr:
147147
needs: [checkHeadBranch_pr, checkTitelTag_pr, checkTagOnNpm_pr, build_pr, checkLabel_pr, gh-release_pr]
148148
runs-on: ubuntu-latest
149+
permissions:
150+
packages: write
151+
contents: read
149152
steps:
150-
- uses: actions/checkout@v4
153+
- uses: actions/checkout@v6
151154
- name: Download dist result from job build
152155
uses: actions/download-artifact@v4
153156
with:
154157
name: "dist"
155158
path: dist
156-
- uses: actions/setup-node@v4
159+
- uses: actions/setup-node@v6
157160
with:
158-
node-version: 22
161+
node-version: 24
159162
registry-url: https://npm.pkg.github.com/
160163
scope: "@dlr-eoc"
161164
- run: npm ci
162165
### update npm to >8.19 for publish https://github.com/npm/cli/issues/2453 https://github.com/npm/cli/issues/3573
163166
- run: npm i -g npm@latest # Latest npm for trusted publishing
164-
- run: rm -f .npmrc
167+
- name: Check if .npmrc is there and delete file if it exists
168+
id: check_and_delete_npmrc
169+
run: |
170+
FILE_PATH=".npmrc"
171+
if [ -f "$FILE_PATH" ]; then
172+
echo "File exists: $FILE_PATH"
173+
rm -f "$FILE_PATH"
174+
echo "File deleted."
175+
else
176+
echo "File does not exist: $FILE_PATH"
177+
fi
165178
### for each module in dist update package.json and create .npmrc
166179
- run: node scripts/library/index.js --update-package=https://npm.pkg.github.com/
180+
env:
181+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
167182
### for each module in dist publish frontend-libraries to registry
168183
- run: |
169184
for dir in ./dist/*/;
170185
do
171186
dir=${dir%*/}
172-
npm publish "$dir" --access public --tag "latest" --provenance
187+
npm publish "$dir" --access public --tag "latest"
173188
done
174189
env:
175-
AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
190+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
176191
177192
publish-npm_pr:
178193
needs: [checkHeadBranch_pr, checkTitelTag_pr, checkTagOnNpm_pr, build_pr, checkLabel_pr, gh-release_pr]
179194
runs-on: ubuntu-latest
180195
steps:
181-
- uses: actions/checkout@v4
196+
- uses: actions/checkout@v6
182197
- name: Download dist result from job build
183198
uses: actions/download-artifact@v4
184199
with:
185200
name: "dist"
186201
path: dist
187-
- uses: actions/setup-node@v4
202+
- uses: actions/setup-node@v6
188203
with:
189-
node-version: 22
204+
node-version: 24
190205
registry-url: https://registry.npmjs.org/
191206
scope: "@dlr-eoc"
192207
- run: npm ci
@@ -212,10 +227,10 @@ jobs:
212227
if: github.event_name == 'push'
213228
steps:
214229
# check out before using actions reference from the same repository!
215-
- uses: actions/checkout@v4
216-
- uses: actions/setup-node@v4
230+
- uses: actions/checkout@v6
231+
- uses: actions/setup-node@v6
217232
with:
218-
node-version: 22
233+
node-version: 24
219234
- run: rm -f .npmrc
220235
- uses: ./.github/actions/check-tag-on-npm
221236
with:
@@ -226,10 +241,10 @@ jobs:
226241
needs: [checkTagOnNpm_push]
227242
runs-on: ubuntu-latest
228243
steps:
229-
- uses: actions/checkout@v4
230-
- uses: actions/setup-node@v4
244+
- uses: actions/checkout@v6
245+
- uses: actions/setup-node@v6
231246
with:
232-
node-version: 22
247+
node-version: 24
233248
- uses: ./.github/actions/test
234249
- name: build
235250
run: |
@@ -258,48 +273,63 @@ jobs:
258273
publish-gpr_push:
259274
needs: [gh-release_push, build_push]
260275
runs-on: ubuntu-latest
276+
permissions:
277+
packages: write
278+
contents: read
261279
steps:
262-
- uses: actions/checkout@v4
280+
- uses: actions/checkout@v6
263281
- name: Download dist result from job build
264282
uses: actions/download-artifact@v4
265283
with:
266284
name: "dist"
267285
path: dist
268-
- uses: actions/setup-node@v4
286+
- uses: actions/setup-node@v6
269287
with:
270-
node-version: 22
288+
node-version: 24
271289
registry-url: https://npm.pkg.github.com/
272290
scope: "@dlr-eoc"
273291
- run: npm ci
274292
### update npm to >8.19 for publish https://github.com/npm/cli/issues/2453 https://github.com/npm/cli/issues/3573
275293
- run: npm i -g npm@latest # Latest npm for trusted publishing
276-
- run: rm -f .npmrc
294+
- name: Check if .npmrc is there and delete file if it exists
295+
id: check_and_delete_npmrc
296+
run: |
297+
FILE_PATH=".npmrc"
298+
if [ -f "$FILE_PATH" ]; then
299+
echo "File exists: $FILE_PATH"
300+
rm -f "$FILE_PATH"
301+
echo "File deleted."
302+
else
303+
echo "File does not exist: $FILE_PATH"
304+
fi
277305
### for each module in dist update package.json and create .npmrc
278306
- run: node scripts/library/index.js --update-package=https://npm.pkg.github.com/
307+
env:
308+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
279309
### for each module in dist publish frontend-libraries to registry
280310
- run: |
281311
# Pre-release: use tag next
282312
for dir in ./dist/*/
283313
do
284314
dir=${dir%*/}
285-
npm publish "$dir" --access public --tag "next" --provenance
315+
npm publish "$dir" --access public --tag "next"
286316
done
287317
env:
288-
AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
318+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
289319
290320
publish-npm_push:
291321
needs: [gh-release_push, build_push]
292322
runs-on: ubuntu-latest
293323
steps:
294-
- uses: actions/checkout@v4
324+
- uses: actions/checkout@v6
295325
- name: Download dist result from job build
296326
uses: actions/download-artifact@v4
297327
with:
298328
name: "dist"
299329
path: dist
300-
- uses: actions/setup-node@v4
330+
- uses: actions/setup-node@v6
301331
with:
302-
node-version: 22
332+
node-version: 24
303333
registry-url: https://registry.npmjs.org/
304334
scope: "@dlr-eoc"
305335
- run: npm ci

.github/workflows/test-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: actions/setup-node@v4
19+
- uses: actions/checkout@v6
20+
- uses: actions/setup-node@v6
2121
with:
22-
node-version: 22
22+
node-version: 24
2323
- uses: ./.github/actions/test
2424
- uses: ./.github/actions/build

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@
1919
- Removed `pipes` and moved it to new library `@dlr-eoc/ngx-ukis-utilities` [Issue #267](https://github.com/dlr-eoc/ukis-frontend-libraries/issues/267).
2020

2121
* **@dlr-eoc/ngx-ukis-ui-clarity:**
22-
- Input `mapStateSvc` was removed from `<ukis-projection-switch>`! Input `fitViewToNewExtent` is now triggered by `mapSvc.setProjection`.
22+
- Input `mapStateSvc` on `<ukis-projection-switch>` was renamed to `mapState`! Input `fitViewToNewExtent` is now triggered by `mapSvc.setProjection`.
23+
24+
- MousePositionComponent need now Inputs `<ukis-mouse-position [mapSvc]="mapSvc" [mapState]="mapStateSvc">`
25+
26+
* **@dlr-eoc/map-ol:**
27+
- Params of `setProjection(projection: olProjection | string)` changed to `setProjection(projection: IProjDef | string, options?: IProjFitOptions)` in `MapOlService`. This allows the registration of proj4 definitions for projections from `IProjDef`. The options `IProjFitOptions` allow to zomm to a bbox on setProjection or zomm to the ProjectionExtent.
28+
29+
* **@dlr-eoc/map-cesium:**
30+
- `MapCesiumService.getCurrentExtent()` param `geographic?: boolean` is removed because it was not used.
2331

2432
### Bug Fixes
2533
* **@dlr-eoc/map-maplibre:**
@@ -43,7 +51,7 @@
4351
- use `clr-number-input-container` instead of `clr-input-container` for input of `type="number"`.
4452

4553
* **@dlr-eoc/map-ol:**
46-
- Fix `setProjection` zoom to old bbox. Add new param `fitToProjectionExtent` on `setProjection` to zoom to new projection extent.
54+
- Use 8 stops for all OpenLayers `transformExtent()` functions to sample more points along the edges for better results. Should have only minimal perf hit. This corrects some calculations of extents from WGS84 to other projections. For example, in `setProjection`, new extents for layers are more precise and layers are no longer clipped.
4755

4856
### Features
4957
- Remove `standalone: true` Angular directives, components and pipes are now standalone by default since version 19.
@@ -52,6 +60,7 @@
5260
* **@dlr-eoc/ngx-ukis-ui-clarity:**
5361
- New UKIS library for ui-clarity related things was added.
5462
- It includes all components of `@dlr-eoc/layer-control`, `@dlr-eoc/map-tools`, `@dlr-eoc/user-info` [Issue #267](https://github.com/dlr-eoc/ukis-frontend-libraries/issues/267).
63+
- Adjust `LayerentryComponent` and `LayerentryGroupComponent` to use `nativeBbox` of types `services-layers`.
5564

5665
* **@dlr-eoc/ngx-ukis-utilities:**
5766
- New UKIS library for angular utilities was added.
@@ -60,9 +69,16 @@
6069

6170
* **@dlr-eoc/map-ol:**
6271
- Remove dependency on @cds/core [Issue #267](https://github.com/dlr-eoc/ukis-frontend-libraries/issues/267).
72+
- Use `nativeBbox` of types `services-layers` to create `olLayerOptions.extent` for layers. Use it also in `CustomLayer` to create `olLayerOptions.extent` and for olLayerGroups.
6373

6474
* **@dlr-eoc/services-layers:**
6575
- Add `properties` attribute to Layer type
76+
- Add `nativeBbox?: {epsg: string, bbox: TGeoExtent}` to `Layer` and `LayerGroup`. This can be helpful when zooming to the extent of a projected layer.
77+
78+
* **@dlr-eoc/services-map-state:**
79+
- Export constants for `WebMercator`, `WGS84` and interface `IProjDef` and some projections `EPSG_3031_Def`, `EPSG_3995_Def`, `EPSG_3857_Def` and `EPSG_4326_Def`.
80+
- Add projection object to `MapState` [Issue #204](https://github.com/dlr-eoc/ukis-frontend-libraries/issues/204)
81+
- Add functionality to `setProjection`, `registerProjection` and set `nativeExtent` (not WGS84) in `MapStateService`. Now this can be used instead of the functions in `MapOlService` [Issue #204](https://github.com/dlr-eoc/ukis-frontend-libraries/issues/204).
6682

6783
# [15.0.0](https://github.com/dlr-eoc/ukis-frontend-libraries/tree/v15.0.0) (2024-12-31) (angular update, @clr and @cds update, layer-control, map-ol)
6884

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<img src="projects/ngx-ukis-ui-clarity/schematics/ng-add/files/src/assets/icons/icon-72x72.png" alt="UKIS Logo"> Frontend Libraries for DLR UKIS (Map) Applications
22
========================
33

4-
![CI](https://github.com/dlr-eoc/ukis-frontend-libraries/workflows/Test%20and%20Build%20CI/badge.svg)
4+
![CI](https://github.com/dlr-eoc/ukis-frontend-libraries/actions/workflows/package-release.yml/badge.svg)
55
![Npm Package](https://github.com/dlr-eoc/ukis-frontend-libraries/workflows/Package%20Main%20Release/badge.svg) ![Package Version](https://img.shields.io/github/v/tag/dlr-eoc/ukis-frontend-libraries?sort=semver)
66
[![DOI](https://zenodo.org/badge/246639318.svg)](https://zenodo.org/badge/latestdoi/246639318)
77

0 commit comments

Comments
 (0)