@igo2/geo 18.0.0-next.6 → 18.0.0-next.7

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 (40) hide show
  1. package/esm2022/lib/datasource/shared/datasources/arcgisrest-datasource.mjs +1 -1
  2. package/esm2022/lib/datasource/shared/datasources/carto-datasource.mjs +1 -1
  3. package/esm2022/lib/datasource/shared/datasources/cluster-datasource.mjs +1 -1
  4. package/esm2022/lib/datasource/shared/datasources/feature-datasource.mjs +1 -1
  5. package/esm2022/lib/datasource/shared/datasources/imagearcgisrest-datasource.mjs +1 -1
  6. package/esm2022/lib/datasource/shared/datasources/mvt-datasource.mjs +1 -1
  7. package/esm2022/lib/datasource/shared/datasources/osm-datasource.mjs +1 -1
  8. package/esm2022/lib/datasource/shared/datasources/tilearcgisrest-datasource.mjs +1 -1
  9. package/esm2022/lib/datasource/shared/datasources/tiledebug-datasource.mjs +1 -1
  10. package/esm2022/lib/datasource/shared/datasources/websocket-datasource.mjs +1 -1
  11. package/esm2022/lib/datasource/shared/datasources/wfs-datasource.mjs +66 -2
  12. package/esm2022/lib/datasource/shared/datasources/wms-datasource.mjs +1 -1
  13. package/esm2022/lib/datasource/shared/datasources/wms-wfs.utils.mjs +7 -5
  14. package/esm2022/lib/datasource/shared/datasources/wmts-datasource.mjs +1 -1
  15. package/esm2022/lib/datasource/shared/datasources/xyz-datasource.mjs +1 -1
  16. package/esm2022/lib/filter/shared/ogc-filter.mjs +7 -2
  17. package/esm2022/lib/import-export/import-export/import-export.component.mjs +196 -315
  18. package/esm2022/lib/import-export/shared/export.interface.mjs +1 -1
  19. package/esm2022/lib/import-export/shared/export.service.mjs +278 -88
  20. package/esm2022/lib/import-export/shared/export.type.mjs +9 -9
  21. package/esm2022/lib/import-export/shared/export.utils.mjs +5 -1
  22. package/esm2022/lib/layer/shared/layer.service.mjs +1 -1
  23. package/esm2022/lib/layer/shared/layers/image-layer.mjs +1 -1
  24. package/esm2022/lib/layer/shared/layers/tile-layer.mjs +1 -1
  25. package/esm2022/lib/layer/shared/layers/vector-layer.mjs +12 -15
  26. package/esm2022/lib/layer/shared/layers/vectortile-layer.mjs +1 -1
  27. package/esm2022/lib/map/wake-lock-button/wake-lock-button.component.mjs +1 -2
  28. package/fesm2022/igo2-geo.mjs +3146 -3008
  29. package/fesm2022/igo2-geo.mjs.map +1 -1
  30. package/lib/datasource/shared/datasources/wfs-datasource.d.ts +15 -0
  31. package/lib/import-export/import-export/import-export.component.d.ts +22 -14
  32. package/lib/import-export/shared/export.interface.d.ts +10 -3
  33. package/lib/import-export/shared/export.service.d.ts +31 -15
  34. package/lib/import-export/shared/export.type.d.ts +8 -16
  35. package/lib/import-export/shared/export.utils.d.ts +2 -0
  36. package/lib/layer/shared/layers/vector-layer.d.ts +0 -3
  37. package/locale/en.geo.json +8 -3
  38. package/locale/fr.geo.json +8 -3
  39. package/package.json +6 -6
  40. package/src/_index.scss +2 -1
@@ -1,9 +1,20 @@
1
+ import type { HttpClient } from '@angular/common/http';
1
2
  import { AuthInterceptor } from '@igo2/auth';
3
+ import OlFeature from 'ol/Feature';
4
+ import { Extent } from 'ol/extent';
5
+ import type { default as OlGeometry } from 'ol/geom/Geometry';
6
+ import olProjection from 'ol/proj/Projection';
2
7
  import olSourceVector from 'ol/source/Vector';
