Skip to content

Commit cb9d814

Browse files
authored
Merge pull request #547 from geoadmin/develop
New Release v1.4.0 - #minor
2 parents a1b4aac + eb5677e commit cb9d814

File tree

291 files changed

+19101
-19722
lines changed

Some content is hidden

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

291 files changed

+19101
-19722
lines changed

.env.development

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ VITE_API_SERVICES_BASE_URL=https://sys-map.dev.bgdi.ch/api/
99
VITE_API_SERVICE_KML_BASE_URL=https://sys-public.dev.bgdi.ch/
1010
VITE_API_SERVICE_KML_STORAGE_BASE_URL=https://sys-public.dev.bgdi.ch/
1111
VITE_APP_API_SERVICE_SHORTLINK_BASE_URL=https://sys-s.dev.bgdi.ch/
12+
VITE_APP_3D_TILES_BASE_URL=https://sys-3d.dev.bgdi.ch/
13+
VITE_APP_VECTORTILES_BASE_URL=https://sys-verctortiles.dev.bgdi.ch/

.env.integration

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ VITE_API_SERVICES_BASE_URL=https://sys-map.int.bgdi.ch/api/
88
VITE_API_SERVICE_KML_BASE_URL=https://sys-public.int.bgdi.ch/
99
VITE_API_SERVICE_KML_STORAGE_BASE_URL=https://sys-public.int.bgdi.ch/
1010
VITE_APP_API_SERVICE_SHORTLINK_BASE_URL=https://sys-s.int.bgdi.ch/
11+
VITE_APP_3D_TILES_BASE_URL=https://sys-3d.int.bgdi.ch/
12+
VITE_APP_VECTORTILES_BASE_URL=https://sys-verctortiles.int.bgdi.ch/

.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ VITE_API_SERVICES_BASE_URL=https://map.geo.admin.ch/api/
88
VITE_API_SERVICE_KML_BASE_URL=https://public.geo.admin.ch/
99
VITE_API_SERVICE_KML_STORAGE_BASE_URL=https://public.geo.admin.ch/
1010
VITE_APP_API_SERVICE_SHORTLINK_BASE_URL=https://s.geo.admin.ch/
11+
VITE_APP_3D_TILES_BASE_URL=https://3d.geo.admin.ch/
12+
VITE_APP_VECTORTILES_BASE_URL=https://vectortiles.geo.admin.ch/

.eslintrc.js

+32-5
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,47 @@ require('@rushstack/eslint-patch/modern-module-resolution')
33

44
module.exports = {
55
root: true,
6+
ignorePatterns: ['node_modules', '.github', 'dist'],
67
extends: [
8+
'eslint:recommended',
79
'plugin:vue/vue3-recommended',
10+
'plugin:cypress/recommended',
811
'prettier',
912
],
1013
env: {
14+
node: true,
1115
'vue/setup-compiler-macros': true,
1216
},
17+
rules: {
18+
'no-unused-vars': [
19+
'error',
20+
{
21+
argsIgnorePattern: '^_',
22+
destructuredArrayIgnorePattern: '^_',
23+
},
24+
],
25+
},
26+
globals: {
27+
VITE_ENVIRONMENT: true,
28+
__APP_VERSION__: true,
29+
},
1330
overrides: [
1431
{
15-
files: ['cypress/integration/**.spec.{js,ts,jsx,tsx}'],
16-
extends: ['plugin:cypress/recommended'],
17-
plugins: [
18-
"cypress"
19-
],
32+
files: ['tests/**/*.{js,ts,jsx,tsx}', 'src/**/__test__/**/*.spec.js'],
33+
rules: {
34+
'no-prototype-builtins': 'off',
35+
},
36+
},
37+
{
38+
files: ['*.md'],
39+
excludedFiles: ['LICENSE.md'],
40+
parser: 'eslint-plugin-markdownlint/parser',
41+
extends: ['plugin:markdownlint/recommended'],
42+
rules: {
43+
'markdownlint/md013': 'off',
44+
'markdownlint/md028': 'off',
45+
'no-irregular-whitespace': 'off',
46+
},
2047
},
2148
],
2249
}

