@geogirafe/lib-geoportal 1.1.0-dev.2643003589 → 1.1.0-dev.2643917963

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 (41) hide show
  1. package/components/extlayers/component.js +12 -4
  2. package/components/print/tools/MFPEncoder.d.ts +1 -1
  3. package/components/print/tools/MFPEncoder.js +24 -17
  4. package/components/print/tools/MFPLegendEncoder.d.ts +1 -1
  5. package/components/print/tools/MFPLegendEncoder.js +5 -5
  6. package/models/gmf.d.ts +2 -1
  7. package/models/layers/baselayer.d.ts +0 -12
  8. package/models/layers/baselayer.js +7 -14
  9. package/models/layers/grouplayer.d.ts +0 -7
  10. package/models/layers/grouplayer.js +7 -7
  11. package/models/layers/layer.d.ts +0 -7
  12. package/models/layers/layer.js +7 -7
  13. package/models/layers/layercog.d.ts +0 -7
  14. package/models/layers/layercog.js +7 -7
  15. package/models/layers/layerdrawing.d.ts +0 -7
  16. package/models/layers/layerdrawing.js +7 -7
  17. package/models/layers/layerlocalfile.d.ts +0 -7
  18. package/models/layers/layerlocalfile.js +7 -7
  19. package/models/layers/layerosm.d.ts +0 -7
  20. package/models/layers/layerosm.js +7 -7
  21. package/models/layers/layervectortiles.d.ts +0 -7
  22. package/models/layers/layervectortiles.js +7 -7
  23. package/models/layers/layerwms.d.ts +0 -7
  24. package/models/layers/layerwms.js +7 -7
  25. package/models/layers/layerwmsexternal.js +7 -0
  26. package/models/layers/layerwmts.d.ts +0 -7
  27. package/models/layers/layerwmts.js +7 -7
  28. package/models/layers/layerwmtsexternal.js +7 -0
  29. package/models/layers/layerxyz.d.ts +0 -7
  30. package/models/layers/layerxyz.js +7 -7
  31. package/models/layers/themelayer.d.ts +0 -7
  32. package/models/layers/themelayer.js +7 -7
  33. package/models/layers/themelayerexternal.js +7 -0
  34. package/models/main.d.ts +1 -1
  35. package/models/serverogc.d.ts +2 -2
  36. package/package.json +1 -1
  37. package/templates/public/about.json +1 -1
  38. package/tools/share/serializers/layerconfigserializer.js +3 -2
  39. package/tools/share/serializers/sharedtypes.d.ts +2 -0
  40. package/tools/wms/wmsclient.d.ts +1 -1
  41. package/tools/wms/wmsclient.js +9 -2
@@ -96,16 +96,24 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
96
96
  }
97
97
  }