8
+ import { Observable } from 'rxjs';
3
9
  import { OgcFiltersOptions } from '../../../filter/shared/ogc-filter.interface';
4
10
  import { DataSource } from './datasource';
5
11
  import { WFSDataSourceOptions } from './wfs-datasource.interface';
6
12
  import { WFSService } from './wfs.service';
13
+ interface FetchFeatureOptions {
14
+ extent: Extent;
15
+ projection: olProjection;
16
+ httpClient: HttpClient;
17
+ }
7
18
  export declare class WFSDataSource extends DataSource {
8
19
  options: WFSDataSourceOptions;
9
20
  protected wfsService: WFSService;
@@ -15,4 +26,8 @@ export declare class WFSDataSource extends DataSource {
15
26
  protected createOlSource(): olSourceVector;
16
27
  setOgcFilters(ogcFilters: OgcFiltersOptions, triggerEvent?: boolean): void;
17
28
  onUnwatch(): void;
29
+ fetchFeatures({ extent, projection, httpClient }: FetchFeatureOptions): Observable<OlFeature<OlGeometry>[]>;
30
+ private _fetchFeatures;
31
+ private _parseXmlFeatures;
18
32
  }
33
+ export {};
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
3
3
  import { MatSlideToggleChange } from '@angular/material/slide-toggle';
4
4
  import { ConfirmDialogService } from '@igo2/common/confirm-dialog';
@@ -18,9 +18,10 @@ import { StyleListService } from '../../style/style-list/style-list.service';
18
18
  import { StyleService } from '../../style/style-service/style.service';
19
19
  import { ExportOptions } from '../shared/export.interface';
20
20
  import { ExportService } from '../shared/export.service';
21
- import { ExportFormat } from '../shared/export.type';
21
+ import { isCsvExport } from '../shared/export.utils';
22
22
  import { ImportService } from '../shared/import.service';
23
23
  import * as i0 from "@angular/core";
24
+ type SelectMode = 'import' | 'export';
24
25
  export declare class ImportExportComponent implements OnDestroy, OnInit {
25
26
  private importService;
26
27
  private exportService;
@@ -30,23 +31,22 @@ export declare class ImportExportComponent implements OnDestroy, OnInit {
30
31
  private styleService;
31
32
  private formBuilder;
32
33
  private config;
33
- private cdRef;
34
34
  private storageService;
35
35
  private downloadService;
36
36
  private layerService;
37
37
  private confirmDialogService;
38
38
  form: UntypedFormGroup;
39
39
  importForm: UntypedFormGroup;
40
- formats$: BehaviorSubject<any>;
41
- encodings$: BehaviorSubject<any>;
40
+ formats$: BehaviorSubject<("GeoJSON" | "Excel" | "Shapefile" | "GML" | "GPX" | "KML" | "CSV" | "URL")[]>;
42
41
  exportableLayers$: BehaviorSubject<AnyLayer[]>;
43
42
  loading$: BehaviorSubject<boolean>;
44
43
  forceNaming: boolean;
45
44
  controlFormat: string;
45
+ csvSeparators: readonly ["auto", "comma", "semicolon"];
46
+ isCsvExport: typeof isCsvExport;
46
47
  private layers$$;
47
48
  private exportableLayers$$;
48
49
  private formats$$;
49
- private encodings$$;
50
50
  private formLayer$$;
51
51
  private exportOptions$$;
52
52
  importHtmlClarifications: string;
@@ -57,6 +57,7 @@ export declare class ImportExportComponent implements OnDestroy, OnInit {
57
57
  projections$: BehaviorSubject<InputProjections[]>;
58
58
  private projectionsConstraints;
59
59
  popupChecked: boolean;
60
+ private configFormats;
60
61
  private previousLayerSpecs$;
61
62
  selectFirstProj: boolean;
62
63
  map: IgoMap;
@@ -68,8 +69,8 @@ export declare class ImportExportComponent implements OnDestroy, OnInit {
68
69
  * Store that holds the available workspaces.
69
70
  */
70
71
  store: WorkspaceStore;
71
- selectedMode: string;
72
- selectMode: EventEmitter<string>;
72
+ selectedMode: SelectMode;
73
+ selectMode: EventEmitter<SelectMode>;
73
74
  exportOptions$: BehaviorSubject<ExportOptions>;
74
75
  exportOptionsChange: EventEmitter<ExportOptions>;
75
76
  get layers(): any;
@@ -78,10 +79,9 @@ export declare class ImportExportComponent implements OnDestroy, OnInit {
78
79
  set inputProj(value: any);
79
80
  get popupAllowed(): boolean;
80
81
  set popupAllowed(value: boolean);
81
- constructor(importService: ImportService, exportService: ExportService, languageService: LanguageService, messageService: MessageService, styleListService: StyleListService, styleService: StyleService, formBuilder: UntypedFormBuilder, config: ConfigService, cdRef: ChangeDetectorRef, storageService: StorageService, downloadService: DownloadService, layerService: LayerService, confirmDialogService: ConfirmDialogService);
82
+ constructor(importService: ImportService, exportService: ExportService, languageService: LanguageService, messageService: MessageService, styleListService: StyleListService, styleService: StyleService, formBuilder: UntypedFormBuilder, config: ConfigService, storageService: StorageService, downloadService: DownloadService, layerService: LayerService, confirmDialogService: ConfirmDialogService);
82
83
  ngOnInit(): void;
83
84
  private computeProjections;
84
- private getWorkspaceByLayerId;
85
85
  getLayerTitleById(id: any): string;
86
86
  layerHasSelectedFeatures(layer: Layer): boolean;
87
87
  onlySelected(event: MatSlideToggleChange, id: string): void;
@@ -91,22 +91,30 @@ export declare class ImportExportComponent implements OnDestroy, OnInit {
91
91
  private handlePreviousLayerSpecs;
92
92
  importFiles(files: File[]): void;
93
93
  handlePopup(preCheck?: boolean): boolean;
94
- handleExportFormSubmit(data: ExportOptions): void;
94
+ private isOgreOrLink;
95
+ handleExportFormSubmit(data: ExportOptions): Promise<void>;
96
+ private handleUrlExport;
97
+ private validateGpxExport;
98
+ private handleCsvExport;
99
+ private handleExport;
100
+ private getAllLayerGeomTypes;
95
101
  private createTitleEmptyRows;
96
102
  private circleToPoint;
97
103
  private buildForm;
104
+ private handleCsvForm;
98
105
  private onFileImportSuccess;
99
106
  private onFileImportError;
100
107
  private onPopupBlockedError;
101
108
  private onFileExportError;
102
109
  private loadConfig;
103
- encodingDefaultValue(format: ExportFormat): "UTF8" | "LATIN1";
104
- private loadEncodings;
105
110
  private computeFormats;
111
+ private getAvailableFormats;
106
112
  private validateListFormat;
107
- modeChanged(mode: any): void;
113
+ private compareString;
114
+ modeChanged(mode: SelectMode): void;
108
115
  private onFileExportSuccess;
109
116
  onImportExportChange(event: any): void;
110
117
  static ɵfac: i0.ɵɵFactoryDeclaration<ImportExportComponent, never>;
111
118
  static ɵcmp: i0.ɵɵComponentDeclaration<ImportExportComponent, "igo-import-export", never, { "selectFirstProj": { "alias": "selectFirstProj"; "required": false; }; "map": { "alias": "map"; "required": false; }; "contextUri": { "alias": "contextUri"; "required": false; }; "projectionsLimitations": { "alias": "projectionsLimitations"; "required": false; }; "store": { "alias": "store"; "required": false; }; "selectedMode": { "alias": "selectedMode"; "required": false; }; "exportOptions$": { "alias": "exportOptions$"; "required": false; }; }, { "selectMode": "selectMode"; "exportOptionsChange": "exportOptionsChange"; }, never, never, true, never>;
112
119
  }
120
+ export {};
@@ -1,11 +1,18 @@
1
- import { EncodingFormat, ExportFormat } from './export.type';
1
+ import type { default as OlFeature } from 'ol/Feature';
2
+ import type { Type } from 'ol/geom/Geometry';
3
+ import { AnyExportFormat, CsvSeparator } from './export.type';
2
4
  export interface ExportOptions {
3
- format?: ExportFormat;
4
- encoding?: EncodingFormat;
5
+ format?: AnyExportFormat;
5
6
  layers: string[];
6
7
  layersWithSelection?: string[];
7
8
  name?: string;
8
9
  combineLayers?: boolean;
9
10
  separator?: boolean;
11
+ csvSeparator?: CsvSeparator;
10
12
  featureInMapExtent?: boolean;
11
13
  }
14
+ export interface GeometryCollection {
15
+ /** The geometry type */
16
+ type: Type | null;
17
+ features: OlFeature[];
18
+ }
@@ -1,30 +1,46 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Workspace, WorkspaceStore } from '@igo2/common/workspace';
1
3
  import { ConfigService } from '@igo2/core/config';
2
4
  import OlFeature from 'ol/Feature';
5
+ import * as olformat from 'ol/format';
3
6
  import type { default as OlGeometry } from 'ol/geom/Geometry';
4
- import { Observable, Observer } from 'rxjs';
5
- import { EncodingFormat, ExportFormat } from './export.type';
7
+ import { Observable } from 'rxjs';
8
+ import { AnyLayer } from '../../layer';
9
+ import { IgoMap } from '../../map';
10
+ import { ExportOptions, GeometryCollection } from './export.interface';
11
+ import { AnyExportFormat, ExportOgreFormat } from './export.type';
6
12
  import * as i0 from "@angular/core";
7
13
  export declare class ExportService {
8
14
  private config;
9
- static ogreFormats: {
10
- GML: string;
11
- GPX: string;
12
- KML: string;
13
- Shapefile: string;
14
- CSVcomma: string;
15
- CSVsemicolon: string;
16
- };
17
- static noOgreFallbacks: string[];
15
+ private httpClient;
16
+ static ogreFormats: Record<ExportOgreFormat, string>;
17
+ static noOgreFallbacks: Partial<AnyExportFormat[]>;
18
18
  private ogreUrl;
19
19
  private aggregateInComment;
20
- constructor(config: ConfigService);
21
- export(olFeatures: OlFeature<OlGeometry>[], format: ExportFormat, title: string, encoding: EncodingFormat, projectionIn?: string, projectionOut?: string): Observable<void>;
22
- generateFeature(olFeatures: OlFeature<OlGeometry>[], format: ExportFormat, excludePrefix?: string): OlFeature<OlGeometry>[];
20
+ constructor(config: ConfigService, httpClient: HttpClient);
21
+ export(olFeatures: OlFeature<OlGeometry>[], options: ExportOptions, title: string, projectionIn?: string, projectionOut?: string): Observable<void>;
22
+ cleanFeatures(olFeatures: OlFeature<OlGeometry>[], format: AnyExportFormat, excludePrefix?: string): OlFeature<OlGeometry>[];
23
23
  private generateAggregatedFeature;
24
24
  private exportAsync;
25
- protected exportToFile(olFeatures: OlFeature<OlGeometry>[], observer: Observer<void>, format: ExportFormat, title: string, projectionIn: string, projectionOut: string): void;
25
+ protected exportToFile(olFeatures: OlFeature<OlGeometry>[], format: AnyExportFormat, title: string, projectionIn: string, projectionOut: string): Promise<void>;
26
+ private formatFeatures;
27
+ getFormatter(format: AnyExportFormat): import("ol/format/GML3").default | olformat.GPX | olformat.KML | olformat.GeoJSON<typeof OlFeature>;
28
+ exportExcel(map: IgoMap, store: WorkspaceStore, data: ExportOptions): Promise<void>;
29
+ private getTitleFromLayers;
30
+ private getLayerTitleFromId;
31
+ private addExcelSheet;
32
+ private formatRecord;
33
+ private formatDataType;
34
+ private getColumnsInfo;
35
+ private getColumnMaxWidth;
26
36
  private exportWithOgre;
37
+ private formatFilename;
27
38
  private nothingToExport;
39
+ private getFeaturesFromMap;
40
+ private getFeaturesFromWorkspace;
41
+ getFeatures(map: IgoMap, layer: AnyLayer, data: ExportOptions, store: WorkspaceStore): Observable<OlFeature[]>;
42
+ getWorkspaceByLayerId(id: string, store: WorkspaceStore): Workspace;
43
+ getGeomTypes(features: OlFeature[], format?: AnyExportFormat): GeometryCollection[];
28
44
  static ɵfac: i0.ɵɵFactoryDeclaration<ExportService, never>;
29
45
  static ɵprov: i0.ɵɵInjectableDeclaration<ExportService>;
30
46
  }
@@ -1,16 +1,8 @@
1
- export declare const ExportFormat: {
2
- URL: "URL";
3
- GeoJSON: "GeoJSON";
4
- GML: "GML";
5
- GPX: "GPX";
6
- KML: "KML";
7
- Shapefile: "Shapefile";
8
- CSVcomma: "CSVcomma";
9
- CSVsemicolon: "CSVsemicolon";
10
- };
11
- export type ExportFormat = keyof typeof ExportFormat;
12
- export declare const EncodingFormat: {
13
- UTF8: "UTF8";
14
- LATIN1: "LATIN1";
15
- };
16
- export type EncodingFormat = keyof typeof EncodingFormat;
1
+ export type AnyExportFormat = ExportFormat | ExportFormatLegacy;
2
+ export declare const ExportFormat: readonly ["GeoJSON", "Excel", "Shapefile", "GML", "GPX", "KML", "CSV", "URL"];
3
+ export type ExportFormat = (typeof ExportFormat)[number];
4
+ export declare const ExportFormatLegacy: readonly ["CSVcomma", "CSVsemicolon"];
5
+ export type ExportFormatLegacy = (typeof ExportFormatLegacy)[number];
6
+ export declare const CsvSeparator: readonly ["auto", "comma", "semicolon"];
7
+ export type CsvSeparator = (typeof CsvSeparator)[number];
8
+ export type ExportOgreFormat = Extract<AnyExportFormat, 'GML' | 'GPX' | 'KML' | 'Shapefile' | 'CSVcomma' | 'CSVsemicolon' | 'CSV'>;
@@ -1,5 +1,6 @@
1
1
  import { EntityTableColumn } from '@igo2/common/entity';
2
2
  import { MessageService } from '@igo2/core/message';
3
+ import { AnyExportFormat } from './export.type';
3
4
  export declare function handleFileExportError(error: Error, messageService: MessageService): void;
4
5
  export declare function handleFileExportSuccess(messageService: MessageService): void;
5
6
  export declare function handleNothingToExportError(messageService: MessageService): void;
@@ -17,3 +18,4 @@ export declare function exportToCSV(rows: any[][], fileName: string, separator?:
17
18
  * @param scolumns Columns definition of the output data
18
19
  */
19
20
  export declare function entitiesToRowData(entities: object[], columns: EntityTableColumn[]): any[][];
21
+ export declare function isCsvExport(format: AnyExportFormat): boolean;
@@ -66,7 +66,6 @@ export declare class VectorLayer extends Layer {
66
66
  * Custom loader to get feature from a WFS datasource
67
67
  * @internal
68
68
  * @param vectorSource the vector source to be created
69
- * @param interceptor the interceptor of the data
70
69
  * @param extent the extent of the requested data
71
70
  * @param dataProjection the projection of the retrieved data
72
71
  * @param featureProjection the projection of the created features
@@ -80,7 +79,6 @@ export declare class VectorLayer extends Layer {
80
79
  * @internal
81
80
  * @param vectorSource the vector source to be created
82
81
  * @param url the url string or function to retrieve the data
83
- * @param interceptor the interceptor of the data
84
82
  * @param extent the extent of the requested data
85
83
  * @param resolution the current resolution
86
84
  * @param projection the projection to retrieve the data
@@ -91,7 +89,6 @@ export declare class VectorLayer extends Layer {
91
89
  * @internal
92
90
  * @param vectorSource the vector source to be created
93
91
  * @param layerID the url string or function to retrieve the data
94
- * @param interceptor the interceptor of the data
95
92
  * @param extent the extent of the requested data
96
93
  * @param resolution the current resolution
97
94
  * @param projection the projection to retrieve the data
@@ -103,16 +103,21 @@
103
103
  "GPX": "GPX",
104
104
  "KML": "KML",
105
105
  "Shapefile": "Shapefile",
106
- "CSVcomma": "CSV (comma delimited)",
107
- "CSVsemicolon": "CSV (Excel compatible)",
106
+ "CSV": "CSV",
107
+ "Excel": "Excel",
108
108
  "URL": "External link"
109
109
  },
110
+ "separator": "Separator",
111
+ "csv.separator": {
112
+ "auto": "Auto detection",
113
+ "comma": "Comma",
114
+ "semicolon": "Semicolon"
115
+ },
110
116
  "gpx.error.poly": {
111
117
  "title": "GPX error",
112
118
  "text": "GPX format do now allow polygon features"
113
119
  },
114
120
  "encoding": {
115
- "LATIN1": "LATIN-1",
116
121
  "UTF8": "UTF-8"
117
122
  },
118
123
  "combinedLayers": "combinedLayers"
@@ -103,16 +103,21 @@
103
103
  "GPX": "GPX",
104
104
  "KML": "KML",
105
105
  "Shapefile": "Shapefile",
106
- "CSVcomma": "CSV (séparateur virgule)",
107
- "CSVsemicolon": "CSV (compatible Excel)",
106
+ "CSV": "CSV",
107
+ "Excel": "Excel",
108
108
  "URL": "Lien externe"
109
109
  },
110
+ "separator": "Séparateur",
111
+ "csv.separator": {
112
+ "auto": "Détection Automatique",
113
+ "comma": "Virgule",
114
+ "semicolon": "Point-virgule"
115
+ },
110
116
  "gpx.error.poly": {
111
117
  "title": "GPX en erreur",
112
118
  "text": "Le format GPX ne permet pas de stocker les polygones"
113
119
  },
114
120
  "encoding": {
115
- "LATIN1": "LATIN-1",
116
121
  "UTF8": "UTF-8"
117
122
  },
118
123
  "combinedLayers": "couchesCombinees"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igo2/geo",
3
- "version": "18.0.0-next.6",
3
+ "version": "18.0.0-next.7",
4
4
  "description": "IGO Library",
5
5
  "author": "IGO Community",
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  "ts-cacheable": "^1.0.6",
42
42
  "ts-md5": "^1.3.0",
43
43
  "tslib": "^2.6.0",
44
- "windows-1252": "^3.0.4"
44
+ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@angular/animations": "^18.0.0",
@@ -51,10 +51,10 @@
51
51
  "@angular/material": "^18.0.0",
52
52
  "@angular/material-moment-adapter": "^18.0.0",
53
53
  "@angular/platform-browser": "^18.0.0",
54
- "@igo2/auth": "^18.0.0-next.6",
55
- "@igo2/common": "^18.0.0-next.6",
56
- "@igo2/core": "^18.0.0-next.6",
57
- "@igo2/utils": "^18.0.0-next.6",
54
+ "@igo2/auth": "^18.0.0-next.7",
55
+ "@igo2/common": "^18.0.0-next.7",
56
+ "@igo2/core": "^18.0.0-next.7",
57
+ "@igo2/utils": "^18.0.0-next.7",
58
58
  "@mat-datetimepicker/core": "~14.0.0",
59
59
  "file-saver": "^2.0.2",
60
60
  "flexsearch": "0.7.21",
package/src/_index.scss CHANGED
@@ -1,2 +1,3 @@
1
- @forward './lib/search/search-bar/search-bar.theming.scss' as search-bar-* show search-bar-color,
1
+ @forward './lib/search/search-bar/search-bar.theming.scss' as search-bar-* show
2
+ search-bar-color,
2
3
  search-bar-density, search-bar-theme;