@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
@@ -0,0 +1,7 @@
1
+ import LayerWms from './layerwms.js';
2
+ const editableLayer = [LayerWms];
3
+ export const isEditableLayer = (layer) => {
4
+ return (editableLayer.some((ctr) => layer instanceof ctr) &&
5
+ layer.editLayers !== undefined &&
6
+ !!layer.ogcServer);
7
+ };
@@ -37,7 +37,6 @@ export type LayerWmsOptions = {
37
37
  time?: ITimeOptions;
38
38
  snappingConfig?: ISnappingConfig;
39
39
  timeAttribute?: string;
40
- editable?: string;
41
40
  enumeratedAttributes?: string[];
42
41
  };
43
42
  declare class LayerWms extends Layer implements ILayerWithLegend, ILayerWithFilter, ILayerWithTime {
@@ -69,7 +68,7 @@ declare class LayerWms extends Layer implements ILayerWithLegend, ILayerWithFilt
69
68
  timeRestriction?: string;
70
69
  timeAttribute?: string;
71
70
  enumeratedAttributes?: string[];
72
- editable?: string;
71
+ editLayers?: string[];
73
72
  constructor(id: LayerId, name: string, order: number, ogcServer: ServerOgc, options?: TreeItemDefinition | LayerWmsOptions);
74
73
  clone(): LayerWms;
75
74
  static isResolutionRangeRestricted(minResolution: number | undefined, maxResolution: number | undefined): boolean | 0 | undefined;
@@ -41,7 +41,9 @@ class LayerWms extends Layer {
41
41
  timeRestriction;
42
42
  timeAttribute;
43
43
  enumeratedAttributes;
44
- editable;
44
+ // The corresponding layer name(s) in the edit service.
45
+ // This list is populated by the ogcApiFeaturesManager during initialization.
46
+ editLayers;
45
47
  constructor(id, name, order, ogcServer, options) {
46
48
  let opts = options ?? {};
47
49
  opts = LayerWms.isTreeItemDefinition(opts) ? LayerWms.getOptionsFromDefinition(opts) : opts;
@@ -65,15 +67,9 @@ class LayerWms extends Layer {
65
67
  this.queryLayersRanges = opts?.queryLayersRanges || {};
66
68
  this.timeOptions = opts?.time;
67
69
  this.timeAttribute = opts?.timeAttribute;
68
- this.editable = opts?.editable;
69
70
  this.snapOptions = opts?.snappingConfig;
70
71
  this.snapActive = this.snapOptions !== undefined;
71
72
  this.enumeratedAttributes = opts?.enumeratedAttributes;
72
- if (this.editable && (!this.ogcServer.oapifSupport || this.ogcServer.urlOapif?.length === 0)) {
73
- this.hasError = true;
74
- this.errorMessage = 'This layer is defined as editable but no Url for OgcApiFeatures service has been defined.';
75
- this.editable = undefined;
76
- }
77
73
  this.setDefaultTimeRestriction();
78
74
  }
79
75
  clone() {
@@ -102,12 +98,12 @@ class LayerWms extends Layer {
102
98
  time: this.timeOptions,
103
99
  snappingConfig: this.snapOptions,
104
100
  timeAttribute: this.timeAttribute,
105
- editable: this.editable,
106
101
  enumeratedAttributes: this.enumeratedAttributes
107
102
  };
108
103
  const clonedObject = new LayerWms(this.id, this.name, this.order, this.ogcServer, options);
109
104
  clonedObject.filter = this.filter;
110
105
  clonedObject.activeState = this.activeState;
106
+ clonedObject.editLayers = this.editLayers;
111
107
  clonedObject.timeRestriction = this.timeRestriction;
112
108
  return clonedObject;
113
109
  }
package/models/main.d.ts CHANGED
@@ -6,9 +6,12 @@ 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
8
  export type { GeoramaTreeItem, GeoramaTheme } from './georama.js';
9
- export type { GMFMetadata, GMFChildLayer, GMFTreeItem, GMFThemeFunctionality, GMFThemeFunctionalities, GMFTheme, GMFGroup, GMFServerOgcType, GMFServerOgc, GMFServerOgcAttributes, GMFServerOgcObjectAttributes, GMFServerOgcColumnAttributes } from './gmf.js';
9
+ export type { GMFMetadata, GMFChildLayer, GMFTreeItem, GMFThemeFunctionality, GMFThemeFunctionalities, GMFTheme, GMFGroup, GMFServerOgcType, GMFServerOgc, GMFServerOgcAttributes, GMFServerOgcObjectAttributes, GMFServerOgcColumnAttributes, GMFServerOgcServices } from './gmf.js';
10
+ export { supportedOgcServicesForMap, supportedOgcServicesForQuery, supportedOgcServicesForEdit } from './gmf.js';
10
11
  export type { LayerId, TreeItemDefinition, ThemeDefinition, BasemapDefinition } from './layerdefinitions.js';
11
12
  export { default as BaseLayer } from './layers/baselayer.js';
13
+ export type { EditableLayer } from './layers/editablelayer.js';
14
+ export { isEditableLayer } from './layers/editablelayer.js';
12
15
  export type { GroupLayerOptions } from './layers/grouplayer.js';
13
16
  export { default as GroupLayer } from './layers/grouplayer.js';
14
17
  export type { default as ILayerWithFilter } from './layers/ilayerwithfilter.js';
@@ -35,14 +38,16 @@ export { default as ThemeLayer } from './layers/themelayer.js';
35
38
  export { default as ThemeLayerExternal } from './layers/themelayerexternal.js';
36
39
  export type { TimeAwareLayer } from './layers/timeawarelayer.js';
37
40
  export { isTimeAwareLayer } from './layers/timeawarelayer.js';
41
+ export { OapifLayer } from './oapiflayer.js';
42
+ export type { OapifPropertyTypes, OapifPropertyFormats, OapifSchemaResponse, OapifSchemaPropertyOptions, OapifReferenceList, OapifCollection, EditingPermission } from './oapiftypes.js';
43
+ export { oapifNumericFormats, oapifStringFormats, oapifTemporalFormats, oapifPropertyFormatList, supportedGeometryTypesForEditing, EditingOperations } from './oapiftypes.js';
38
44
  export type { SearchResultsActions } from './searchresult.js';
39
45
  export type { SelectionTool, SelectionMode } from './selection.js';
40
46
  export { default as SelectionParam } from './selectionparam.js';
41
47
  export { default as ServerOgc } from './serverogc.js';
42
48
  export type { HttpMethod, OgcApiLinksResponse } from './serverogcapi.js';
43
- export { default as ServerOgcApi, OgcApiDefaultEncoding } from './serverogcapi.js';
44
- export type { oapifPropertyTypes, OapifSchemaResponse, OapifPropertySchema, OapifCollection, OapifLayer } from './serverogcapifeatures.js';
45
- export { default as ServerOgcApiFeatures, oapifNumericTypes, oapifTextTypes, oapifTemporalTypes, oapifPropertyTypesList } from './serverogcapifeatures.js';
49
+ export { default as ServerOgcApi, OgcApiDefaultEncoding, OgcApiGeoJsonEncoding, OgcApiSchemaEncoding } from './serverogcapi.js';
50
+ export { default as ServerOgcApiFeatures } from './serverogcapifeatures.js';
46
51
  export type { LayerAttribute } from './serverwfs.js';
47
52
  export { default as ServerWfs } from './serverwfs.js';
48
53
  export { default as Theme } from './theme.js';
package/models/main.js CHANGED
@@ -4,7 +4,9 @@ export { default as BasemapOsm } from './basemaps/basemaposm.js';
4
4
  export { default as BasemapSwisstopoVectorTiles } from './basemaps/basemapswisstopovectortiles.js';
5
5
  export { default as CustomTheme } from './customtheme.js';
6
6
  export { filterOperatorValues, filterOperators, isFilterOperator, isValuelessFilterOperator, isTwoSidedFilterOperator, isListFilterOperator, operatorsByAttributeTypeGroup, logicalFilterOperators, isLogicalFilterOperator } from './filter.js';
7
+ export { supportedOgcServicesForMap, supportedOgcServicesForQuery, supportedOgcServicesForEdit } from './gmf.js';
7
8
  export { default as BaseLayer } from './layers/baselayer.js';
9
+ export { isEditableLayer } from './layers/editablelayer.js';
8
10
  export { default as GroupLayer } from './layers/grouplayer.js';
9
11
  export { default as Layer } from './layers/layer.js';
10
12
  export { default as LayerCog } from './layers/layercog.js';
@@ -22,10 +24,12 @@ export { isSnappableLayer } from './layers/snappablelayer.js';
22
24
  export { default as ThemeLayer } from './layers/themelayer.js';
23
25
  export { default as ThemeLayerExternal } from './layers/themelayerexternal.js';
24
26
  export { isTimeAwareLayer } from './layers/timeawarelayer.js';
27
+ export { OapifLayer } from './oapiflayer.js';
28
+ export { oapifNumericFormats, oapifStringFormats, oapifTemporalFormats, oapifPropertyFormatList, supportedGeometryTypesForEditing, EditingOperations } from './oapiftypes.js';
25
29
  export { default as SelectionParam } from './selectionparam.js';
26
30
  export { default as ServerOgc } from './serverogc.js';
27
- export { default as ServerOgcApi, OgcApiDefaultEncoding } from './serverogcapi.js';
28
- export { default as ServerOgcApiFeatures, oapifNumericTypes, oapifTextTypes, oapifTemporalTypes, oapifPropertyTypesList } from './serverogcapifeatures.js';
31
+ export { default as ServerOgcApi, OgcApiDefaultEncoding, OgcApiGeoJsonEncoding, OgcApiSchemaEncoding } from './serverogcapi.js';
32
+ export { default as ServerOgcApiFeatures } from './serverogcapifeatures.js';
29
33
  export { default as ServerWfs } from './serverwfs.js';
30
34
  export { default as Theme } from './theme.js';
31
35
  export { xmlNumberTypesStrList, xmlStringTypesStrList, xmlDatetimeTypesStrList, xmlGeometryTypesStrList, xmlTypesStrList, isStringNumeric, isString, isNumber, isDate, isGeometry, sanitizeGeometryType, isAreaLikeGeometryTypeOrUnknown, typeGroupFromAttributeType } from './xmlTypes.js';
@@ -0,0 +1,29 @@
1
+ import ServerOgc from './serverogc.js';
2
+ import { EditingPermission, OapifCollection } from './oapiftypes.js';
3
+ import OgcApiFeaturesSchema from '../tools/ogcapi/ogcapifeaturesschema.js';
4
+ import { Type as olGeometryType, GeometryLayout as olGeometryLayout } from 'ol/geom/Geometry.js';
5
+ export declare class OapifLayer {
6
+ readonly id: string;
7
+ readonly title?: string;
8
+ readonly description?: string;
9
+ readonly server: ServerOgc;
10
+ storageCrs?: string;
11
+ geometryLayout?: olGeometryLayout;
12
+ schema?: OgcApiFeaturesSchema;
13
+ permissions?: EditingPermission[];
14
+ constructor(server: ServerOgc, collection: OapifCollection);
15
+ get geometryType(): olGeometryType | undefined;
16
+ /**
17
+ * Generates a unique layer name by combining the server name and collection id
18
+ */
19
+ get uniqueLayerName(): string;
20
+ /**
21
+ * Validity decides if this layer can be used for editing
22
+ */
23
+ get valid(): boolean;
24
+ /**
25
+ * If permissions are undefined, this means the server hasn't specified which CRUD operations are allowed.
26
+ * In this case, all operations are assumed to be allowed.
27
+ */
28
+ hasPermission(permission: EditingPermission): boolean;
29
+ }
@@ -0,0 +1,40 @@
1
+ import { getEpsgCodeFromCrsUri } from '../tools/ogcapi/ogcapifeaturesclient.js';
2
+ export class OapifLayer {
3
+ id;
4
+ title;
5
+ description;
6
+ server;
7
+ storageCrs;
8
+ geometryLayout;
9
+ schema;
10
+ permissions;
11
+ constructor(server, collection) {
12
+ this.id = collection.id;
13
+ this.title = collection.title;
14
+ this.description = collection.description;
15
+ this.storageCrs = collection.storageCrs ? getEpsgCodeFromCrsUri(collection.storageCrs) : undefined;
16
+ this.server = server;
17
+ }
18
+ get geometryType() {
19
+ return this.schema?.geometryType;
20
+ }
21
+ /**
22
+ * Generates a unique layer name by combining the server name and collection id
23
+ */
24
+ get uniqueLayerName() {
25
+ return this.server?.getUniqueLayerName(this.id) ?? '';
26
+ }
27
+ /**
28
+ * Validity decides if this layer can be used for editing
29
+ */
30
+ get valid() {
31
+ return !!this.storageCrs && !!this.schema && !!this.geometryType && !!this.geometryLayout;
32
+ }
33
+ /**
34
+ * If permissions are undefined, this means the server hasn't specified which CRUD operations are allowed.
35
+ * In this case, all operations are assumed to be allowed.
36
+ */
37
+ hasPermission(permission) {
38
+ return this.permissions === undefined ? true : (this.permissions.includes(permission) ?? false);
39
+ }
40
+ }
@@ -0,0 +1,71 @@
1
+ import { OgcApiLinksResponse } from './serverogcapi.js';
2
+ import { Type as olGeometryType } from 'ol/geom/Geometry.js';
3
+ export type OapifPropertyTypes = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
4
+ export declare const oapifNumericFormats: string[];
5
+ export declare const oapifStringFormats: string[];
6
+ export declare const oapifTemporalFormats: string[];
7
+ export declare const oapifPropertyFormatList: readonly string[];
8
+ export type OapifPropertyFormats = (typeof oapifPropertyFormatList)[number];
9
+ export interface OapifSchemaResponse {
10
+ $id: string;
11
+ $schema: string;
12
+ title?: string;
13
+ description?: string;
14
+ type?: string;
15
+ required?: string[];
16
+ properties: Record<string, OapifSchemaPropertyOptions>;
17
+ }
18
+ export interface OapifSchemaPropertyOptions {
19
+ 'title'?: string;
20
+ 'description'?: string;
21
+ 'type'?: OapifPropertyTypes;
22
+ 'format'?: OapifPropertyFormats;
23
+ 'x-ogc-role'?: string;
24
+ 'x-ogc-propertySeq'?: number;
25
+ 'readOnly'?: boolean;
26
+ 'pattern'?: string;
27
+ 'minLength'?: number;
28
+ 'maxLength'?: number;
29
+ 'minimum'?: number;
30
+ 'maximum'?: number;
31
+ 'exclusiveMinimum'?: number;
32
+ 'exclusiveMaximum'?: number;
33
+ 'enum'?: string[] | number[];
34
+ 'oneOf'?: {
35
+ const: string | number;
36
+ title?: string;
37
+ }[];
38
+ 'x-ogc-collectionId'?: string;
39
+ 'x-ogc-nullValues'?: Array<string | number>;
40
+ }
41
+ export interface OapifReferenceList {
42
+ value: string | number;
43
+ title: string;
44
+ }
45
+ export interface OapifCollection {
46
+ id: string;
47
+ title?: string;
48
+ description?: string;
49
+ links: OgcApiLinksResponse[];
50
+ itemType?: string;
51
+ extent?: {
52
+ spatial: {
53
+ bbox: number[][];
54
+ crs: string;
55
+ };
56
+ temporal?: {
57
+ interval: string[][];
58
+ trs: string;
59
+ };
60
+ };
61
+ crs?: string[];
62
+ storageCrs?: string;
63
+ }
64
+ export declare const supportedGeometryTypesForEditing: olGeometryType[];
65
+ export declare const EditingOperations: {
66
+ readonly POST: "CREATE";
67
+ readonly PUT: "REPLACE";
68
+ readonly PATCH: "UPDATE";
69
+ readonly DELETE: "DELETE";
70
+ };
71
+ export type EditingPermission = 'CREATE' | 'REPLACE' | 'UPDATE' | 'DELETE';
@@ -0,0 +1,29 @@
1
+ export const oapifNumericFormats = [
2
+ 'integer',
3
+ 'number',
4
+ 'double',
5
+ 'float',
6
+ 'decimal',
7
+ 'int',
8
+ 'int32',
9
+ 'int64',
10
+ 'uint32',
11
+ 'uint64'
12
+ ];
13
+ export const oapifStringFormats = ['string', 'uuid', 'uri-template'];
14
+ export const oapifTemporalFormats = ['date', 'time', 'date-time', 'datetime'];
15
+ export const oapifPropertyFormatList = [
16
+ ...oapifNumericFormats,
17
+ ...oapifStringFormats,
18
+ ...oapifTemporalFormats
19
+ ];
20
+ export const supportedGeometryTypesForEditing = [
21
+ 'Point',
22
+ 'LineString',
23
+ 'LinearRing',
24
+ 'Polygon',
25
+ 'MultiPoint',
26
+ 'MultiLineString',
27
+ 'MultiPolygon'
28
+ ];
29
+ export const EditingOperations = { POST: 'CREATE', PUT: 'REPLACE', PATCH: 'UPDATE', DELETE: 'DELETE' };
@@ -1,17 +1,19 @@
1
- import { GMFServerOgc, GMFServerOgcType } from './gmf.js';
1
+ import { GMFServerOgc, GMFServerOgcServices, GMFServerOgcType } from './gmf.js';
2
2
  export default class ServerOgc {
3
3
  name: string;
4
4
  url: string;
5
5
  wfsSupport: boolean;
6
6
  urlWfs?: string;
7
- oapifSupport: boolean;
8
- urlOapif?: string;
9
7
  type: GMFServerOgcType;
10
8
  imageType: string;
11
9
  aliases: Record<string, string>;
10
+ services: GMFServerOgcServices;
12
11
  constructor(name: string, elem: GMFServerOgc);
13
12
  private getAliasKey;
14
13
  private initializeAliases;
14
+ private initializeServices;
15
15
  getAlias(table: string, column: string): string;
16
16
  get uniqueWmsQueryId(): string;
17
+ getUniqueLayerName(layerName: string): string;
18
+ get hasEditService(): boolean;
17
19
  }
@@ -1,23 +1,23 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ import { supportedOgcServicesForEdit } from './gmf.js';
1
3
  export default class ServerOgc {
2
4
  name;
3
5
  url;
4
- wfsSupport;
5
- urlWfs;
6
- oapifSupport;
7
- urlOapif;
6
+ wfsSupport; // Deprecated for use in GeoGirafe since GMF version 2.10
7
+ urlWfs; // Deprecated for use in GeoGirafe since GMF version 2.10
8
8
  type;
9
9
  imageType;
10
10
  aliases;
11
+ services;
11
12
  constructor(name, elem) {
12
13
  this.name = name;
13
14
  this.url = elem.url;
14
15
  this.wfsSupport = elem.wfsSupport;
15
16
  this.urlWfs = elem.urlWfs;
16
- this.oapifSupport = elem.oapifSupport ?? false;
17
- this.urlOapif = elem.urlOapif;
18
17
  this.type = elem.type;
19
18
  this.imageType = elem.imageType;
20
19
  this.aliases = this.initializeAliases(elem);
20
+ this.services = this.initializeServices(elem);
21
21
  }
22
22
  getAliasKey(table, column) {
23
23
  return `${table}-${column}`;
@@ -35,6 +35,13 @@ export default class ServerOgc {
35
35
  }
36
36
  return aliases;
37
37
  }
38
+ initializeServices(elem) {
39
+ if (elem.uses?.edit && !supportedOgcServicesForEdit.includes(elem.uses?.edit.protocol)) {
40
+ console.warn(`OgcServer - Unsupported protocol '${elem.uses.edit.protocol}' for edit service`);
41
+ delete elem.uses.edit;
42
+ }
43
+ return elem.uses ?? {};
44
+ }
38
45
  getAlias(table, column) {
39
46
  const key = this.getAliasKey(table, column);
40
47
  return this.aliases[key];
@@ -42,4 +49,10 @@ export default class ServerOgc {
42
49
  get uniqueWmsQueryId() {
43
50
  return this.name + this.imageType;
44
51
  }
52
+ getUniqueLayerName(layerName) {
53
+ return `${this.name}-${layerName}`;
54
+ }
55
+ get hasEditService() {
56
+ return !!this.services.edit && !!this.services.edit.url && this.services.edit.protocol === 'OGC API - Features';
57
+ }
45
58
  }
@@ -6,6 +6,8 @@ export default class ServerOgcApi {
6
6
  }
7
7
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS';
8
8
  export declare const OgcApiDefaultEncoding = "application/json";
9
+ export declare const OgcApiGeoJsonEncoding = "application/geo+json";
10
+ export declare const OgcApiSchemaEncoding = "application/schema+json";
9
11
  export type OgcApiLinksResponse = {
10
12
  href: string;
11
13
  rel: string;
@@ -6,3 +6,5 @@ export default class ServerOgcApi {
6
6
  }
7
7
  }
8
8
  export const OgcApiDefaultEncoding = 'application/json';
9
+ export const OgcApiGeoJsonEncoding = 'application/geo+json';
10
+ export const OgcApiSchemaEncoding = 'application/schema+json';
@@ -1,65 +1,8 @@
1
- import ServerOgcApi, { OgcApiLinksResponse } from './serverogcapi.js';
2
- import ServerOgc from './serverogc.js';
3
- export declare const oapifNumericTypes: string[];
4
- export declare const oapifTextTypes: string[];
5
- export declare const oapifTemporalTypes: string[];
6
- export declare const oapifPropertyTypesList: readonly string[];
7
- export type oapifPropertyTypes = (typeof oapifPropertyTypesList)[number];
1
+ import ServerOgcApi from './serverogcapi.js';
2
+ import { OapifCollection } from './oapiftypes.js';
8
3
  export default class ServerOgcApiFeatures extends ServerOgcApi {
4
+ collections: Map<string, OapifCollection>;
9
5
  constructor(url: string);
6
+ addCollection(collection: OapifCollection): void;
7
+ get hasEditableLayers(): boolean;
10
8
  }
11
- export type OapifSchemaResponse = {
12
- $id?: string;
13
- $schema?: string;
14
- title?: string;
15
- description?: string;
16
- type?: string;
17
- properties: Record<string, OapifPropertySchema>;
18
- };
19
- export type OapifPropertySchema = {
20
- 'title'?: string;
21
- 'description'?: string;
22
- 'type'?: oapifPropertyTypes;
23
- 'format'?: string;
24
- 'x-ogc-role'?: string;
25
- 'x-ogc-propertySeq'?: number;
26
- 'readOnly'?: boolean;
27
- 'required'?: boolean;
28
- 'maxLength'?: number;
29
- 'minimum'?: number;
30
- 'maximum'?: number;
31
- 'enum'?: Array<string | number>;
32
- 'oneOf'?: {
33
- const: string;
34
- value: string;
35
- }[];
36
- 'x-orc-codelistUri'?: string;
37
- };
38
- export type OapifCollection = {
39
- id: string;
40
- title: string;
41
- description?: string;
42
- links: OgcApiLinksResponse[];
43
- itemType: string;
44
- extent?: {
45
- spatial: {
46
- bbox: number[][];
47
- crs: string;
48
- };
49
- };
50
- crs?: string[];
51
- storageCrs?: string;
52
- };
53
- export type OapifLayer = {
54
- url: string;
55
- collectionId: string;
56
- collectionTitle: string;
57
- displayName: string;
58
- crs: string;
59
- credentials?: string;
60
- geometryType: 'Point' | 'LineString' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon';
61
- attributeName: string;
62
- attributeType: string;
63
- serverType: string;
64
- server: ServerOgc;
65
- };
@@ -1,11 +1,15 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import ServerOgcApi from './serverogcapi.js';
3
- export const oapifNumericTypes = ['integer', 'number', 'double', 'float', 'decimal', 'int', 'int32', 'int64'];
4
- export const oapifTextTypes = ['string', 'date', 'time', 'datetime', 'date-time', 'duration'];
5
- export const oapifTemporalTypes = ['date', 'time', 'date-time', 'datetime'];
6
- export const oapifPropertyTypesList = [...oapifNumericTypes, ...oapifTextTypes, ...oapifTemporalTypes];
7
3
  export default class ServerOgcApiFeatures extends ServerOgcApi {
4
+ collections;
8
5
  constructor(url) {
9
6
  super(url);
7
+ this.collections = new Map();
8
+ }
9
+ addCollection(collection) {
10
+ this.collections.set(collection.id, collection);
11
+ }
12
+ get hasEditableLayers() {
13
+ return this.collections.size > 0;
10
14
  }
11
15
  }
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.3.0-dev.3053452205",
8
+ "version": "1.3.0-dev.3079206142",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -239,6 +239,7 @@
239
239
  <button
240
240
  tip="edit-panel"
241
241
  slot="menu-content"
242
+ data-visibility-control="edit"
242
243
  class="gg-icon-button gg-big"
243
244
  onclick="
244
245
  document.geogirafe.state.interface.editPanelVisible = !document.geogirafe.state.interface.editPanelVisible
@@ -1 +1 @@
1
- {"version":"1.3.0-dev.3053452205", "build":"3053452205", "date":"11/11/2026"}
1
+ {"version":"1.3.0-dev.3079206142", "build":"3079206142", "date":"17/11/2026"}
@@ -11,7 +11,7 @@ import CrossSectionSettingsComponent from '../../components/cross-section/cross-
11
11
  import CrossSectionViewComponent from '../../components/cross-section/cross-section-viewer/component.js';
12
12
  import DrawingComponent, { DrawingStateLocation } from '../../components/drawing/component.js';
13
13
  import EditComponent from '../../components/edit/component.js';
14
- import EditFromComponent from '../../components/edit/editform/component.js';
14
+ import EditFormComponent from '../../components/edit/editform/component.js';
15
15
  import HelpComponent from '../../components/help/component.js';
16
16
  import InfoboxComponent from '../../components/infobox/component.js';
17
17
  import InfoWindowComponent from '../../components/infowindow/component.js';
@@ -143,7 +143,7 @@ export default class GeoGirafeApp {
143
143
  customElements.define('girafe-drawing', DrawingComponent);
144
144
  customElements.define('girafe-drawing-toolbar', DrawingToolbarComponent);
145
145
  customElements.define('girafe-edit', EditComponent);
146
- customElements.define('girafe-edit-form', EditFromComponent);
146
+ customElements.define('girafe-edit-form', EditFormComponent);
147
147
  customElements.define('girafe-scale', ScaleComponent);
148
148
  customElements.define('girafe-search-filter', SearchFilterComponent);
149
149
  customElements.define('girafe-search', SearchComponent);
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import DrawingFeature, { DrawingShape } from './drawingFeature.js';
3
3
  import { Collection, Feature } from 'ol';
4
- import { Circle as CircleGeom, Geometry, LinearRing, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from 'ol/geom.js';
4
+ import { Circle as CircleGeom, Geometry, LineString, Point, Polygon } from 'ol/geom.js';
5
5
  import { createBox, createRegularPolygon } from 'ol/interaction/Draw.js';
6
6
  import { Circle, Fill, RegularShape, Stroke, Style, Text } from 'ol/style.js';
7
7
  import { Draw, Modify, Snap, Translate } from 'ol/interaction.js';
@@ -15,7 +15,7 @@ import { ContextMenu, EntryInteractionType } from './contextmenu.js';
15
15
  import { formatCoordinates } from '../geometrytools.js';
16
16
  import { v4 as uuidv4 } from 'uuid';
17
17
  import { isAlternateMouseClick, isPrimaryPointerAction } from '../state/userinteractionevent.js';
18
- import { calculateCenterAndMinRadius, createScaledAndRotatedGeometry, getGeometryForRendering, shouldAllowVertexInsertionForShape } from './shapeConstraints.js';
18
+ import { calculateCenterAndMinRadius, createScaledAndRotatedGeometry, extractVerticesFromGeometry, getGeometryForRendering, shouldAllowVertexInsertionForShape } from './shapeConstraints.js';
19
19
  import Transform from 'ol-ext/interaction/Transform.js';
20
20
  function getLineStroke(strokeType, lineWidth) {
21
21
  switch (strokeType) {
@@ -29,26 +29,6 @@ function getLineStroke(strokeType, lineWidth) {
29
29
  return [0.01, 5 * lineWidth];
30
30
  }
31
31
  }
32
- function extractVerticesFromGeometry(geometry) {
33
- let vertices = [];
34
- // Extract coordinates depending on coordinate array depth
35
- if (geometry instanceof Point) {
36
- vertices = [geometry.getCoordinates()];
37
- }
38
- else if (geometry instanceof MultiPoint || geometry instanceof LineString || geometry instanceof LinearRing) {
39
- vertices = geometry.getCoordinates();
40
- }
41
- else if (geometry instanceof Polygon || geometry instanceof MultiLineString) {
42
- vertices = geometry.getCoordinates().flat();
43
- }
44
- else if (geometry instanceof MultiPolygon) {
45
- vertices = geometry
46
- .getCoordinates()
47
- .flat()
48
- .map((coordinateList) => coordinateList.flat());
49
- }
50
- return new MultiPoint(vertices);
51
- }
52
32
  export default class OlDrawing {
53
33
  map;
54
34
  // Writes drawn features into the specified location in the extended state
@@ -1,7 +1,7 @@
1
1
  import { Coordinate } from 'ol/coordinate.js';
2
- import Geometry from 'ol/geom/Geometry.js';
3
2
  import Feature from 'ol/Feature.js';
4
3
  import { DrawingShape } from './drawingFeature.js';
4
+ import { Geometry, MultiPoint } from 'ol/geom.js';
5
5
  export declare function calculateCenterAndMinRadius(geometry: Geometry): {
6
6
  center: Coordinate;
7
7
  minRadius: number;
@@ -9,3 +9,4 @@ export declare function calculateCenterAndMinRadius(geometry: Geometry): {
9
9
  export declare function createScaledAndRotatedGeometry(geometry0: Geometry, center: Coordinate, minRadius: number, initialPoint: Coordinate, currentPoint: Coordinate): Geometry;
10
10
  export declare function getGeometryForRendering(feature: Feature<Geometry>): Geometry | undefined;
11
11
  export declare function shouldAllowVertexInsertionForShape(shapeType: DrawingShape | undefined): boolean;
12
+ export declare function extractVerticesFromGeometry(geometry: Geometry): MultiPoint;
@@ -1,8 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import { getCenter, getHeight, getWidth } from 'ol/extent.js';
3
- import LineString from 'ol/geom/LineString.js';
4
- import Polygon from 'ol/geom/Polygon.js';
5
3
  import { DrawingShape } from './drawingFeature.js';
4
+ import { LinearRing, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from 'ol/geom.js';
6
5
  const EPSILON = 1e-12;
7
6
  function sqDistance(a, b) {
8
7
  const dx = a[0] - b[0];
@@ -62,3 +61,20 @@ export function getGeometryForRendering(feature) {
62
61
  export function shouldAllowVertexInsertionForShape(shapeType) {
63
62
  return shapeType !== DrawingShape.Square && shapeType !== DrawingShape.Rectangle;
64
63
  }
64
+ export function extractVerticesFromGeometry(geometry) {
65
+ let vertices = [];
66
+ // Extract coordinates depending on coordinate array depth
67
+ if (geometry instanceof Point) {
68
+ vertices = [geometry.getCoordinates()];
69
+ }
70
+ else if (geometry instanceof MultiPoint || geometry instanceof LineString || geometry instanceof LinearRing) {
71
+ vertices = geometry.getCoordinates();
72
+ }
73
+ else if (geometry instanceof Polygon || geometry instanceof MultiLineString) {
74
+ vertices = geometry.getCoordinates().flat();
75
+ }
76
+ else if (geometry instanceof MultiPolygon) {
77
+ vertices = geometry.getCoordinates().flat().flat();
78
+ }
79
+ return new MultiPoint(vertices);
80
+ }