98
98
  async scanLayersWMS(url) {
99
+ const parsedUrl = URL.parse(url);
100
+ if (!parsedUrl) {
101
+ return;
102
+ }
99
103
  this.themeName = this.parseName(url);
104
+ const urlTxt = `${parsedUrl?.origin}${parsedUrl?.pathname}`;
105
+ // Try to add a server type from the getCapabilities url params.
106
+ const serverTypeKey = Array.from(parsedUrl.searchParams.keys()).find((key) => key.toLowerCase() === 'servertype');
107
+ const serverType = (parsedUrl.searchParams.get(serverTypeKey ?? '') ?? 'other');
100
108
  const server = new ServerOgc(this.themeName, {
101
- url,
102
- type: 'other',
109
+ url: urlTxt,
110
+ type: serverType,
103
111
  wfsSupport: true,
104
- urlWfs: url,
112
+ urlWfs: urlTxt,
105
113
  imageType: 'image/png'
106
114
  });
107
115
  const client = this.context.wmsManager.createClient(WmsClientDefault, server);
108
- const capabilities = await client.getWmsCapabilities();
116
+ const capabilities = await client.getWmsCapabilities(parsedUrl.searchParams);
109
117
  if (capabilities?.Service?.Title) {
110
118
  this.themeName = capabilities.Service.Title;
111
119
  }
@@ -50,7 +50,7 @@ export default class MFPEncoder {
50
50
  */
51
51
  encodeLayers(baseLayers: BaseLayer[]): MFPLayer[];
52
52
  /**
53
- * Encodes a layer object according to it's className and options.
53
+ * Encodes a layer object according to its type and options.
54
54
  * @returns A promise that resolves to an array of MFP layers, a single MFP layer, or null.
55
55
  */
56
56
  encodeLayer(layer: BaseLayer): MFPLayer[] | MFPLayer | null;
@@ -7,6 +7,12 @@ import LayerWmts from '../../../models/layers/layerwmts.js';
7
7
  import VectorLayer from 'ol/layer/Vector.js';
8
8
  import { isLayerVisible } from './printUtils.js';
9
9
  import VectorSource from 'ol/source/Vector.js';
10
+ import LayerWmtsExternal from '../../../models/layers/layerwmtsexternal.js';
11
+ import LayerWmsExternal from '../../../models/layers/layerwmsexternal.js';
12
+ /** Supported MapFishPRint servers
13
+ * see https://github.com/mapfish/mapfish-print/blob/master/core/src/main/java/org/mapfish/print/map/image/wms/WmsLayerParam.java#L123
14
+ */
15
+ const MFPSupportedServerType = new Set(['mapserver', 'geoserver', 'qgisserver']);
10
16
  /**
11
17
  * Class representing a Mapfish Print Encoder.
12
18
  */
@@ -119,23 +125,24 @@ export default class MFPEncoder {
119
125
  return mfpLayers;
120
126
  }
121
127
  /**
122
- * Encodes a layer object according to it's className and options.
128
+ * Encodes a layer object according to its type and options.
123
129
  * @returns A promise that resolves to an array of MFP layers, a single MFP layer, or null.
124
130
  */
125
131
  encodeLayer(layer) {
126
- switch (layer.className) {
127
- case GroupLayer.name:
128
- return this.encodeGroupLayer(layer);
129
- case LayerWms.name:
130
- return this.encodeWmsLayer(layer);
131
- case LayerWmts.name:
132
- return this.encodeTileWmtsLayer(layer);
133
- case LayerLocalFile.name:
134
- return this.encodeLocalFileLayer(layer);
135
- default:
136
- console.warn('Unsupported layer type for encoding:', layer.className);
137
- return null;
132
+ if (layer instanceof GroupLayer) {
133
+ return this.encodeGroupLayer(layer);
134
+ }
135
+ if (layer instanceof LayerWms || layer instanceof LayerWmsExternal) {
136
+ return this.encodeWmsLayer(layer);
137
+ }
138
+ if (layer instanceof LayerWmts || layer instanceof LayerWmtsExternal) {
139
+ return this.encodeTileWmtsLayer(layer);
140
+ }
141
+ if (layer instanceof LayerLocalFile) {
142
+ return this.encodeLocalFileLayer(layer);
138
143
  }
144
+ console.warn('Unsupported layer type for encoding: ', layer);
145
+ return null;
139
146
  }
140
147
  /**
141
148
  * Only non mixed groups of WMS layers are supported.
@@ -183,16 +190,16 @@ export default class MFPEncoder {
183
190
  customParams[key] = value;
184
191
  });
185
192
  }
186
- const ogcServer = this.options?.state.ogcServers[layerWms.ogcServer.name];
187
- let serverType = ogcServer?.type;
188
- if (serverType === 'arcgis') {
193
+ let serverType = layerWms.ogcServer.type;
194
+ // Remove unsupported serverType (otherwise, you'll get an error from the print server).
195
+ if (!MFPSupportedServerType.has(serverType)) {
189
196
  serverType = undefined;
190
197
  }
191
198
  const layers = layerWms.layers?.split(',') ?? [''];
192
199
  // Add empty styles if needed
193
200
  let styles = layerWms.style?.split(',');
194
201
  styles ??= [''];
195
- // Get the same amount of styles than layers to print
202
+ // Get the same number of styles than layers to print
196
203
  while (layers.length > styles.length) {
197
204
  styles.push('');
198
205
  }
@@ -54,7 +54,7 @@ export declare class MFPLegendEncoder {
54
54
  */
55
55
  encodeLayersLegend(layers: BaseLayer[]): MFPLegendClass[];
56
56
  /**
57
- * Encodes the legend classes for a given layer, based on its type or className.
57
+ * Encodes the legend classes for a given layer, based on its type or instance.
58
58
  * @returns The encoded legend classes for the layer, or null if the layer is not supported.
59
59
  */
60
60
  encodeLayerLegendClasses(layer: BaseLayer): MFPLegendClass | null;
@@ -3,6 +3,7 @@ import LayerWmts from '../../../models/layers/layerwmts.js';
3
3
  import GeoConsts from '../../../tools/geoconsts.js';
4
4
  import { isLayerVisible } from './printUtils.js';
5
5
  import LegendHelper from '../../../tools/legendhelper.js';
6
+ import LayerWmsExternal from '../../../models/layers/layerwmsexternal.js';
6
7
  /**
7
8
  * Class representing an encoder for creating a legend in the MFP (MapFishPrint) format.
8
9
  * Iterates on the layer tree layers to collect layers in the right order and with all metadata.
@@ -46,17 +47,17 @@ export class MFPLegendEncoder {
46
47
  return groupClasses;
47
48
  }
48
49
  /**
49
- * Encodes the legend classes for a given layer, based on its type or className.
50
+ * Encodes the legend classes for a given layer, based on its type or instance.
50
51
  * @returns The encoded legend classes for the layer, or null if the layer is not supported.
51
52
  */
52
53
  encodeLayerLegendClasses(layer) {
53
54
  if (layer.children) {
54
55
  return this.encodeLayerGroupLegendClasses(layer);
55
56
  }
56
- if (layer.className === LayerWms.name) {
57
+ if (layer instanceof LayerWms || layer instanceof LayerWmsExternal) {
57
58
  return this.encodeLayerWmsLegendClasses(layer);
58
59
  }
59
- if (layer.className === LayerWmts.name) {
60
+ if (layer instanceof LayerWmts) {
60
61
  return this.encodeLayerWmtsLegendClasses(layer);
61
62
  }
62
63
  return null;
@@ -113,8 +114,7 @@ export class MFPLegendEncoder {
113
114
  if (!isLayerVisible(layerWms, this.options?.printResolution) || layerWms.inactive) {
114
115
  return null;
115
116
  }
116
- const ogcServers = this.options?.state.ogcServers;
117
- const ogcServer = ogcServers ? ogcServers[layerWms.ogcServer.name] : undefined;
117
+ const ogcServer = layerWms.ogcServer;
118
118
  const serverType = ogcServer?.type ?? '';
119
119
  const dpi = this.options?.dpi ?? GeoConsts.SCREEN_DOTS_PER_INCH;
120
120
  // Case node as a legend image
package/models/gmf.d.ts CHANGED
@@ -76,13 +76,14 @@ export interface GMFGroup extends GMFTreeItem {
76
76
  children: GMFTreeItem[];
77
77
  }
78
78
  export type GMFBackgroundLayer = GMFTreeItem;
79
+ export type GMFServerOgcType = 'mapserver' | 'qgisserver' | 'georama' | 'geoserver' | 'arcgis' | 'other';
79
80
  export interface GMFServerOgc {
80
81
  url: string;
81
82
  wfsSupport: boolean;
82
83
  urlWfs?: string;
83
84
  oapifSupport?: boolean;
84
85
  urlOapif?: string;
85
- type: 'mapserver' | 'qgisserver' | 'georama' | 'geoserver' | 'arcgis' | 'other';
86
+ type: GMFServerOgcType;
86
87
  imageType: string;
87
88
  attributes?: GMFServerOgcAttributes;
88
89
  }
@@ -6,13 +6,6 @@ type BaseLayerOptions = {
6
6
  metadataUrl?: string;
7
7
  };
8
8
  declare abstract class BaseLayer {
9
- /**
10
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
11
- * This means that each modification made to its properties must come from outside,
12
- * because they have to be made through the proxy, so that the modification can be listen.
13
- * Therefore, this class must not contain any method which is updating a value directly
14
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
15
- */
16
9
  id: number;
17
10
  treeItemId: string;
18
11
  name: string;
@@ -35,10 +28,5 @@ declare abstract class BaseLayer {
35
28
  abstract clone(): BaseLayer;
36
29
  parent?: ThemeLayer | GroupLayer;
37
30
  constructor(id: number, name: string, order: number, options?: BaseLayerOptions);
38
- /**
39
- * @returns the name of the class to facilitate the identification
40
- * of subclasses, even in Proxy objects.
41
- */
42
- get className(): string;
43
31
  }
44
32
  export default BaseLayer;
@@ -7,14 +7,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  // SPDX-License-Identifier: Apache-2.0
8
8
  import { BrainIgnoreClone } from '../../tools/state/brain/decorators.js';
9
9
  import { v4 as uuidv4 } from 'uuid';
10
+ /*
11
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
12
+ * This means that each modification made to its properties must come from outside,
13
+ * because they have to be made through the proxy, so that the modification can be listen.
14
+ * Therefore, this class must not contain any method which is updating a value directly
15
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
16
+ */
10
17
  class BaseLayer {
11
- /**
12
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
13
- * This means that each modification made to its properties must come from outside,
14
- * because they have to be made through the proxy, so that the modification can be listen.
15
- * Therefore, this class must not contain any method which is updating a value directly
16
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
17
- */
18
18
  id;
19
19
  treeItemId;
20
20
  name;
@@ -46,13 +46,6 @@ class BaseLayer {
46
46
  this.disclaimer = options?.disclaimer;
47
47
  this.metadataUrl = options?.metadataUrl;
48
48
  }
49
- /**
50
- * @returns the name of the class to facilitate the identification
51
- * of subclasses, even in Proxy objects.
52
- */
53
- get className() {
54
- return this.constructor.name;
55
- }
56
49
  }
57
50
  __decorate([
58
51
  BrainIgnoreClone
@@ -12,13 +12,6 @@ export type GroupLayerOptions = {
12
12
  timeAttribute?: string;
13
13
  };
14
14
  declare class GroupLayer extends BaseLayer implements ILayerWithTime {
15
- /**
16
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
17
- * This means that each modification made to its properties must come from outside,
18
- * because they have to be made through the proxy, so that the modification can be listen.
19
- * Therefore, this class must not contain any method which is updating a value directly
20
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
21
- */
22
15
  isExclusiveGroup: boolean;
23
16
  isExpanded: boolean;
24
17
  _isMixed?: boolean;
@@ -2,14 +2,14 @@
2
2
  import BaseLayer from './baselayer.js';
3
3
  import LayerTimeFormatter from '../../tools/time/layertimeformatter.js';
4
4
  import LayerWms from './layerwms.js';
5
+ /*
6
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
7
+ * This means that each modification made to its properties must come from outside,
8
+ * because they have to be made through the proxy, so that the modification can be listen.
9
+ * Therefore, this class must not contain any method which is updating a value directly
10
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
11
+ */
5
12
  class GroupLayer extends BaseLayer {
6
- /**
7
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
8
- * This means that each modification made to its properties must come from outside,
9
- * because they have to be made through the proxy, so that the modification can be listen.
10
- * Therefore, this class must not contain any method which is updating a value directly
11
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
12
- */
13
13
  isExclusiveGroup;
14
14
  isExpanded;
15
15
  _isMixed;
@@ -9,13 +9,6 @@ type LayerOptions = {
9
9
  restricted?: boolean;
10
10
  };
11
11
  declare abstract class Layer extends BaseLayer {
12
- /**
13
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
14
- * This means that each modification made to its properties must come from outside,
15
- * because they have to be made through the proxy, so that the modification can be listen.
16
- * Therefore, this class must not contain any method which is updating a value directly
17
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
18
- */
19
12
  activeState: 'on' | 'off';
20
13
  opacity: number;
21
14
  restricted: boolean;
@@ -1,13 +1,13 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import BaseLayer from './baselayer.js';
3
+ /*
4
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
+ * This means that each modification made to its properties must come from outside,
6
+ * because they have to be made through the proxy, so that the modification can be listen.
7
+ * Therefore, this class must not contain any method which is updating a value directly
8
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
+ */
3
10
  class Layer extends BaseLayer {
4
- /**
5
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
6
- * This means that each modification made to its properties must come from outside,
7
- * because they have to be made through the proxy, so that the modification can be listen.
8
- * Therefore, this class must not contain any method which is updating a value directly
9
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
10
- */
11
11
  activeState = 'off';
12
12
  opacity;
13
13
  restricted;
@@ -8,13 +8,6 @@ type LayerCogTilesOptions = {
8
8
  restricted?: boolean;
9
9
  };
10
10
  declare class LayerCog extends Layer {
11
- /**
12
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
13
- * This means that each modification made to its properties must come from outside,
14
- * because they have to be made through the proxy, so that the modification can be listen.
15
- * Therefore, this class must not contain any method which is updating a value directly
16
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
17
- */
18
11
  source: string;
19
12
  constructor(id: number, name: string, order: number, source: string, options?: GMFTreeItem | LayerCogTilesOptions);
20
13
  clone(): LayerCog;
@@ -1,12 +1,12 @@
1
1
  import Layer from './layer.js';
2
+ /*
3
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
4
+ * This means that each modification made to its properties must come from outside,
5
+ * because they have to be made through the proxy, so that the modification can be listen.
6
+ * Therefore, this class must not contain any method which is updating a value directly
7
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
8
+ */
2
9
  class LayerCog extends Layer {
3
- /**
4
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
- * This means that each modification made to its properties must come from outside,
6
- * because they have to be made through the proxy, so that the modification can be listen.
7
- * Therefore, this class must not contain any method which is updating a value directly
8
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
- */
10
10
  source;
11
11
  constructor(id, name, order, source, options) {
12
12
  let opts = options ?? {};
@@ -1,13 +1,6 @@
1
1
  import Layer from './layer.js';
2
2
  import VectorLayer from 'ol/layer/Vector.js';
3
3
  export default class LayerDrawing extends Layer {
4
- /**
5
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
6
- * This means that each modification made to its properties must come from outside,
7
- * because they have to be made through the proxy, so that the modification can be listen.
8
- * Therefore, this class must not contain any method which is updating a value directly
9
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
10
- */
11
4
  _oLayer: VectorLayer;
12
5
  constructor(name: string, oLayer: VectorLayer);
13
6
  clone(): LayerDrawing;
@@ -1,13 +1,13 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import Layer from './layer.js';
3
+ /*
4
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
+ * This means that each modification made to its properties must come from outside,
6
+ * because they have to be made through the proxy, so that the modification can be listen.
7
+ * Therefore, this class must not contain any method which is updating a value directly
8
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
+ */
3
10
  export default class LayerDrawing extends Layer {
4
- /**
5
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
6
- * This means that each modification made to its properties must come from outside,
7
- * because they have to be made through the proxy, so that the modification can be listen.
8
- * Therefore, this class must not contain any method which is updating a value directly
9
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
10
- */
11
11
  _oLayer;
12
12
  constructor(name, oLayer) {
13
13
  super(0, name, 0, { isDefaultChecked: true });
@@ -4,13 +4,6 @@ import Geometry from 'ol/geom/Geometry.js';
4
4
  import { Extent } from 'ol/extent.js';
5
5
  import ILayerWithLegend from './ilayerwithlegend.js';
6
6
  declare class LayerLocalFile extends Layer implements ILayerWithLegend {
7
- /**
8
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
9
- * This means that each modification made to its properties must come from outside,
10
- * because they have to be made through the proxy, so that the modification can be listen.
11
- * Therefore, this class must not contain any method which is updating a value directly
12
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
13
- */
14
7
  _features: Feature<Geometry>[];
15
8
  lastModifiedDate: string;
16
9
  legend: boolean;
@@ -1,12 +1,12 @@
1
1
  import Layer from './layer.js';
2
+ /*
3
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
4
+ * This means that each modification made to its properties must come from outside,
5
+ * because they have to be made through the proxy, so that the modification can be listen.
6
+ * Therefore, this class must not contain any method which is updating a value directly
7
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
8
+ */
2
9
  class LayerLocalFile extends Layer {
3
- /**
4
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
- * This means that each modification made to its properties must come from outside,
6
- * because they have to be made through the proxy, so that the modification can be listen.
7
- * Therefore, this class must not contain any method which is updating a value directly
8
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
- */
10
10
  _features;
11
11
  lastModifiedDate;
12
12
  legend = true;
@@ -1,12 +1,5 @@
1
1
  import Layer from './layer.js';
2
2
  declare class LayerOsm extends Layer {
3
- /**
4
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
- * This means that each modification made to its properties must come from outside,
6
- * because they have to be made through the proxy, so that the modification can be listen.
7
- * Therefore, this class must not contain any method which is updating a value directly
8
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
- */
10
3
  constructor(order: number);
11
4
  clone(): LayerOsm;
12
5
  }
@@ -1,14 +1,14 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import Layer from './layer.js';
3
3
  import LayerConsts from './layerconsts.js';
4
+ /*
5
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
6
+ * This means that each modification made to its properties must come from outside,
7
+ * because they have to be made through the proxy, so that the modification can be listen.
8
+ * Therefore, this class must not contain any method which is updating a value directly
9
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
10
+ */
4
11
  class LayerOsm extends Layer {
5
- /**
6
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
7
- * This means that each modification made to its properties must come from outside,
8
- * because they have to be made through the proxy, so that the modification can be listen.
9
- * Therefore, this class must not contain any method which is updating a value directly
10
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
11
- */
12
12
  constructor(order) {
13
13
  super(LayerConsts.LayerOsmId, 'OpenStreetMap', order);
14
14
  }
@@ -9,13 +9,6 @@ type LayerVectorTilesOptions = {
9
9
  protected?: boolean;
10
10
  };
11
11
  declare class LayerVectorTiles extends Layer {
12
- /**
13
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
14
- * This means that each modification made to its properties must come from outside,
15
- * because they have to be made through the proxy, so that the modification can be listen.
16
- * Therefore, this class must not contain any method which is updating a value directly
17
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
18
- */
19
12
  style: string;
20
13
  layerName?: string;
21
14
  projection?: string;
@@ -1,13 +1,13 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import Layer from './layer.js';
3
+ /*
4
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
+ * This means that each modification made to its properties must come from outside,
6
+ * because they have to be made through the proxy, so that the modification can be listen.
7
+ * Therefore, this class must not contain any method which is updating a value directly
8
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
+ */
3
10
  class LayerVectorTiles extends Layer {
4
- /**
5
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
6
- * This means that each modification made to its properties must come from outside,
7
- * because they have to be made through the proxy, so that the modification can be listen.
8
- * Therefore, this class must not contain any method which is updating a value directly
9
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
10
- */
11
11
  style;
12
12
  layerName;
13
13
  projection;
@@ -41,13 +41,6 @@ export type LayerWmsOptions = {
41
41
  enumeratedAttributes?: string[];
42
42
  };
43
43
  declare class LayerWms extends Layer implements ILayerWithLegend, ILayerWithFilter, ILayerWithTime {
44
- /**
45
- * This class is used in the state of the application, which will be accessed behind a JavaScript proxy.
46
- * This means that each modification made to its properties must come from outside,
47
- * because they have to be made through the proxy, so that the modification can be listened to.
48
- * Therefore, this class must not contain any method which is updating a value directly.
49
- * For example, any method doing <this.xxx = value> is forbidden here because the modification must be known from the proxy
50
- */
51
44
  ogcServer: ServerOgc;
52
45
  minResolution?: number;
53
46
  maxResolution?: number;
@@ -7,14 +7,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import LayerTimeFormatter from '../../tools/time/layertimeformatter.js';
8
8
  import Layer from './layer.js';
9
9
  import { BrainIgnore } from '../../tools/state/brain/decorators.js';
10
+ /*
11
+ * This class is used in the state of the application, which will be accessed behind a JavaScript proxy.
12
+ * This means that each modification made to its properties must come from outside,
13
+ * because they have to be made through the proxy, so that the modification can be listened to.
14
+ * Therefore, this class must not contain any method which is updating a value directly.
15
+ * For example, any method doing <this.xxx = value> is forbidden here because the modification must be known from the proxy
16
+ */
10
17
  class LayerWms extends Layer {
11
- /**
12
- * This class is used in the state of the application, which will be accessed behind a JavaScript proxy.
13
- * This means that each modification made to its properties must come from outside,
14
- * because they have to be made through the proxy, so that the modification can be listened to.
15
- * Therefore, this class must not contain any method which is updating a value directly.
16
- * For example, any method doing <this.xxx = value> is forbidden here because the modification must be known from the proxy
17
- */
18
18
  // Base WMS attributes
19
19
  ogcServer;
20
20
  minResolution;
@@ -1,4 +1,11 @@
1
1
  import LayerWms from './layerwms.js';
2
+ /*
3
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
4
+ * This means that each modification made to its properties must come from outside,
5
+ * because they have to be made through the proxy, so that the modification can be listen.
6
+ * Therefore, this class must not contain any method which is updating a value directly
7
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
8
+ */
2
9
  export default class LayerWmsExternal extends LayerWms {
3
10
  static nextAvailableLayerId = 10000000;
4
11
  selected = false;
@@ -28,13 +28,6 @@ export type LayerWmtsOptions = {
28
28
  hiDPILegendImages?: Record<string, string>;
29
29
  };
30
30
  declare class LayerWmts extends Layer implements ILayerWithLegend {
31
- /**
32
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
33
- * This means that each modification made to its properties must come from outside,
34
- * because they have to be made through the proxy, so that the modification can be listen.
35
- * Therefore, this class must not contain any method which is updating a value directly
36
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
37
- */
38
31
  url: string;
39
32
  layer: string;
40
33
  dimensions?: Record<string, object>;
@@ -7,14 +7,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  // SPDX-License-Identifier: Apache-2.0
8
8
  import { BrainIgnore } from '../../tools/state/brain/decorators.js';
9
9
  import Layer from './layer.js';
10
+ /*
11
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
12
+ * This means that each modification made to its properties must come from outside,
13
+ * because they have to be made through the proxy, so that the modification can be listen.
14
+ * Therefore, this class must not contain any method which is updating a value directly
15
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
16
+ */
10
17
  class LayerWmts extends Layer {
11
- /**
12
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
13
- * This means that each modification made to its properties must come from outside,
14
- * because they have to be made through the proxy, so that the modification can be listen.
15
- * Therefore, this class must not contain any method which is updating a value directly
16
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
17
- */
18
18
  url;
19
19
  layer;
20
20
  dimensions;
@@ -1,5 +1,12 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import LayerWmts from './layerwmts.js';
3
+ /*
4
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
+ * This means that each modification made to its properties must come from outside,
6
+ * because they have to be made through the proxy, so that the modification can be listen.
7
+ * Therefore, this class must not contain any method which is updating a value directly
8
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
+ */
3
10
  export default class LayerWmtsExternal extends LayerWmts {
4
11
  static nextAvailableLayerId = 20000000;
5
12
  selected = false;
@@ -8,13 +8,6 @@ type LayerXYZTilesOptions = {
8
8
  restricted?: boolean;
9
9
  };
10
10
  declare class LayerXYZ extends Layer {
11
- /**
12
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
13
- * This means that each modification made to its properties must come from outside,
14
- * because they have to be made through the proxy, so that the modification can be listen.
15
- * Therefore, this class must not contain any method which is updating a value directly
16
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
17
- */
18
11
  source: string;
19
12
  constructor(id: number, name: string, order: number, source: string, options?: GMFTreeItem | LayerXYZTilesOptions);
20
13
  clone(): LayerXYZ;
@@ -1,12 +1,12 @@
1
1
  import Layer from './layer.js';
2
+ /*
3
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
4
+ * This means that each modification made to its properties must come from outside,
5
+ * because they have to be made through the proxy, so that the modification can be listen.
6
+ * Therefore, this class must not contain any method which is updating a value directly
7
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
8
+ */
2
9
  class LayerXYZ extends Layer {
3
- /**
4
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
- * This means that each modification made to its properties must come from outside,
6
- * because they have to be made through the proxy, so that the modification can be listen.
7
- * Therefore, this class must not contain any method which is updating a value directly
8
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
- */
10
10
  source;
11
11
  constructor(id, name, order, source, options) {
12
12
  let opts = options ?? {};
@@ -8,13 +8,6 @@ export type ThemeLayerOptions = {
8
8
  isExclusiveTheme?: boolean;
9
9
  };
10
10
  declare class ThemeLayer extends BaseLayer {
11
- /**
12
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
13
- * This means that each modification made to its properties must come from outside,
14
- * because they have to be made through the proxy, so that the modification can be listen.
15
- * Therefore, this class must not contain any method which is updating a value directly
16
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
17
- */
18
11
  isExclusiveTheme: boolean;
19
12
  isExpanded: boolean;
20
13
  activeState: 'on' | 'off' | 'semi';
@@ -1,13 +1,13 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import BaseLayer from './baselayer.js';
3
+ /*
4
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
5
+ * This means that each modification made to its properties must come from outside,
6
+ * because they have to be made through the proxy, so that the modification can be listen.
7
+ * Therefore, this class must not contain any method which is updating a value directly
8
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
9
+ */
3
10
  class ThemeLayer extends BaseLayer {
4
- /**
5
- * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
6
- * This means that each modification made to its properties must come from outside,
7
- * because they have to be made through the proxy, so that the modification can be listen.
8
- * Therefore, this class must not contain any method which is updating a value directly
9
- * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
10
- */
11
11
  isExclusiveTheme;
12
12
  isExpanded;
13
13
  activeState = 'off';
@@ -1,4 +1,11 @@
1
1
  import ThemeLayer from './themelayer.js';
2
+ /*
3
+ * This class is a used in the state of the application, which will be accessed behind a javascript proxy.
4
+ * This means that each modification made to its properties must come from outside,
5
+ * because they have to be made through the proxy, so that the modification can be listen.
6
+ * Therefore, this class must not contain any method which is updating a value directly
7
+ * For example, any method doing <this.xxx = value> is forbidden here, because the modification be known from the proxy
8
+ */
2
9
  export default class ThemeLayerExternal extends ThemeLayer {
3
10
  static nextAvailableThemeId = 30000000;
4
11
  constructor(name) {
package/models/main.d.ts CHANGED
@@ -5,7 +5,7 @@ export { default as BasemapSwisstopoVectorTiles } from './basemaps/basemapswisst
5
5
  export { default as CustomTheme } from './customtheme.js';
6
6
  export type { FilterOperator, AttributeTypeGroup, LogicalFilterOperator } from './filter.js';
7
7
  export { filterOperatorValues, filterOperators, isFilterOperator, isValuelessFilterOperator, isTwoSidedFilterOperator, isListFilterOperator, operatorsByAttributeTypeGroup, logicalFilterOperators, isLogicalFilterOperator } from './filter.js';
8
- export type { GMFMetadata, GMFChildLayer, GMFTreeItem, GMFThemeFunctionality, GMFThemeFunctionalities, GMFTheme, GMFGroup, GMFBackgroundLayer, GMFServerOgc, GMFServerOgcAttributes, GMFServerOgcObjectAttributes, GMFServerOgcColumnAttributes } from './gmf.js';
8
+ export type { GMFMetadata, GMFChildLayer, GMFTreeItem, GMFThemeFunctionality, GMFThemeFunctionalities, GMFTheme, GMFGroup, GMFBackgroundLayer, GMFServerOgcType, GMFServerOgc, GMFServerOgcAttributes, GMFServerOgcObjectAttributes, GMFServerOgcColumnAttributes } from './gmf.js';
9
9
  export { default as BaseLayer } from './layers/baselayer.js';
10
10
  export type { GroupLayerOptions } from './layers/grouplayer.js';
11
11
  export { default as GroupLayer } from './layers/grouplayer.js';
@@ -1,4 +1,4 @@
1
- import { GMFServerOgc } from './gmf.js';
1
+ import { GMFServerOgc, GMFServerOgcType } from './gmf.js';
2
2
  export default class ServerOgc {
3
3
  name: string;
4
4
  url: string;
@@ -6,7 +6,7 @@ export default class ServerOgc {
6
6
  urlWfs?: string;
7
7
  oapifSupport: boolean;
8
8
  urlOapif?: string;
9
- type: 'mapserver' | 'qgisserver' | 'georama' | 'geoserver' | 'arcgis' | 'other';
9
+ type: GMFServerOgcType;
10
10
  imageType: string;
11
11
  aliases: Record<string, string>;
12
12
  constructor(name: string, elem: GMFServerOgc);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.1.0-dev.2643003589",
8
+ "version": "1.1.0-dev.2643917963",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2643003589", "build":"2643003589", "date":"01/07/2026"}
1
+ {"version":"1.1.0-dev.2643917963", "build":"2643917963", "date":"01/07/2026"}
@@ -103,7 +103,8 @@ export default class LayersConfigSerializer {
103
103
  sharedLayer.wms = {
104
104
  name: layer.layers,
105
105
  title: layer.name,
106
- url: layer.ogcServer.url
106
+ url: layer.ogcServer.url,
107
+ serverType: layer.ogcServer?.type ?? 'other'
107
108
  };
108
109
  }
109
110
  return sharedLayer;
@@ -404,7 +405,7 @@ export default class LayersConfigSerializer {
404
405
  }
405
406
  const server = new ServerOgc('external', {
406
407
  url: sharedLayer.wms.url,
407
- type: 'other',
408
+ type: sharedLayer.wms.serverType,
408
409
  wfsSupport: true,
409
410
  urlWfs: sharedLayer.wms.url,
410
411
  imageType: 'image/png'
@@ -1,4 +1,5 @@
1
1
  import { FilterOperator, LogicalFilterOperator } from '../../../models/filter.js';
2
+ import { GMFServerOgcType } from '../../../models/gmf.js';
2
3
  export type SharedFilterCondition = {
3
4
  property: string;
4
5
  propertyType?: string;
@@ -72,6 +73,7 @@ export type SharedExternalLayer = {
72
73
  title: string;
73
74
  name: string;
74
75
  url: string;
76
+ serverType: GMFServerOgcType;
75
77
  };
76
78
  wmts?: {
77
79
  name: string;
@@ -55,7 +55,7 @@ export default abstract class WmsClient {
55
55
  private getFeatureInfoUrl;
56
56
  private handleGetFeatureInfoResponse;
57
57
  refreshZIndexes(): void;
58
- getWmsCapabilities(): Promise<Record<string, unknown>>;
58
+ getWmsCapabilities(params?: URLSearchParams): Promise<Record<string, unknown>>;
59
59
  }
60
60
  export declare class WmsClientQgis extends WmsClient {
61
61
  /** QGIS-server does not filter on a WMS layer made from multiple underlying WFS queryLayers
@@ -368,7 +368,7 @@ export default class WmsClient {
368
368
  obj.olayer.setZIndex(zindex);
369
369
  }
370
370
  }
371
- async getWmsCapabilities() {
371
+ async getWmsCapabilities(params) {
372
372
  if (this.capabilityPromise !== null) {
373
373
  return this.capabilityPromise;
374
374
  }
@@ -378,7 +378,14 @@ export default class WmsClient {
378
378
  }
379
379
  this.capabilityPromise = (async () => {
380
380
  // Capabilities were not loaded yet.
381
- const params = new URLSearchParams();
381
+ if (params) {
382
+ params.delete('REQUEST');
383
+ params.delete('SERVICE');
384
+ params.delete('VERSION');
385
+ }
386
+ else {
387
+ params = new URLSearchParams();
388
+ }
382
389
  params.append('REQUEST', 'GetCapabilities');
383
390
  params.append('SERVICE', 'WMS');
384
391
  params.append('VERSION', '1.3.0');