@geogirafe/lib-geoportal 1.3.0-dev.3053452205 → 1.3.0-dev.3079206142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +1 -0
  2. package/assets/i18n/de.json +33 -3
  3. package/assets/i18n/en.json +32 -2
  4. package/assets/i18n/fr.json +34 -4
  5. package/assets/i18n/it.json +36 -6
  6. package/assets/icons/edit.svg +1 -1
  7. package/assets/icons/lock.svg +1 -0
  8. package/components/cross-section/cross-section-settings/component.js +1 -1
  9. package/components/edit/component.d.ts +52 -36
  10. package/components/edit/component.js +340 -292
  11. package/components/edit/editcomponentstate.d.ts +1 -0
  12. package/components/edit/editcomponentstate.js +1 -0
  13. package/components/edit/editform/component.d.ts +33 -4
  14. package/components/edit/editform/component.js +218 -37
  15. package/components/edit/editform/style.css +51 -16
  16. package/components/edit/geometryedithelper.d.ts +47 -0
  17. package/components/edit/geometryedithelper.js +324 -0
  18. package/components/edit/style.css +71 -28
  19. package/components/main.d.ts +1 -1
  20. package/components/main.js +1 -1
  21. package/components/print/component.d.ts +1 -1
  22. package/components/treeview/tools/treeviewelement.d.ts +1 -0
  23. package/components/treeview/tools/treeviewelement.js +22 -0
  24. package/components/treeview/treeviewitem/component.js +7 -1
  25. package/models/gmf.d.ts +18 -2
  26. package/models/gmf.js +3 -1
  27. package/models/layers/editablelayer.d.ts +7 -0
  28. package/models/layers/editablelayer.js +7 -0
  29. package/models/layers/layerwms.d.ts +1 -2
  30. package/models/layers/layerwms.js +4 -8
  31. package/models/main.d.ts +9 -4
  32. package/models/main.js +6 -2
  33. package/models/oapiflayer.d.ts +29 -0
  34. package/models/oapiflayer.js +40 -0
  35. package/models/oapiftypes.d.ts +71 -0
  36. package/models/oapiftypes.js +29 -0
  37. package/models/serverogc.d.ts +5 -3
  38. package/models/serverogc.js +19 -6
  39. package/models/serverogcapi.d.ts +2 -0
  40. package/models/serverogcapi.js +2 -0
  41. package/models/serverogcapifeatures.d.ts +5 -62
  42. package/models/serverogcapifeatures.js +8 -4
  43. package/package.json +1 -1
  44. package/templates/index.html +1 -0
  45. package/templates/public/about.json +1 -1
  46. package/tools/app/geogirafeapp.js +2 -2
  47. package/tools/drawing/olDrawing.js +2 -22
  48. package/tools/drawing/shapeConstraints.d.ts +2 -1
  49. package/tools/drawing/shapeConstraints.js +18 -2
  50. package/tools/main.d.ts +7 -5
  51. package/tools/main.js +7 -5
  52. package/tools/ogcapi/ogcapiclient.d.ts +7 -3
  53. package/tools/ogcapi/ogcapiclient.js +49 -4
  54. package/tools/ogcapi/ogcapiconformance.d.ts +2 -2
  55. package/tools/ogcapi/ogcapiconformance.js +7 -13
  56. package/tools/ogcapi/ogcapifeaturesclient.d.ts +65 -30
  57. package/tools/ogcapi/ogcapifeaturesclient.js +265 -139
  58. package/tools/ogcapi/ogcapifeaturesclientgeorama.d.ts +0 -5
  59. package/tools/ogcapi/ogcapifeaturesclientgeorama.js +0 -11
  60. package/tools/ogcapi/ogcapifeaturesclientqgis.d.ts +8 -0
  61. package/tools/ogcapi/ogcapifeaturesclientqgis.js +13 -0
  62. package/tools/ogcapi/ogcapifeaturesmanager.d.ts +61 -8
  63. package/tools/ogcapi/ogcapifeaturesmanager.js +179 -30
  64. package/tools/ogcapi/ogcapifeaturesschema.d.ts +31 -13
  65. package/tools/ogcapi/ogcapifeaturesschema.js +69 -39
  66. package/tools/ogcapi/ogcapifeaturesschemaproperty.d.ts +44 -0
  67. package/tools/ogcapi/ogcapifeaturesschemaproperty.js +137 -0
  68. package/tools/ogcapi/ogcapifeaturesschemavalidator.d.ts +22 -0
  69. package/tools/ogcapi/ogcapifeaturesschemavalidator.js +121 -0
  70. package/tools/state/state.d.ts +6 -0
  71. package/tools/state/state.js +4 -0
  72. package/tools/themes/themesmanager.d.ts +10 -3
  73. package/tools/themes/themesmanager.js +29 -9
  74. package/tools/time/layertimeformatter.d.ts +0 -5
  75. package/tools/time/layertimeformatter.js +10 -19
  76. package/tools/utils/dateutils.d.ts +40 -0
  77. package/tools/utils/dateutils.js +111 -0
  78. package/tools/utils/utils.d.ts +4 -0
  79. package/tools/utils/utils.js +12 -0
  80. package/tools/wfs/wfsmanager.js +3 -0
  81. package/tools/wms/wmsclient.d.ts +1 -0
  82. package/tools/wms/wmsclient.js +4 -0
  83. package/tools/ogcapi/demolayers.d.ts +0 -1
  84. package/tools/ogcapi/demolayers.js +0 -99
  85. package/tools/ogcapi/ogcapifeaturesclientgmf.d.ts +0 -13
  86. package/tools/ogcapi/ogcapifeaturesclientgmf.js +0 -30
