geonetwork-ui 2.6.0-dev.3a78a5eaa → 2.6.0-dev.502fa026d
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.
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +3 -3
- package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +2 -2
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +2 -1
- package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-map-container/form-field-map-container.component.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/map-state-container/map-state-container.component.mjs +2 -2
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +2 -4
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +40 -14
- package/esm2022/libs/ui/map/src/lib/components/map-container/map-container.component.mjs +14 -3
- package/esm2022/libs/ui/map/src/lib/components/map-legend/map-legend.component.mjs +5 -1
- package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +6 -2
- package/esm2022/libs/util/data-fetcher/src/lib/model.mjs +4 -1
- package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +30 -2
- package/esm2022/translations/de.json +1 -0
- package/esm2022/translations/en.json +1 -0
- package/esm2022/translations/es.json +1 -0
- package/esm2022/translations/fr.json +1 -0
- package/esm2022/translations/it.json +1 -0
- package/esm2022/translations/nl.json +1 -0
- package/esm2022/translations/pt.json +1 -0
- package/fesm2022/geonetwork-ui.mjs +104 -24
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +7 -2
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts +4 -2
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts.map +1 -1
- package/libs/ui/map/src/lib/components/map-legend/map-legend.component.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/model.d.ts +3 -2
- package/libs/util/data-fetcher/src/lib/model.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts +1 -0
- package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.html +1 -0
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +1 -0
- package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.html +10 -8
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +1 -3
- package/src/libs/feature/record/src/lib/map-view/map-view.component.html +1 -0
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +36 -7
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +14 -0
- package/src/libs/ui/map/src/lib/components/map-legend/map-legend.component.ts +3 -0
- package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +3 -1
- package/src/libs/util/data-fetcher/src/lib/model.ts +11 -1
- package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +29 -3
- package/translations/de.json +1 -0
- package/translations/en.json +1 -0
- package/translations/es.json +1 -0
- package/translations/fr.json +1 -0
- package/translations/it.json +1 -0
- package/translations/nl.json +1 -0
- package/translations/pt.json +1 -0
- package/translations/sk.json +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/dataviz/src/lib/service/data.service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EAEpB,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,UAAU,EAKX,MAAM,8CAA8C,CAAA;AACrD,OAAO,EAIL,YAAY,EACb,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAQ,UAAU,EAAc,MAAM,MAAM,CAAA;AAEnD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,2DAA2D,CAAA;;
|
|
1
|
+
{"version":3,"file":"data.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/dataviz/src/lib/service/data.service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EAEpB,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,UAAU,EAKX,MAAM,8CAA8C,CAAA;AACrD,OAAO,EAIL,YAAY,EACb,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAQ,UAAU,EAAc,MAAM,MAAM,CAAA;AAEnD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,2DAA2D,CAAA;;AAelE,UAAU,eAAe;IACvB,GAAG,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAA;KAAE,CAAA;CACvE;AAED,qBAGa,WAAW;IACV,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,YAAY;IAEvC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC;IA2BvD,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,UAAU,CAAC,eAAe,CAAC;IAkD9B,kBAAkB,CAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,UAAU,CAAC,MAAM,CAAC;IAerB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAMlE,uBAAuB,CACrB,OAAO,EAAE,0BAA0B,GAClC,UAAU,CAAC,qBAAqB,EAAE,CAAC;IA6BhC,kCAAkC,CACtC,UAAU,EAAE,0BAA0B,GACrC,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAiB7B,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWrE,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAa5D,4BAA4B,CAC1B,YAAY,EAAE,0BAA0B,GACvC,qBAAqB,EAAE;IAU1B,aAAa,CACX,IAAI,EAAE,qBAAqB,EAC3B,WAAW,EAAE,OAAO,GACnB,UAAU,CAAC,iBAAiB,CAAC;IAUhC,UAAU,CACR,IAAI,EAAE,qBAAqB,EAC3B,WAAW,EAAE,OAAO,GACnB,UAAU,CAAC,UAAU,CAAC;yCAjNd,WAAW;6CAAX,WAAW;CAmQvB"}
|
|
@@ -18,6 +18,6 @@ export declare class TableViewComponent {
|
|
|
18
18
|
onTableSelect(event: any): void;
|
|
19
19
|
handleError(error: FetchError | Error | string): void;
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableViewComponent, never>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableViewComponent, "gn-ui-table-view", never, { "cacheActive": { "alias": "cacheActive"; "required": false; }; "link": { "alias": "link"; "required": false; }; }, {}, never,
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableViewComponent, "gn-ui-table-view", never, { "cacheActive": { "alias": "cacheActive"; "required": false; }; "link": { "alias": "link"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=table-view.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-utils.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/map/src/lib/utils/map-utils.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,MAAM,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"map-utils.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/map/src/lib/utils/map-utils.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,MAAM,EAAE,MAAM,WAAW,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,2DAA2D,CAAA;;AAIzF,qBAGa,eAAe;IAC1B,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM;yCAD5C,eAAe;6CAAf,eAAe;CAkB3B"}
|
|
@@ -4,15 +4,18 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
|
|
4
4
|
import { MdViewFacade } from '../state/mdview.facade';
|
|
5
5
|
import { DataService } from '../../../../../../libs/feature/dataviz/src';
|
|
6
6
|
import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record';
|
|
7
|
-
import { MapContext, MapContextLayer } from '@geospatial-sdk/core';
|
|
7
|
+
import { MapContext, MapContextLayer, SourceLoadErrorEvent } from '@geospatial-sdk/core';
|
|
8
8
|
import { MapContainerComponent } from '../../../../../../libs/ui/map/src';
|
|
9
9
|
import { Feature } from 'geojson';
|
|
10
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
11
|
+
import { FetchError } from '../../../../../../libs/util/data-fetcher/src';
|
|
10
12
|
import * as i0 from "@angular/core";
|
|
11
13
|
export declare class MapViewComponent implements AfterViewInit {
|
|
12
14
|
private mdViewFacade;
|
|
13
15
|
private mapUtils;
|
|
14
16
|
private dataService;
|
|
15
17
|
private changeRef;
|
|
18
|
+
private translateService;
|
|
16
19
|
set exceedsLimit(value: boolean);
|
|
17
20
|
displaySource: boolean;
|
|
18
21
|
mapContainer: MapContainerComponent;
|
|
@@ -34,12 +37,14 @@ export declare class MapViewComponent implements AfterViewInit {
|
|
|
34
37
|
selectedLink$: Observable<any>;
|
|
35
38
|
currentLayers$: Observable<any[]>;
|
|
36
39
|
mapContext$: Observable<MapContext>;
|
|
37
|
-
constructor(mdViewFacade: MdViewFacade, mapUtils: MapUtilsService, dataService: DataService, changeRef: ChangeDetectorRef);
|
|
40
|
+
constructor(mdViewFacade: MdViewFacade, mapUtils: MapUtilsService, dataService: DataService, changeRef: ChangeDetectorRef, translateService: TranslateService);
|
|
38
41
|
ngAfterViewInit(): Promise<void>;
|
|
39
42
|
onMapFeatureSelect(features: Feature[]): void;
|
|
43
|
+
onSourceLoadError(error: SourceLoadErrorEvent): void;
|
|
40
44
|
resetSelection(): void;
|
|
41
45
|
getLayerFromLink(link: DatasetOnlineResource): Observable<MapContextLayer>;
|
|
42
46
|
selectLinkToDisplay(link: number): void;
|
|
47
|
+
handleError(error: FetchError | Error | string): void;
|
|
43
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<MapViewComponent, never>;
|
|
44
49
|
static ɵcmp: i0.ɵɵComponentDeclaration<MapViewComponent, "gn-ui-map-view", never, { "exceedsLimit": { "alias": "exceedsLimit"; "required": false; }; "displaySource": { "alias": "displaySource"; "required": false; }; }, {}, never, never, true, never>;
|
|
45
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-view.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/record/src/lib/map-view/map-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,iBAAiB,EAIlB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAExE,OAAO,EACL,eAAe,EAGf,UAAU,EAKX,MAAM,MAAM,CAAA;AAUb,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAA;AACjG,OAAO,EAEL,UAAU,EACV,eAAe,
|
|
1
|
+
{"version":3,"file":"map-view.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/record/src/lib/map-view/map-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,iBAAiB,EAIlB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAExE,OAAO,EACL,eAAe,EAGf,UAAU,EAKX,MAAM,MAAM,CAAA;AAUb,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAA;AACjG,OAAO,EAEL,UAAU,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,qBAAqB,EAGtB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAQjC,OAAO,EAAmB,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAOvE,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;;AAKzE,qBAqBa,gBAAiB,YAAW,aAAa;IAwGlD,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,gBAAgB;IA3G1B,IAAa,YAAY,CAAC,KAAK,EAAE,OAAO,EAEvC;IACQ,aAAa,UAAO;IACF,YAAY,EAAE,qBAAqB,CAAA;IAE9D,WAAW,2BAA6B;IACxC,WAAW,UAAQ;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,UAAO;IACjB,YAAY,UAAQ;IAEpB,YAAY;IAIZ,oBAAoB,CAAC,MAAM,EAAE,OAAO;IAIpC,mBAAmB,oBAOlB;IAED,gBAAgB;;;SASf;IACD,kBAAkB,0BAAyB;IAE3C,OAAO,UAAQ;IACf,KAAK,MAAO;IAEZ,aAAa,kBAGiC;IAE9C,cAAc,oBAqBb;IAED,WAAW,EAAE,UAAU,CAAC,UAAU,CAAC,CA4BlC;gBAGS,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,iBAAiB,EAC5B,gBAAgB,EAAE,gBAAgB;IAGtC,eAAe;IAKrB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI;IAU7C,iBAAiB,CAAC,KAAK,EAAE,oBAAoB;IAU7C,cAAc,IAAI,IAAI;IAQtB,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,GAAG,UAAU,CAAC,eAAe,CAAC;IAkC1E,mBAAmB,CAAC,IAAI,EAAE,MAAM;IAIhC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM;yCAtLnC,gBAAgB;2CAAhB,gBAAgB;CAyM5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { Extent, MapContext, MapContextLayer } from '@geospatial-sdk/core';
|
|
3
|
+
import { Extent, MapContext, MapContextLayer, SourceLoadErrorEvent } from '@geospatial-sdk/core';
|
|
4
4
|
import type OlMap from 'ol/Map';
|
|
5
5
|
import type { Feature } from 'geojson';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -19,6 +19,8 @@ export declare class MapContainerComponent implements AfterViewInit, OnChanges {
|
|
|
19
19
|
}>[]>;
|
|
20
20
|
_mapClick: EventEmitter<[number, number]>;
|
|
21
21
|
get mapClick(): EventEmitter<[number, number]>;
|
|
22
|
+
_sourceLoadError: EventEmitter<SourceLoadErrorEvent>;
|
|
23
|
+
get sourceLoadError(): EventEmitter<SourceLoadErrorEvent>;
|
|
22
24
|
container: ElementRef;
|
|
23
25
|
displayMessage$: Observable<boolean>;
|
|
24
26
|
olMap: OlMap;
|
|
@@ -32,6 +34,6 @@ export declare class MapContainerComponent implements AfterViewInit, OnChanges {
|
|
|
32
34
|
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
33
35
|
processContext(context: MapContext): MapContext;
|
|
34
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<MapContainerComponent, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MapContainerComponent, "gn-ui-map-container", never, { "context": { "alias": "context"; "required": false; }; }, { "featuresClick": "featuresClick"; "featuresHover": "featuresHover"; "mapClick": "mapClick"; }, never, never, true, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MapContainerComponent, "gn-ui-map-container", never, { "context": { "alias": "context"; "required": false; }; }, { "featuresClick": "featuresClick"; "featuresHover": "featuresHover"; "mapClick": "mapClick"; "sourceLoadError": "sourceLoadError"; }, never, never, true, never>;
|
|
36
38
|
}
|
|
37
39
|
//# sourceMappingURL=map-container.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-container.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/ui/map/src/lib/components/map-container/map-container.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,UAAU,EACV,YAAY,EAGZ,SAAS,EAET,aAAa,EAEd,MAAM,eAAe,CAAA;AACtB,OAAO,EAAoB,UAAU,EAAa,MAAM,MAAM,CAAA;AAI9D,OAAO,EAEL,MAAM,EAON,UAAU,EACV,eAAe,
|
|
1
|
+
{"version":3,"file":"map-container.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/ui/map/src/lib/components/map-container/map-container.component.ts"],"names":[],"mappings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,OAAO,EAAE,UAAU,GAAG,UAAU;yCAhHpC,qBAAqB;2CAArB,qBAAqB;CAsJjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-legend.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/ui/map/src/lib/components/map-legend/map-legend.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAEZ,SAAS,EAET,aAAa,EAEd,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;;AAIjD,qBAQa,kBAAmB,YAAW,SAAS;IACzC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAA;IACzB,kBAAkB,wBAA8B;IAC1D,UAAU,EAAE,WAAW,GAAG,KAAK,CAAA;IAEzB,WAAW,CAAC,OAAO,EAAE,aAAa;yCAL7B,kBAAkB;2CAAlB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"map-legend.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/ui/map/src/lib/components/map-legend/map-legend.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAEZ,SAAS,EAET,aAAa,EAEd,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;;AAIjD,qBAQa,kBAAmB,YAAW,SAAS;IACzC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAA;IACzB,kBAAkB,wBAA8B;IAC1D,UAAU,EAAE,WAAW,GAAG,KAAK,CAAA;IAEzB,WAAW,CAAC,OAAO,EAAE,aAAa;yCAL7B,kBAAkB;2CAAlB,kBAAkB;CAoB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/data-fetcher/src/lib/data-fetcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAc,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7E,OAA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+1,14 @@
|
|
|
1
1
|
import type { Feature } from 'geojson';
|
|
2
2
|
export type DataItem = Feature;
|
|
3
3
|
export declare class FetchError {
|
|
4
|
-
type: 'http' | 'network' | 'parse' | 'unsupportedType' | 'unknown';
|
|
4
|
+
type: 'http' | 'forbidden' | 'network' | 'parse' | 'unsupportedType' | 'unknown';
|
|
5
5
|
info: string;
|
|
6
6
|
httpStatus: number;
|
|
7
7
|
message: string;
|
|
8
8
|
stack: any;
|
|
9
|
-
constructor(type: 'http' | 'network' | 'parse' | 'unsupportedType' | 'unknown', info: string, httpStatus?: number);
|
|
9
|
+
constructor(type: 'http' | 'forbidden' | 'network' | 'parse' | 'unsupportedType' | 'unknown', info: string, httpStatus?: number);
|
|
10
10
|
static http(code: number, body?: string): FetchError;
|
|
11
|
+
static forbidden(code: number): FetchError;
|
|
11
12
|
static corsOrNetwork(message: string): FetchError;
|
|
12
13
|
static parsingFailed(info: string): FetchError;
|
|
13
14
|
static unsupportedType(mimeType: string): FetchError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/data-fetcher/src/lib/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAA;AAE9B,qBAAa,UAAU;IAKZ,IAAI,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/data-fetcher/src/lib/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAA;AAE9B,qBAAa,UAAU;IAKZ,IAAI,EACP,MAAM,GACN,WAAW,GACX,SAAS,GACT,OAAO,GACP,iBAAiB,GACjB,SAAS;IAEN,IAAI,EAAE,MAAM;IACZ,UAAU;IAbnB,OAAO,EAAE,MAAM,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M,CAAC,CAAA;AAClE,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,GAAG,WAAW,EAAE,CAAC,CAAA;AAC7C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,GAAG,WAAW,EAAE,CAAC,CAAA;AAC3C,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;AACxC,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,CAAA;AAC9D,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;AAChD,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,WAAW,GACX,aAAa,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { DataItem, DatasetInfo, PropertyInfo } from '../model';
|
|
|
3
3
|
import { GmlReader } from './gml';
|
|
4
4
|
import { GeojsonReader } from './geojson';
|
|
5
5
|
import { BaseCacheReader } from './base-cache';
|
|
6
|
+
export declare function getWfsEndpoint(wfsUrl: string): Promise<WfsEndpoint>;
|
|
6
7
|
export declare class WfsReader extends BaseCacheReader {
|
|
7
8
|
endpoint: WfsEndpoint;
|
|
8
9
|
featureTypeName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wfs.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/data-fetcher/src/lib/readers/wfs.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"wfs.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/data-fetcher/src/lib/readers/wfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAc,YAAY,EAAE,MAAM,UAAU,CAAA;AAE1E,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAgB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAwBzE;AAED,qBAAa,SAAU,SAAQ,eAAe;IAC5C,QAAQ,EAAE,WAAW,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,UAAU,CAAA;gBAGjB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,OAAO;IAQvB,IAAI,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAiBxC;IAED,IAAI,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CAO/B;WAEY,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;IA4C7D,OAAO,CAAC,WAAW,CAAC,KAAA,EAAE,SAAS,CAAC,KAAA;;;;;;IAiChC,YAAY;IAkBzB,IAAI;IAIE,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAGlC"}
|
package/package.json
CHANGED
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
class="absolute inset-0"
|
|
12
12
|
[message]="'table.loading.data' | translate"
|
|
13
13
|
></gn-ui-loading-mask>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
<ng-content *ngIf="error">
|
|
15
|
+
<div class="border border-gray-300 rounded-lg bg-white h-full"></div>
|
|
16
|
+
<gn-ui-popup-alert
|
|
17
|
+
type="warning"
|
|
18
|
+
icon="matErrorOutlineOutline"
|
|
19
|
+
class="absolute m-2 inset-0"
|
|
20
|
+
>
|
|
21
|
+
<span translate>{{ error }}</span>
|
|
22
|
+
</gn-ui-popup-alert>
|
|
23
|
+
</ng-content>
|
|
22
24
|
</div>
|
|
23
25
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { extend, Extent } from 'ol/extent'
|
|
3
3
|
import GeoJSON from 'ol/format/GeoJSON'
|
|
4
|
-
import { transformExtent } from 'ol/proj'
|
|
5
4
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
6
5
|
|
|
7
6
|
const GEOJSON = new GeoJSON()
|
|
@@ -15,7 +14,7 @@ export class MapUtilsService {
|
|
|
15
14
|
return null
|
|
16
15
|
}
|
|
17
16
|
// extend all the spatial extents into an including bbox
|
|
18
|
-
|
|
17
|
+
return record.spatialExtents.reduce(
|
|
19
18
|
(prev, curr) => {
|
|
20
19
|
if ('bbox' in curr) return extend(prev, curr.bbox)
|
|
21
20
|
else if ('geometry' in curr) {
|
|
@@ -26,6 +25,5 @@ export class MapUtilsService {
|
|
|
26
25
|
},
|
|
27
26
|
[Infinity, Infinity, -Infinity, -Infinity]
|
|
28
27
|
)
|
|
29
|
-
return transformExtent(totalExtent, 'EPSG:4326', 'EPSG:3857')
|
|
30
28
|
}
|
|
31
29
|
}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#mapContainer
|
|
32
32
|
[context]="mapContext$ | async"
|
|
33
33
|
(featuresClick)="onMapFeatureSelect($event)"
|
|
34
|
+
(sourceLoadError)="onSourceLoadError($event)"
|
|
34
35
|
></gn-ui-map-container>
|
|
35
36
|
<div
|
|
36
37
|
class="top-[1em] right-[1em] p-3 bg-white absolute overflow-y-auto overflow-x-hidden max-h-72 w-56"
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
createViewFromLayer,
|
|
35
35
|
MapContext,
|
|
36
36
|
MapContextLayer,
|
|
37
|
+
SourceLoadErrorEvent,
|
|
37
38
|
} from '@geospatial-sdk/core'
|
|
38
39
|
import {
|
|
39
40
|
FeatureDetailComponent,
|
|
@@ -49,13 +50,14 @@ import {
|
|
|
49
50
|
ButtonComponent,
|
|
50
51
|
DropdownSelectorComponent,
|
|
51
52
|
} from '../../../../../../libs/ui/inputs/src'
|
|
52
|
-
import { TranslateModule } from '@ngx-translate/core'
|
|
53
|
+
import { TranslateModule, TranslateService } from '@ngx-translate/core'
|
|
53
54
|
import { ExternalViewerButtonComponent } from '../external-viewer-button/external-viewer-button.component'
|
|
54
55
|
import {
|
|
55
56
|
LoadingMaskComponent,
|
|
56
57
|
PopupAlertComponent,
|
|
57
58
|
} from '../../../../../../libs/ui/widgets/src'
|
|
58
59
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
60
|
+
import { FetchError } from '../../../../../../libs/util/data-fetcher/src'
|
|
59
61
|
|
|
60
62
|
marker('map.dropdown.placeholder')
|
|
61
63
|
marker('wfs.feature.limit')
|
|
@@ -100,9 +102,6 @@ export class MapViewComponent implements AfterViewInit {
|
|
|
100
102
|
|
|
101
103
|
onLegendStatusChange(status: boolean) {
|
|
102
104
|
this.legendExists = status
|
|
103
|
-
if (!status) {
|
|
104
|
-
this.showLegend = false
|
|
105
|
-
}
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
compatibleMapLinks$ = combineLatest([
|
|
@@ -149,8 +148,7 @@ export class MapViewComponent implements AfterViewInit {
|
|
|
149
148
|
return this.getLayerFromLink(link).pipe(
|
|
150
149
|
map((layer) => [layer]),
|
|
151
150
|
catchError((e) => {
|
|
152
|
-
this.
|
|
153
|
-
console.warn(e.stack || e.message)
|
|
151
|
+
this.handleError(e)
|
|
154
152
|
return of([])
|
|
155
153
|
}),
|
|
156
154
|
finalize(() => (this.loading = false))
|
|
@@ -192,7 +190,8 @@ export class MapViewComponent implements AfterViewInit {
|
|
|
192
190
|
private mdViewFacade: MdViewFacade,
|
|
193
191
|
private mapUtils: MapUtilsService,
|
|
194
192
|
private dataService: DataService,
|
|
195
|
-
private changeRef: ChangeDetectorRef
|
|
193
|
+
private changeRef: ChangeDetectorRef,
|
|
194
|
+
private translateService: TranslateService
|
|
196
195
|
) {}
|
|
197
196
|
|
|
198
197
|
async ngAfterViewInit() {
|
|
@@ -210,6 +209,16 @@ export class MapViewComponent implements AfterViewInit {
|
|
|
210
209
|
this.changeRef.detectChanges()
|
|
211
210
|
}
|
|
212
211
|
|
|
212
|
+
onSourceLoadError(error: SourceLoadErrorEvent) {
|
|
213
|
+
if (error.httpStatus === 403 || error.httpStatus === 401) {
|
|
214
|
+
this.error = this.translateService.instant(`dataset.error.forbidden`)
|
|
215
|
+
} else {
|
|
216
|
+
this.error = this.translateService.instant(`dataset.error.http`, {
|
|
217
|
+
info: error.httpStatus,
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
213
222
|
resetSelection(): void {
|
|
214
223
|
if (this.selection) {
|
|
215
224
|
// FIXME: restore styling of selected feature
|
|
@@ -255,4 +264,24 @@ export class MapViewComponent implements AfterViewInit {
|
|
|
255
264
|
selectLinkToDisplay(link: number) {
|
|
256
265
|
this.selectedLinkIndex$.next(link)
|
|
257
266
|
}
|
|
267
|
+
|
|
268
|
+
handleError(error: FetchError | Error | string) {
|
|
269
|
+
if (error instanceof FetchError) {
|
|
270
|
+
this.error = this.translateService.instant(
|
|
271
|
+
`dataset.error.${error.type}`,
|
|
272
|
+
{
|
|
273
|
+
info: error.info,
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
console.warn(error.message)
|
|
277
|
+
} else if (error instanceof Error) {
|
|
278
|
+
this.error = this.translateService.instant(error.message)
|
|
279
|
+
console.warn(error.stack || error)
|
|
280
|
+
} else {
|
|
281
|
+
this.error = this.translateService.instant(error)
|
|
282
|
+
console.warn(error)
|
|
283
|
+
}
|
|
284
|
+
this.loading = false
|
|
285
|
+
this.changeRef.detectChanges()
|
|
286
|
+
}
|
|
258
287
|
}
|
|
@@ -28,6 +28,8 @@ import {
|
|
|
28
28
|
MapContextLayer,
|
|
29
29
|
MapContextLayerXyz,
|
|
30
30
|
MapContextView,
|
|
31
|
+
SourceLoadErrorEvent,
|
|
32
|
+
SourceLoadErrorType,
|
|
31
33
|
} from '@geospatial-sdk/core'
|
|
32
34
|
import {
|
|
33
35
|
applyContextDiffToMap,
|
|
@@ -119,6 +121,18 @@ export class MapContainerComponent implements AfterViewInit, OnChanges {
|
|
|
119
121
|
}
|
|
120
122
|
return this._mapClick
|
|
121
123
|
}
|
|
124
|
+
_sourceLoadError: EventEmitter<SourceLoadErrorEvent>
|
|
125
|
+
@Output() get sourceLoadError() {
|
|
126
|
+
if (!this._sourceLoadError) {
|
|
127
|
+
this.openlayersMap.then((olMap) => {
|
|
128
|
+
listen(olMap, SourceLoadErrorType, (error: SourceLoadErrorEvent) =>
|
|
129
|
+
this._sourceLoadError.emit(error)
|
|
130
|
+
)
|
|
131
|
+
})
|
|
132
|
+
this._sourceLoadError = new EventEmitter<SourceLoadErrorEvent>()
|
|
133
|
+
}
|
|
134
|
+
return this._sourceLoadError
|
|
135
|
+
}
|
|
122
136
|
|
|
123
137
|
@ViewChild('map') container: ElementRef
|
|
124
138
|
displayMessage$: Observable<boolean>
|
|
@@ -53,7 +53,9 @@ export async function openDataset(
|
|
|
53
53
|
reader.load()
|
|
54
54
|
return reader
|
|
55
55
|
} catch (e: any) {
|
|
56
|
-
|
|
56
|
+
//WfsReader may already raise a FetchError
|
|
57
|
+
if (e instanceof FetchError) throw e
|
|
58
|
+
else throw FetchError.parsingFailed(e.message)
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
|
|
@@ -7,7 +7,14 @@ export class FetchError {
|
|
|
7
7
|
stack = null
|
|
8
8
|
|
|
9
9
|
constructor(
|
|
10
|
-
public type:
|
|
10
|
+
public type:
|
|
11
|
+
| 'http'
|
|
12
|
+
| 'forbidden'
|
|
13
|
+
| 'network'
|
|
14
|
+
| 'parse'
|
|
15
|
+
| 'unsupportedType'
|
|
16
|
+
| 'unknown',
|
|
17
|
+
|
|
11
18
|
public info: string,
|
|
12
19
|
public httpStatus = 0
|
|
13
20
|
) {
|
|
@@ -20,6 +27,9 @@ ${body}`
|
|
|
20
27
|
: `${code}`
|
|
21
28
|
return new FetchError('http', info, code)
|
|
22
29
|
}
|
|
30
|
+
static forbidden(code: number) {
|
|
31
|
+
return new FetchError('forbidden', '', code)
|
|
32
|
+
}
|
|
23
33
|
static corsOrNetwork(message: string) {
|
|
24
34
|
return new FetchError('network', message, 0)
|
|
25
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WfsEndpoint, WfsVersion } from '@camptocamp/ogc-client'
|
|
2
|
-
import { DataItem, DatasetInfo, PropertyInfo } from '../model'
|
|
1
|
+
import { EndpointError, WfsEndpoint, WfsVersion } from '@camptocamp/ogc-client'
|
|
2
|
+
import { DataItem, DatasetInfo, FetchError, PropertyInfo } from '../model'
|
|
3
3
|
import { fetchDataAsText } from '../utils'
|
|
4
4
|
import { GmlReader, parseGml } from './gml'
|
|
5
5
|
import { GeojsonReader, parseGeojson } from './geojson'
|
|
@@ -7,6 +7,32 @@ import { BaseCacheReader } from './base-cache'
|
|
|
7
7
|
import { getJsonDataItemsProxy, jsonToGeojsonFeature } from '../utils'
|
|
8
8
|
import { generateSqlQuery } from '../sql-utils'
|
|
9
9
|
|
|
10
|
+
export async function getWfsEndpoint(wfsUrl: string): Promise<WfsEndpoint> {
|
|
11
|
+
try {
|
|
12
|
+
return await new WfsEndpoint(wfsUrl).isReady()
|
|
13
|
+
} catch (e) {
|
|
14
|
+
if (
|
|
15
|
+
e instanceof Error &&
|
|
16
|
+
'isCrossOriginRelated' in e &&
|
|
17
|
+
'httpStatus' in e
|
|
18
|
+
) {
|
|
19
|
+
const error = e as EndpointError
|
|
20
|
+
if (error.isCrossOriginRelated === true) {
|
|
21
|
+
throw new Error(`wfs.unreachable.cors`)
|
|
22
|
+
}
|
|
23
|
+
if (error.httpStatus === 401 || error.httpStatus === 403) {
|
|
24
|
+
throw FetchError.forbidden(error.httpStatus)
|
|
25
|
+
} else if (error.httpStatus === 400 || error.httpStatus > 403) {
|
|
26
|
+
throw FetchError.http(error.httpStatus)
|
|
27
|
+
} else {
|
|
28
|
+
throw FetchError.unknownType()
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
throw FetchError.unknownType()
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
10
36
|
export class WfsReader extends BaseCacheReader {
|
|
11
37
|
endpoint: WfsEndpoint
|
|
12
38
|
featureTypeName: string
|
|
@@ -53,7 +79,7 @@ export class WfsReader extends BaseCacheReader {
|
|
|
53
79
|
}
|
|
54
80
|
|
|
55
81
|
static async createReader(wfsUrlEndpoint: string, featureTypeName?: string) {
|
|
56
|
-
const wfsEndpoint = await
|
|
82
|
+
const wfsEndpoint = await getWfsEndpoint(wfsUrlEndpoint)
|
|
57
83
|
const featureTypes = wfsEndpoint.getFeatureTypes()
|
|
58
84
|
const featureType = wfsEndpoint.getFeatureTypeSummary(
|
|
59
85
|
featureTypes.length === 1 && !featureTypeName
|
package/translations/de.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "Generiert durch eine API",
|
|
69
69
|
"datahub.search.filter.generatedByWfs": "",
|
|
70
70
|
"datahub.search.filter.others": "Andere",
|
|
71
|
+
"dataset.error.forbidden": "Der Zugriff auf diese Ressource ist eingeschränkt",
|
|
71
72
|
"dataset.error.http": "Die Daten konnten aufgrund eines HTTP-Fehlers nicht geladen werden: \"{ info }\"",
|
|
72
73
|
"dataset.error.network": "Die Daten konnten aufgrund eines Netzwerkfehlers oder CORS-Beschränkungen nicht geladen werden: \"{ info }\"",
|
|
73
74
|
"dataset.error.parse": "Die Daten wurden geladen, konnten aber nicht gelesen werden: \"{ info }\"",
|
package/translations/en.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "Generated by an API",
|
|
69
69
|
"datahub.search.filter.generatedByWfs": "",
|
|
70
70
|
"datahub.search.filter.others": "Others",
|
|
71
|
+
"dataset.error.forbidden": "Access to this resource is restricted",
|
|
71
72
|
"dataset.error.http": "The data could not be loaded because of an HTTP error: \"{ info }\"",
|
|
72
73
|
"dataset.error.network": "The data could not be loaded because of a network error or CORS limitations: \"{ info }\"",
|
|
73
74
|
"dataset.error.parse": "The data was loaded but could not be parsed: \"{ info }\"",
|
package/translations/es.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "",
|
|
69
69
|
"datahub.search.filter.generatedByWfs": "",
|
|
70
70
|
"datahub.search.filter.others": "",
|
|
71
|
+
"dataset.error.forbidden": "El acceso a este recurso está restringido",
|
|
71
72
|
"dataset.error.http": "",
|
|
72
73
|
"dataset.error.network": "",
|
|
73
74
|
"dataset.error.parse": "",
|
package/translations/fr.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "généré par une API",
|
|
69
69
|
"datahub.search.filter.generatedByWfs": "généré par un WFS",
|
|
70
70
|
"datahub.search.filter.others": "Autres",
|
|
71
|
+
"dataset.error.forbidden": "L’accès à cette ressource est restreint",
|
|
71
72
|
"dataset.error.http": "Le chargement des données a échoué en raison d'une erreur HTTP: \"{ info }\"",
|
|
72
73
|
"dataset.error.network": "Le chargement des données a échoué en raison d'une erreur réseau ou de limitations CORS: \"{ info }\"",
|
|
73
74
|
"dataset.error.parse": "Les données ont été chargées mais leur décodage a échoué: \"{ info }\"",
|
package/translations/it.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "generato da un'API",
|
|
69
69
|
"datahub.search.filter.generatedByWfs": "generato da un WFS",
|
|
70
70
|
"datahub.search.filter.others": "Altri",
|
|
71
|
+
"dataset.error.forbidden": "L'accesso a questa risorsa è limitato",
|
|
71
72
|
"dataset.error.http": "Il caricamento dei dati non è riuscito a causa di un errore HTTP: \"{info}\"",
|
|
72
73
|
"dataset.error.network": "Il caricamento dei dati non è riuscito a causa di un errore di rete o di limitazioni CORS: \"{info}\"",
|
|
73
74
|
"dataset.error.parse": "I dati sono stati caricati ma la decodifica non è riuscita: \"{info}\"",
|
package/translations/nl.json
CHANGED
package/translations/pt.json
CHANGED
package/translations/sk.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "vygenerované cez API",
|
|
69
69
|
"datahub.search.filter.generatedByWfs": "",
|
|
70
70
|
"datahub.search.filter.others": "Iné",
|
|
71
|
+
"dataset.error.forbidden": "",
|
|
71
72
|
"dataset.error.http": "Dáta sa nedajú načítať kvôli chybe HTTP: \"{ info }\"",
|
|
72
73
|
"dataset.error.network": "Dáta sa nedajú načítať kvôli chybe v sieti alebo obmedzeniam CORS: \"{ info }\"",
|
|
73
74
|
"dataset.error.parse": "Dáta boli načítané, ale nedajú sa analyzovať: \"{ info }\"",
|