.github/workflows/add-testlink-to-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Create/update test link on DEV
14-
if: ${{ github.base_ref == 'develop' }}
14+
if: ${{ github.base_ref == 'develop' || startsWith(github.base_ref, 'develop-') }}
1515
uses: tzkhan/pr-update-action@v2
1616
with:
1717
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ tests/results/*
3030

3131
# Git
3232
*.orig
33+
34+
# script check-external-layers-providers.mjs
35+
scripts/check-layer-providers-results/*invalid_providers_cors.yaml
36+
scripts/check-layer-providers-results/*invalid_providers.yaml
37+
scripts/check-layer-providers-results/*invalid_providers_wms.yaml
38+
scripts/check-layer-providers-results/*invalid_providers_wmts.yaml
39+
scripts/check-layer-providers-results/*invalid_providers_content.yaml
40+
scripts/check-layer-providers-results/*valid_providers.json

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"trailingComma": "es5",
66
"tabWidth": 4,
77
"jsxSingleQuote": false,
8+
"plugins": ["prettier-plugin-jsdoc"],
89
"overrides": [{
910
"files": "*.md",
1011
"options": {

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ This tag will be a bump in :
3939

4040
CI is managed by AWS CodeBuild.
4141

42-
- Every merge (commit) on `develop` will trigger a deploy on https://sys-map.dev.bgdi.ch/ by the CI
43-
- Every merge (commit) on `master` will trigger a deploy on https://sys-map.int.bgdi.ch/ by the CI
42+
- Every merge (commit) on `develop` will trigger a deploy on <https://sys-map.dev.bgdi.ch/> by the CI
43+
- Every merge (commit) on `master` will trigger a deploy on <https://sys-map.int.bgdi.ch/> by the CI
4444

4545
### structure/architecture of the app
4646

LICENSE.md

-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ Portions of web-mapviewer are based on works by others. A non-extensive list:
3131
[Font Awesome Fonts](https://scripts.sil.org/OFL)
3232

3333
[Font Awesome Code](https://opensource.org/licenses/MIT)
34-

README.md

+126-39
Large diffs are not rendered by default.

ROADMAP.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,61 @@
11
# Roadmap
22

3-
Geo.admin.ch, in particular the map viewer of the Geoportal Bund https://map.geo.admin.ch, is being used actively (80K visits/day) by the public, authorities and third parties in version [mf-geoadmin3](https://github.com/geoadmin/mf-geoadmin3) and covers all functions according to the currently valid [NGDI](https://cms.geo.admin.ch/www.e-geo.ch/archives/pdf_egeo_de/ngdigesamtkonzeptv2.0.pdf) concept.
3+
Geo.admin.ch, in particular the map viewer of the Geoportal Bund <https://map.geo.admin.ch>, is being used actively (80K visits/day) by the public, authorities and third parties in version [mf-geoadmin3](https://github.com/geoadmin/mf-geoadmin3) and covers all functions according to the currently valid [NGDI](https://cms.geo.admin.ch/www.e-geo.ch/archives/pdf_egeo_de/ngdigesamtkonzeptv2.0.pdf) concept.
44

55
geo.admin.ch receives a large number of feature requests, both from inside federal offices and from the broader open-source community. At the same time, backend, services and viewer (frameworks version used such as angular, python, cesium etc ) of mf-geoadmin3 are at the end of their life cycle and must be replaced. We bring together representatives from authorites coordinating agency for Federal geographical information, [GCG](https://www.geo.admin.ch/gkg), and engineering to prioritize this list. As new projects come into the queue, we regularly position them based on relative priority to other projects. As work gets done, projects will move up in the queue.
66

77
The projects below are not associated with a particular map.geo.admin.ch version. We'll release them on completion, and they will be part of a specific version based on our release schedule, following semantic versioning. For example, features are released in the next minor after they are complete, or the next major if they include breaking changes.
88

9-
### Done
10-
#### Create basic application structure
9+
## Done
10+
11+
### Create basic application structure
12+
1113
We are setting up JS Code Structure, a bare map viewer with panning and investigate PWA technologies. This includes a set up of CI/CD and deployment processes. To ease collaboration , basic documentation is implemented
1214

1315
#### Basic mapviewer with MVP feature set
16+
1417
A basic viewer consisting of basic Permalink,/ URL mgmt., basic dataset mgmt., basic infoboxes (incl improvements), basic drawing, basic iFrame support and basic 3D.
1518

1619
#### Draw & measure functions
20+
1721
We will redefine the user learning journeys and refresh the approach to Add symbol, Add text, Add line / polygon, Measure, Measure Azimut, Profile, Share drawing / KML
1822

1923
### In progress
24+
2025
#### Map window
26+
2127
We will redefine the user learning journeys and refresh the approach to change language, display coordinates/ show mouse positons, Zoom to rectangle, copyright and possibly fullscreen.
2228

2329
#### Navigation & orientation
30+
2431
We will redefine the user learning journeys and refresh the approach to Geographical search (centre on coordinates), Geographical search (place name or postcode),Geolocation,
2532

2633
#### Selection and display of data
27-
We will redefine the user learning journeys and refresh the approach to Full text search for data, Search for data attributes, Topic switcher, Search for data (catalogue/topics), Change the cartographic background, Change the visibility of the selected dataset, Change the order of the selected datasets, Remove selected datasets, View additional information about a data-set. View information about an object on the map , View information about an object on the map including highly customized tooltips with logic and dynamic data fetching) (EXPERTTOOLTIP), Position information, Aerial photography, Time slider, Time copy/compare.
34+
35+
We will redefine the user learning journeys and refresh the approach to Full text search for data, Search for data attributes, Topic switcher, Search for data (catalogue/topics), Change the cartographic background, Change the visibility of the selected dataset, Change the order of the selected datasets, Remove selected datasets, View additional information about a data-set. View information about an object on the map , View information about an object on the map including highly customized tooltips with logic and dynamic data fetching) (EXPERTTOOLTIP), Position information, Aerial photography, Time slider, Time copy/compare.
2836

2937
#### Linking & integration
38+
3039
We will redefine the user learning journeys and refresh the approach to Send/save/iFrame of the current map, Save/send a link to an object, Use parameters to call up a map (incl. drawings, external ogc layers), Mobile, Mobile Add link to homescreen/App, Mobile Offline SAVE VIEW DELETE.
3140

3241
### Future
42+
3343
#### 3D
44+
3445
We will redefine the user learning journeys and refresh the approach to Navigation, Mouse position, Feature tooltip, WMS import: preset, WMS import: permalink, KML import, Time support vector, Time support Raster.
3546

3647
#### Advanced functions
48+
3749
We will redefine the user learning journeys and refresh the approach to Import preset, Import URL WMS/WMTS/GeoJSON and KML, import: PRINT, Import permalink, Compare, Keyboard shortcuts, Report problem, Landscape mode (mobile)
3850

3951
#### Print
52+
4053
We will redefine the user learning journeys and refresh the approach to Print and Printing grids and annotation
4154

4255
#### 3D nextgen
56+
4357
We will define the user learning journeys to shadow calculation
4458

4559
#### Draw & measure functions nextgen
60+
4661
We will define the user learning journeys to shadow snapping and routing
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Please refer to https://github.com/geoadmin/doc-guidelines/blob/master/adr/2020_04_06_next_gen_viewer.md
1+
# Javascript Framework Choice
2+
3+
Please refer to <https://github.com/geoadmin/doc-guidelines/blob/master/adr/2020_04_06_next_gen_viewer.md>

adr/2020_05_28_test_framework.md

-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Good alternative to Selenium, is compatible with Saucelab (we already have some
2929

3030
This could also be a good cross browser testing framework, but the cross browser feature will be hard to have deployed on every developers' machine.
3131

32-
3332
### Cypress
3433

3534
Made by devs for devs.
@@ -39,7 +38,6 @@ Made by devs for devs.
3938
- Solid and clear documentation
4039
- Newest addition (2017) to the big frameworks (very active community)
4140

42-
4341
## Decision
4442

4543
After playing a bit with these frameworks, Cypress clearly had something for it.
@@ -49,7 +47,6 @@ The documentation is well maintained and complete, tests are described with Moch
4947
Cypress will be a great help during the development phase of the new viewer.
5048
But we have to keep in mind that it doesn't really do cross browser testing.
5149

52-
5350
## Consequences
5451

5552
We start to use Cypress as our Unit test and integration test framework.

adr/2021_03_16_url_param_structure.md

+23-13
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
55
> Date: 16.03.2021
66
7+
> Updated: 17.11.2023
8+
79
## Context
810

911
The mapviewer application is configured with several URL parameters. The current format for the layer configuration looks as follows (example for topic "Snow"):
1012

11-
```
13+
```text
1214
...
1315
layers=ch.swisstopo.pixelkarte-farbe-winter,ch.swisstopo.hangneigung-ueber_30,ch.swisstopo-karto.hangneigung,ch.bafu.wrz-jagdbanngebiete_select,ch.bafu.wrz-wildruhezonen_portal,ch.bazl.gebirgslandeplaetze,ch.swisstopo.schneeschuhwandern,ch.swisstopo-karto.schneeschuhrouten,ch.swisstopo-karto.skitouren,ch.swisstopo.skitourenkarte-50.metadata,ch.bav.haltestellen-oev&
1416
layers_opacity=0.85,0.5,0.2,0.6,0.6,1,0.7,0.8,0.8,1,1&
@@ -18,7 +20,7 @@ layers_visibility=true,false,true,true,true,false,true,true,true,false,false
1820

1921
and including layers with different timestamps probably also
2022

21-
```
23+
```text
2224
layers_timestamp=18641231,,,
2325
```
2426

@@ -33,7 +35,7 @@ The current format has some limitations:
3335

3436
The new format looks as follows (in the generic form):
3537

36-
```
38+
```text
3739
layers={layerID1},{visibility=t|f},{opacity=%f};{layerID2},{visibility=t|f},{opacity=%f}
3840
```
3941

@@ -56,7 +58,7 @@ In case a wrong format is given, the errors are printed on the console.
5658

5759
The above example boils down to the following (given that all opacity values are the defaults defined in the topic):
5860

59-
```
61+
```text
6062
...
6163
layers=ch.swisstopo.pixelkarte-farbe-winter;
6264
ch.swisstopo.hangneigung-ueber_30,f;
@@ -87,15 +89,23 @@ The timestamp format must be ISO8601 compliant, i.e.
8789
- `YYYY-MM-DDThh:mm:ss.sss`
8890
- `YYYY-MM-DDThh:mm:ss+hh:mm`
8991

90-
External Layers are in the following format (note that only one `|` is used and the WMS order is changed to have consistently `TYPE|URL|OTHER OPTIONS`)
91-
92-
- an external WMS: `WMS|wms.geo.gr.ch%2Fadmineinteilung%3F|Gemeinden,layerb,layerc|1.3.0|Gemeinden`
93-
- an external WMTS: `WMTS|wmts.geo.ti.ch%2Fwmts%2F1.0.0%2FWMTSCapabilities.xml|ch.ti.051_1.piano_registro_fondiario_catasto_rdpp@time=18641231|Optionales Label`
94-
- an external KML: `KML|www.slf.ch/avalanche/accidents/accidents_season_de.kml|Mein Titel`
95-
- a geoadmin KML: `KML|public.geo.admin.ch/api/files/KML_ID|Mein Titel`
96-
- a geoadmin KML with adminId: `KML|public.geo.admin.ch/api/files/KML_ID|Mein Titel@adminId=ADMIN_ID`
97-
- an external GPX: `GPX|www.slf.ch/avalanche/accidents/accidents_season_de.gpx`
98-
- an external KMZ: `KMZ|www.slf.ch/avalanche/accidents/accidents_season_de.kmz` (needs to pass by proxy to be unzipped)
92+
### External Layers
93+
94+
The layer ID of the external Layers are in the following format (note that only one `|` is used and the WMS order is changed to have consistently `TYPE|URL|OTHER OPTIONS`)
95+
96+
- an external WMS: `WMS|GET_CAP_BASE_URL|LAYER_ID`
97+
- The WMS version is taken from the Get Capabilities
98+
- an external WMTS: `WMTS|GET_CAP_BASE_URL|LAYER_ID`
99+
- The WMTS version is taken from the Get Capabilities
100+
- an external KML: `KML|URL|TITLE`
101+
- TITLE is optional and used as display in the active layers, if omitted then it will be displayed as `KML`
102+
- a geoadmin KML: `KML|URL|TITLE`
103+
- TITLE is set to `Drawing` upon drawing creation and in the current language at that time
104+
- a geoadmin KML with adminId: `KML|URL|TITLE@adminId=ADMIN_ID`
105+
- an external GPX: `GPX|GPX|TITLE`
106+
- TITLE is optional and used as display in the active layers, if omitted then it will be displayed as `GPX`
107+
- an external KMZ: `KMZ|KMZ|TITLE` (needs to pass by proxy to be unzipped)
108+
- TITLE is optional and used as display in the active layers, if omitted then it will be displayed as `KMZ`
99109

100110
## Consequences
101111

adr/2021_04_14_drawing_library.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ This leaves us with the OpenLayers approach, that has already proven itself on t
3030

3131
Development of the drawing module can now start with OpenLayers as its backbone.
3232

33-
In order to make it clear it is a different module as the map module, we will inject the current OpenLayers map instance with [Vue's provide/inject](https://v3.vuejs.org/guide/component-provide-inject.html)
33+
In order to make it clear it is a different module as the map module, we will inject the curren/component-provide-inject.html)

adr/2022_05_09_mobile_click_behavior.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Currently, a short click will switch the app in fullscreen mode. A long click (w
1010

1111
The issue is that there is no location popup possibilities with that (or at least it's unwanted if it pops up after a long click). We need to rework that.
1212

13-
# Decision
13+
## Decision
1414

1515
- Mobile layout (menu must be opened through header button)
1616
- Single touch (click) : identify, if no feature found, fullscreen toggle
@@ -26,5 +26,5 @@ This would allow mobile users to use all the features we provide (identify, loca
2626

2727
## Links
2828

29-
* [JIRA ticket this ADR is based on](https://jira.swisstopo.ch/browse/BGDIINF_SB-2235)
30-
* [JIRA ticket where this became a problem](https://jira.swisstopo.ch/browse/BGDIINF_SB-2323)
29+
- [JIRA ticket this ADR is based on](https://jira.swisstopo.ch/browse/BGDIINF_SB-2235)
30+
- [JIRA ticket where this became a problem](https://jira.swisstopo.ch/browse/BGDIINF_SB-2323)

adr/2023_11_08_vue_composition_api.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Vue Composition API
2+
3+
> Status: accepted
4+
5+
> Date: 08.11.2023
6+
7+
## Context
8+
9+
Vue3 is already our Vue version for a while, but we haven't yet utilized all its potential. One of them is to use the Composition API, which is a more succinct way of describing components (less boilerplate code).
10+
Composition API should help us, in many cases, to build more reusable portions of code (replacing the mixins for instance, which is a quite confusing concept)
11+
12+
This, in return, gives new challenges as it doesn't force us to structure our component in the same way (props, computed, etc...) through the linter.
13+
14+
## Decision
15+
16+
We will now be using the Composition API for new components, and transform Option API components into Composition API when extensive work is required on them
17+
18+
## Consequences
19+
20+
- New components should be written with the Composition API
21+
- `<script setup>` tag should be the first tag of the `.vue` file (instead of `<template>`, that's the new best practice with this approach)
22+
- declares things in this order in the `<script setup>` tag
23+
- imports
24+
- props (input)
25+
- store link (input)
26+
- computed (transformation of inputs)
27+
- life-cycle hooks (mounted and such)
28+
- interaction with the user (was called `methods` in the OptionAPI)
29+
- Components that are extensively edited should be rewritten using the Composition API

cypress.config.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { defineConfig } from 'cypress'
22
import vitePreprocessor from 'cypress-vite'
3-
import { readdirSync, existsSync, unlinkSync } from 'node:fs'
3+
import { existsSync, readdirSync, unlinkSync } from 'node:fs'
44
import { join } from 'node:path'
55
import { cypressBrowserPermissionsPlugin } from 'cypress-browser-permissions'
66

77
module.exports = defineConfig({
88
video: false,
9-
defaultCommandTimeout: 10000,
10-
requestTimeout: 15000,
11-
numTestsKeptInMemory: 5,
9+
defaultCommandTimeout: 5000,
10+
requestTimeout: 5000,
11+
numTestsKeptInMemory: 2,
1212
retries: {
13-
runMode: 5,
13+
runMode: 1,
1414
openMode: 0,
1515
},
1616
reporter: 'cypress-multi-reporters',
@@ -74,6 +74,6 @@ module.exports = defineConfig({
7474
},
7575
baseUrl: 'http://localhost:8080',
7676
specPattern: 'tests/e2e-cypress/integration/**/*.*',
77-
supportFile: 'tests/e2e-cypress/support/index.js'
77+
supportFile: 'tests/e2e-cypress/support/index.js',
7878
},
7979
})

0 commit comments

Comments
 (0)