@@ -50,6 +50,10 @@ export declare const rgbStrToRgbaArray: (rgbaStr: string) => [number, number, nu
50
50
  * @returns an array of rgba values: R, G, B [0-255] and alpha [0-1]. Or null if the color isn't in a valid format.
51
51
  */
52
52
  export declare const colorToRgbaArray: (color: string) => [number, number, number, number] | null;
53
+ /**
54
+ * Transform an array of rgb(a) values to a rgb(a) string.
55
+ */
56
+ export declare const rgbaArrayToString: (color: number[]) => string | null;
53
57
  /**
54
58
  * Check whether the provided text is a matching the correct email form
55
59
  */
@@ -114,6 +114,18 @@ export const colorToRgbaArray = (color) => {
114
114
  rgbaColor ??= rgbStrToRgbaArray(color);
115
115
  return rgbaColor;
116
116
  };
117
+ /**
118
+ * Transform an array of rgb(a) values to a rgb(a) string.
119
+ */
120
+ export const rgbaArrayToString = (color) => {
121
+ if (color.length === 4) {
122
+ return `rgba(${color.join(',')})`;
123
+ }
124
+ if (color.length === 3) {
125
+ return `rgb(${color.join(',')})`;
126
+ }
127
+ return null;
128
+ };
117
129
  /**
118
130
  * Check whether the provided text is a matching the correct email form
119
131
  */
@@ -112,6 +112,9 @@ export default class WfsManager extends VendorSpecificOgcServerManager {
112
112
  */
113
113
  async commonAttributesByLayer(layer, includeGeometryColumn = false) {
114
114
  const serverWfs = await this.getServerWfs(layer);
115
+ if (!layer.queryLayers) {
116
+ return [];
117
+ }
115
118
  const queryLayers = layer.queryLayers.split(',');
116
119
  const attributesByQueryLayer = [];
117
120
  for (const queryLayer of queryLayers) {
@@ -82,6 +82,7 @@ export default abstract class WmsClient {
82
82
  * This is expected to be immediate.
83
83
  */
84
84
  prepareSwipe(layerWms: LayerWms): void;
85
+ refreshLayer(layerWms: LayerWms): void;
85
86
  /**
86
87
  * Refresh the Z-Index of every layer on the map.
87
88
  */
@@ -107,6 +107,10 @@ export default class WmsClient {
107
107
  prepareSwipe(layerWms) {
108
108
  this.updateLayerDirect([layerWms]);
109
109
  }
110
+ refreshLayer(layerWms) {
111
+ const olLayer = this.getOLayer(layerWms);
112
+ olLayer?.getSource()?.refresh();
113
+ }
110
114
  /**
111
115
  * Refresh the Z-Index of every layer on the map.
112
116
  */
@@ -1 +0,0 @@
1
- export declare const DEMO_LAYERS: Record<string, any>;
@@ -1,99 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // POC demo variables
3
- import ServerOgc from '../../models/serverogc.js';
4
- const SITN_SERVER = new ServerOgc('gmf', {
5
- url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
6
- wfsSupport: false,
7
- urlWfs: '',
8
- oapifSupport: true,
9
- urlOapif: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
10
- // @ts-expect-error Defining a new type of server here to be able to catch some miss-configuration
11
- // of the GMF demo server, see ogcapifeaturesclientgmf.ts
12
- type: 'gmf',
13
- imageType: ''
14
- });
15
- export const DEMO_LAYERS = {
16
- GEORAMA: {
17
- url: 'https://demo.georama.io/features/api',
18
- displayName: 'Georama Rivers',
19
- // To allow for changing collectionIds (uuids) while developing georama,
20
- // we use an interim solution and identify the collection by title.
21
- collectionId: null,
22
- collectionTitle: 'Flüsse',
23
- geometryType: 'MultiLineString',
24
- serverType: 'georama',
25
- server: new ServerOgc('GEORAMA', {
26
- url: 'https://demo.georama.io/features/api',
27
- wfsSupport: false,
28
- urlWfs: '',
29
- oapifSupport: true,
30
- urlOapif: 'https://demo.georama.io/features/api',
31
- type: 'georama',
32
- imageType: ''
33
- })
34
- },
35
- GMF: {
36
- url: 'https://geomapfish-demo-2-9.camptocamp.com/mapserv_proxy/QGIS_Server/wfs3',
37
- displayName: 'GeoMapFish Points',
38
- collectionId: 'points',
39
- collectionTitle: null,
40
- geometryType: 'Point',
41
- serverType: 'gmf',
42
- server: new ServerOgc('gmf', {
43
- url: 'https://geomapfish-demo-2-9.camptocamp.com/mapserv_proxy/QGIS_Server/wfs3',
44
- wfsSupport: false,
45
- urlWfs: '',
46
- oapifSupport: true,
47
- urlOapif: 'https://geomapfish-demo-2-9.camptocamp.com/mapserv_proxy/QGIS_Server/wfs3',
48
- // @ts-expect-error Defining a new type of server here to be able to catch some miss-configuration
49
- // of the GMF demo server, see ogcapifeaturesclientgmf.ts
50
- type: 'gmf',
51
- imageType: ''
52
- })
53
- },
54
- SITN_Point: {
55
- url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
56
- displayName: 'SITN point',
57
- collectionId: 'demo01_edit_point',
58
- collectionTitle: null,
59
- geometryType: 'Point',
60
- serverType: 'gmf',
61
- server: SITN_SERVER
62
- },
63
- SITN_LineString: {
64
- url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
65
- displayName: 'SITN line',
66
- collectionId: 'demo02_edit_line',
67
- collectionTitle: null,
68
- geometryType: 'LineString',
69
- serverType: 'gmf',
70
- server: SITN_SERVER
71
- },
72
- SITN_Polygon: {
73
- url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
74
- displayName: 'SITN polygon',
75
- collectionId: 'demo03_edit_polygon',
76
- collectionTitle: null,
77
- geometryType: 'Polygon',
78
- serverType: 'gmf',
79
- server: SITN_SERVER
80
- },
81
- SITN_MultiLineString: {
82
- url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
83
- displayName: 'SITN multiline',
84
- collectionId: 'demo04_edit_multiline',
85
- collectionTitle: null,
86
- geometryType: 'MultiLineString',
87
- serverType: 'gmf',
88
- server: SITN_SERVER
89
- },
90
- SITN_MultiPolygon: {
91
- url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/ogcapi',
92
- displayName: 'SITN multipolygon',
93
- collectionId: 'demo05_edit_multipolygon',
94
- collectionTitle: null,
95
- geometryType: 'MultiPolygon',
96
- serverType: 'gmf',
97
- server: SITN_SERVER
98
- }
99
- };
@@ -1,13 +0,0 @@
1
- import OgcApiFeaturesClient from './ogcapifeaturesclient.js';
2
- import ServerOgc from '../../models/serverogc.js';
3
- import { OapifSchemaResponse } from '../../models/serverogcapifeatures.js';
4
- import IGirafeContext from '../context/icontext.js';
5
- import { OgcApiClientOptions } from './ogcapiclient.js';
6
- export default class OgcApiFeaturesClientGmf extends OgcApiFeaturesClient {
7
- constructor(serverConfig: ServerOgc, opt: OgcApiClientOptions, context: IGirafeContext);
8
- /**
9
- * POC overwrite: The demo server does not support schema requests. We therefore create a very simple schema based on
10
- * the first item of the collection.
11
- */
12
- getSchema(collectionId: string): Promise<OapifSchemaResponse>;
13
- }
@@ -1,30 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- import OgcApiFeaturesClient from './ogcapifeaturesclient.js';
3
- export default class OgcApiFeaturesClientGmf extends OgcApiFeaturesClient {
4
- constructor(serverConfig, opt, context) {
5
- super(serverConfig, opt, context);
6
- }
7
- /**
8
- * POC overwrite: The demo server does not support schema requests. We therefore create a very simple schema based on
9
- * the first item of the collection.
10
- */
11
- async getSchema(collectionId) {
12
- const items = await this.getItems(collectionId, undefined, undefined, 1);
13
- const item = items[0];
14
- const properties = Object.fromEntries(Object.entries(item.getProperties()).map(([key, value]) => [key, { type: typeof value }]));
15
- // Add geometry information
16
- properties['geometry'] = {
17
- 'format': `geometry-${item.getGeometry().getType().toLowerCase()}`,
18
- 'x-ogc-role': 'primary-geometry'
19
- };
20
- // mark fid or id as primary key
21
- ['fid', 'id'].forEach((key) => {
22
- if (properties[key]) {
23
- properties[key]['x-ogc-role'] = 'id';
24
- }
25
- });
26
- return {
27
- properties: properties
28
- };
29
- }
30
- }