geonetwork-ui 2.2.0-dev.9ae0a68b → 2.2.0-dev.a9d33529
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/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +36 -2
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +2 -1
- package/esm2022/libs/api/repository/src/lib/gn4/index.mjs +3 -1
- package/esm2022/libs/api/repository/src/lib/gn4/selection/selection.service.mjs +13 -26
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/search/search.model.mjs +1 -1
- package/esm2022/libs/feature/catalog/src/lib/my-org/my-org.service.mjs +4 -10
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +5 -4
- package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +5 -3
- package/esm2022/libs/feature/map/src/index.mjs +2 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.mjs +106 -0
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.mjs +64 -0
- package/esm2022/libs/feature/map/src/lib/constant/index.mjs +2 -1
- package/esm2022/libs/feature/map/src/lib/constant/projections.mjs +2 -0
- package/esm2022/libs/feature/map/src/lib/feature-map.module.mjs +23 -3
- package/esm2022/libs/feature/map/src/lib/geocoding/geocoding.component.mjs +93 -0
- package/esm2022/libs/feature/map/src/lib/geocoding.service.mjs +40 -0
- package/esm2022/libs/feature/map/src/lib/layers-panel/layers-panel.component.mjs +5 -3
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +3 -1
- package/esm2022/libs/feature/map/src/lib/utils/index.mjs +1 -3
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +60 -29
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +29 -20
- package/esm2022/libs/feature/search/src/index.mjs +2 -1
- package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +7 -3
- package/esm2022/libs/feature/search/src/lib/results-table/results-table.component.mjs +129 -0
- package/esm2022/libs/feature/search/src/lib/state/effects.mjs +5 -3
- package/esm2022/libs/ui/catalog/src/lib/organisation-preview/organisation-preview.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/index.mjs +3 -1
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.mjs +27 -0
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +12 -7
- package/esm2022/libs/ui/elements/src/lib/related-record-card/related-record-card.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +7 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -3
- package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +2 -2
- package/esm2022/libs/ui/inputs/src/lib/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/editable-label/editable-label.directive.mjs +46 -0
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +8 -3
- package/esm2022/libs/ui/layout/src/index.mjs +3 -1
- package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +2 -2
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.mjs +36 -0
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +37 -0
- package/esm2022/libs/ui/search/src/index.mjs +1 -2
- package/esm2022/libs/ui/search/src/lib/record-preview-card/record-preview-card.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-list/record-preview-list.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-title/record-preview-title.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/ui-search.module.mjs +9 -10
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +29 -13
- package/esm2022/translations/de.json +102 -94
- package/esm2022/translations/en.json +27 -19
- package/esm2022/translations/es.json +8 -0
- package/esm2022/translations/fr.json +12 -4
- package/esm2022/translations/it.json +11 -3
- package/esm2022/translations/nl.json +8 -0
- package/esm2022/translations/pt.json +8 -0
- package/fesm2022/geonetwork-ui.mjs +946 -457
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/index.d.ts +2 -0
- package/libs/api/repository/src/lib/gn4/index.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/selection/selection.service.d.ts +4 -5
- package/libs/api/repository/src/lib/gn4/selection/selection.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +10 -5
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/search/search.model.d.ts +1 -2
- package/libs/common/domain/src/lib/model/search/search.model.d.ts.map +1 -1
- package/libs/feature/catalog/src/lib/my-org/my-org.service.d.ts +0 -1
- package/libs/feature/catalog/src/lib/my-org/my-org.service.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +15 -2
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +1 -1
- package/libs/feature/map/src/index.d.ts +1 -0
- package/libs/feature/map/src/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.d.ts +22 -0
- package/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.d.ts +22 -0
- package/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/constant/index.d.ts +1 -0
- package/libs/feature/map/src/lib/constant/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/constant/projections.d.ts.map +1 -0
- package/libs/feature/map/src/lib/feature-map.module.d.ts +15 -12
- package/libs/feature/map/src/lib/feature-map.module.d.ts.map +1 -1
- package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts +25 -0
- package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/geocoding.service.d.ts +18 -0
- package/libs/feature/map/src/lib/geocoding.service.d.ts.map +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/index.d.ts +0 -2
- package/libs/feature/map/src/lib/utils/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts +13 -11
- 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 +1 -3
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/search/src/index.d.ts +1 -0
- package/libs/feature/search/src/index.d.ts.map +1 -1
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts +3 -3
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.d.ts +3 -2
- package/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts +1 -1
- package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table.component.d.ts +34 -0
- package/libs/feature/search/src/lib/results-table/results-table.component.d.ts.map +1 -0
- package/libs/feature/search/src/lib/state/effects.d.ts.map +1 -1
- package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts +1 -1
- package/libs/ui/elements/src/index.d.ts +2 -0
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.d.ts +10 -0
- package/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +1 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/thumbnail/thumbnail.component.d.ts +3 -2
- package/libs/ui/elements/src/lib/thumbnail/thumbnail.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +12 -11
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/index.d.ts +1 -0
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts +13 -0
- package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +2 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
- package/libs/ui/layout/src/index.d.ts +2 -0
- package/libs/ui/layout/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +14 -0
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts.map +1 -0
- package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts +15 -0
- package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts.map +1 -0
- package/libs/ui/search/src/index.d.ts +0 -1
- package/libs/ui/search/src/index.d.ts.map +1 -1
- package/libs/ui/search/src/lib/ui-search.module.d.ts +15 -15
- package/libs/ui/search/src/lib/ui-search.module.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +19 -7
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +3 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +43 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +1 -0
- package/src/libs/api/repository/src/lib/gn4/index.ts +2 -0
- package/src/libs/api/repository/src/lib/gn4/selection/selection.service.ts +14 -38
- package/src/libs/common/domain/src/lib/index.ts +2 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +12 -7
- package/src/libs/common/domain/src/lib/model/search/search.model.ts +1 -1
- package/src/libs/common/domain/src/lib/model/user/index.ts +1 -0
- package/src/libs/feature/catalog/src/lib/my-org/my-org.service.ts +4 -16
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +8 -5
- package/src/libs/feature/editor/src/lib/record-form/record-form.component.ts +2 -1
- package/src/libs/feature/map/src/index.ts +1 -0
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.css +0 -0
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.html +21 -0
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.ts +107 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.css +0 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.html +37 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.ts +64 -0
- package/src/libs/feature/map/src/lib/constant/index.ts +1 -0
- package/src/libs/feature/map/src/lib/feature-map.module.ts +12 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.css +0 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +39 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +99 -0
- package/src/libs/feature/map/src/lib/geocoding.service.ts +59 -0
- package/src/libs/feature/map/src/lib/layers-panel/layers-panel.component.html +6 -2
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +6 -0
- package/src/libs/feature/map/src/lib/utils/index.ts +0 -2
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +85 -50
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +18 -3
- package/src/libs/feature/search/src/index.ts +1 -0
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +1 -1
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +4 -4
- package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.ts +9 -3
- package/src/libs/feature/search/src/lib/results-table/results-table.component.css +0 -0
- package/src/libs/feature/search/src/lib/results-table/results-table.component.html +135 -0
- package/src/libs/feature/search/src/lib/results-table/results-table.component.ts +165 -0
- package/src/libs/feature/search/src/lib/state/effects.ts +4 -3
- package/src/libs/ui/elements/src/index.ts +2 -0
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.html +4 -1
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.css +0 -0
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html +30 -0
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.ts +15 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +52 -52
- package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +2 -2
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.css +4 -0
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +56 -27
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +5 -0
- package/src/libs/ui/elements/src/lib/related-record-card/related-record-card.component.html +1 -1
- package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.ts +4 -0
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +4 -0
- package/src/libs/ui/inputs/src/index.ts +1 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.css +1 -1
- package/src/libs/ui/inputs/src/lib/checkbox/checkbox.component.html +0 -1
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/editable-label/editable-label.directive.ts +48 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +3 -0
- package/src/libs/ui/layout/src/index.ts +2 -0
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.css +1 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.css +0 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.html +1 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.ts +33 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.css +15 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +54 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts +42 -0
- package/src/libs/ui/search/src/index.ts +0 -1
- package/src/libs/ui/search/src/lib/ui-search.module.ts +2 -3
- package/src/libs/util/shared/src/lib/links/link-utils.ts +34 -11
- package/translations/de.json +102 -94
- package/translations/en.json +27 -19
- package/translations/es.json +8 -0
- package/translations/fr.json +12 -4
- package/translations/it.json +11 -3
- package/translations/nl.json +8 -0
- package/translations/pt.json +8 -0
- package/translations/sk.json +8 -0
- package/esm2022/libs/feature/map/src/lib/utils/map-utils-wms.service.mjs +0 -55
- package/esm2022/libs/feature/map/src/lib/utils/projections.mjs +0 -2
- package/esm2022/libs/ui/search/src/lib/record-table/record-table.component.mjs +0 -145
- package/libs/feature/map/src/lib/utils/map-utils-wms.service.d.ts +0 -17
- package/libs/feature/map/src/lib/utils/map-utils-wms.service.d.ts.map +0 -1
- package/libs/feature/map/src/lib/utils/projections.d.ts.map +0 -1
- package/libs/ui/search/src/lib/record-table/record-table.component.d.ts +0 -31
- package/libs/ui/search/src/lib/record-table/record-table.component.d.ts.map +0 -1
- package/src/libs/feature/map/src/lib/utils/map-utils-wms.service.ts +0 -58
- package/src/libs/ui/search/src/lib/record-table/record-table.component.css +0 -7
- package/src/libs/ui/search/src/lib/record-table/record-table.component.html +0 -215
- package/src/libs/ui/search/src/lib/record-table/record-table.component.ts +0 -149
- /package/libs/feature/map/src/lib/{utils → constant}/projections.d.ts +0 -0
- /package/src/libs/feature/map/src/lib/{utils → constant}/projections.ts +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getArrayItem,
|
|
2
3
|
getAsArray,
|
|
3
4
|
getAsUrl,
|
|
4
5
|
getFirstValue,
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
DatasetDistributionType,
|
|
23
24
|
DatasetDownloadDistribution,
|
|
24
25
|
DatasetServiceDistribution,
|
|
26
|
+
DatasetSpatialExtent,
|
|
25
27
|
OnlineLinkResource,
|
|
26
28
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
27
29
|
import { matchProtocol } from '../common/distribution.mapper'
|
|
@@ -258,6 +260,47 @@ export class Gn4FieldMapper {
|
|
|
258
260
|
kind,
|
|
259
261
|
}
|
|
260
262
|
},
|
|
263
|
+
geom: (output, source) => {
|
|
264
|
+
const geoms = getAsArray(selectField(source, 'geom'))
|
|
265
|
+
const shapes = getAsArray(selectField(source, 'shape'))
|
|
266
|
+
const extentDescriptions = getAsArray(
|
|
267
|
+
selectField(source, 'extentDescriptionObject')
|
|
268
|
+
)
|
|
269
|
+
const spatialExtents = getAsArray(selectField(source, 'spatialExtents'))
|
|
270
|
+
return {
|
|
271
|
+
...output,
|
|
272
|
+
spatialExtents: [
|
|
273
|
+
...spatialExtents,
|
|
274
|
+
...geoms.map((geom, index) => {
|
|
275
|
+
const description = selectTranslatedValue(
|
|
276
|
+
getArrayItem(extentDescriptions, index),
|
|
277
|
+
this.lang3
|
|
278
|
+
)
|
|
279
|
+
const geometry = shapes[index] ?? geom
|
|
280
|
+
return {
|
|
281
|
+
...(description !== null ? { description } : null),
|
|
282
|
+
geometry,
|
|
283
|
+
} as DatasetSpatialExtent
|
|
284
|
+
}),
|
|
285
|
+
],
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
resourceTemporalDateRange: (output, source) => {
|
|
289
|
+
const ranges = getAsArray(
|
|
290
|
+
selectField(source, 'resourceTemporalDateRange')
|
|
291
|
+
)
|
|
292
|
+
return {
|
|
293
|
+
...output,
|
|
294
|
+
temporalExtents: ranges.map((range) => {
|
|
295
|
+
const start = selectField(range, 'gte')
|
|
296
|
+
const end = selectField(range, 'lte')
|
|
297
|
+
return {
|
|
298
|
+
...(start !== null ? { start: toDate(start) } : null),
|
|
299
|
+
...(end !== null ? { end: toDate(end) } : null),
|
|
300
|
+
}
|
|
301
|
+
}),
|
|
302
|
+
}
|
|
303
|
+
},
|
|
261
304
|
}
|
|
262
305
|
|
|
263
306
|
private genericField = (output) => output
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { CatalogRecord } from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
3
|
import { SelectionsApiService } from '../../../../../../../libs/data-access/gn4/src'
|
|
4
|
-
import { BehaviorSubject,
|
|
4
|
+
import { BehaviorSubject, firstValueFrom } from 'rxjs'
|
|
5
5
|
|
|
6
6
|
const BUCKET_ID = 'gnui'
|
|
7
7
|
|
|
@@ -12,7 +12,6 @@ export class SelectionService {
|
|
|
12
12
|
selectedRecordsIdentifiers$: BehaviorSubject<string[]> = new BehaviorSubject(
|
|
13
13
|
[]
|
|
14
14
|
)
|
|
15
|
-
subscription: Subscription
|
|
16
15
|
|
|
17
16
|
constructor(private selectionsApi: SelectionsApiService) {
|
|
18
17
|
this.selectionsApi.get(BUCKET_ID).subscribe((selectedIds) => {
|
|
@@ -33,48 +32,25 @@ export class SelectionService {
|
|
|
33
32
|
this.selectedRecordsIdentifiers$.next(filtered)
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
selectRecords(records: CatalogRecord[])
|
|
37
|
-
const newIds =
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
selectRecords(records: CatalogRecord[]) {
|
|
36
|
+
const newIds = records.map((record) => record.uniqueIdentifier)
|
|
37
|
+
this.selectionsApi.add(BUCKET_ID, newIds).subscribe(() => {
|
|
38
|
+
this.addIdsToSelected(newIds)
|
|
40
39
|
})
|
|
41
|
-
const apiResponse = this.selectionsApi.add(BUCKET_ID, newIds)
|
|
42
|
-
return apiResponse.pipe(
|
|
43
|
-
tap(() => {
|
|
44
|
-
this.addIdsToSelected(newIds)
|
|
45
|
-
}),
|
|
46
|
-
map(() => undefined)
|
|
47
|
-
)
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
deselectRecords(records: CatalogRecord[])
|
|
51
|
-
const idsToBeRemoved =
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
deselectRecords(records: CatalogRecord[]) {
|
|
43
|
+
const idsToBeRemoved = records.map((record) => record.uniqueIdentifier)
|
|
44
|
+
this.selectionsApi.clear(BUCKET_ID, idsToBeRemoved).subscribe(() => {
|
|
45
|
+
this.removeIdsFromSelected(idsToBeRemoved)
|
|
54
46
|
})
|
|
55
|
-
const apiResponse = this.selectionsApi.clear(BUCKET_ID, idsToBeRemoved)
|
|
56
|
-
return apiResponse.pipe(
|
|
57
|
-
tap(() => {
|
|
58
|
-
this.removeIdsFromSelected(idsToBeRemoved)
|
|
59
|
-
}),
|
|
60
|
-
map(() => undefined)
|
|
61
|
-
)
|
|
62
47
|
}
|
|
63
48
|
|
|
64
|
-
clearSelection()
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
currentSelection
|
|
49
|
+
async clearSelection() {
|
|
50
|
+
const response = await firstValueFrom(this.selectionsApi.get(BUCKET_ID))
|
|
51
|
+
const currentSelection = Array.from(response)
|
|
52
|
+
this.selectionsApi.clear(BUCKET_ID, currentSelection).subscribe(() => {
|
|
53
|
+
this.removeIdsFromSelected(currentSelection)
|
|
69
54
|
})
|
|
70
|
-
this.selectionsApi.clear(BUCKET_ID, currentSelection)
|
|
71
|
-
const apiResponse = this.selectionsApi.clear(BUCKET_ID, currentSelection)
|
|
72
|
-
|
|
73
|
-
return apiResponse.pipe(
|
|
74
|
-
tap(() => {
|
|
75
|
-
this.removeIdsFromSelected(currentSelection)
|
|
76
|
-
}),
|
|
77
|
-
map(() => undefined)
|
|
78
|
-
)
|
|
79
55
|
}
|
|
80
56
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
2
|
-
import { Individual } from './contact.model'
|
|
3
|
-
import { Organization } from './organization.model'
|
|
2
|
+
import type { Individual } from './contact.model'
|
|
3
|
+
import type { Organization } from './organization.model'
|
|
4
|
+
import type { Geometry } from 'geojson'
|
|
4
5
|
|
|
5
6
|
type Uuid = string
|
|
6
7
|
|
|
@@ -122,6 +123,7 @@ export interface DatasetDownloadDistribution {
|
|
|
122
123
|
// textEncoding?: string
|
|
123
124
|
name?: string
|
|
124
125
|
description?: string
|
|
126
|
+
accessServiceProtocol?: ServiceProtocol
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
export interface OnlineLinkResource {
|
|
@@ -145,13 +147,16 @@ export interface GraphicOverview {
|
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
export interface DatasetSpatialExtent {
|
|
148
|
-
geometry:
|
|
150
|
+
geometry: Geometry
|
|
149
151
|
description?: string
|
|
150
152
|
}
|
|
151
153
|
|
|
154
|
+
/**
|
|
155
|
+
* At least a start or an end date should be provided
|
|
156
|
+
*/
|
|
152
157
|
export interface DatasetTemporalExtent {
|
|
153
|
-
start
|
|
154
|
-
end
|
|
158
|
+
start?: Date
|
|
159
|
+
end?: Date
|
|
155
160
|
description?: string
|
|
156
161
|
}
|
|
157
162
|
|
|
@@ -163,8 +168,8 @@ export interface DatasetRecord extends BaseRecord {
|
|
|
163
168
|
datasetUpdated?: Date
|
|
164
169
|
lineage: string // Explanation of the origin of this record (e.g: how, why)"
|
|
165
170
|
distributions: Array<DatasetDistribution>
|
|
166
|
-
spatialExtents: Array<DatasetSpatialExtent>
|
|
167
|
-
temporalExtents: Array<DatasetTemporalExtent>
|
|
171
|
+
spatialExtents: Array<DatasetSpatialExtent>
|
|
172
|
+
temporalExtents: Array<DatasetTemporalExtent>
|
|
168
173
|
spatialRepresentation?: SpatialRepresentationType
|
|
169
174
|
}
|
|
170
175
|
|
|
@@ -2,7 +2,7 @@ import { FieldFilters } from './filter.model'
|
|
|
2
2
|
import { CatalogRecord } from '../record'
|
|
3
3
|
import { Geometry } from 'geojson'
|
|
4
4
|
|
|
5
|
-
type FieldSort = ['desc' | 'asc', FieldName]
|
|
5
|
+
export type FieldSort = ['desc' | 'asc', FieldName]
|
|
6
6
|
export type SortByField = FieldSort | FieldSort[] // several sort criteria can be used!
|
|
7
7
|
export type FieldName = string
|
|
8
8
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user.model'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { OrganizationsServiceInterface } from '../../../../../../libs/common/domain/src/lib/organizations.service.interface'
|
|
3
|
-
import {
|
|
3
|
+
import { combineLatest, map, Observable } from 'rxjs'
|
|
4
4
|
import { UserModel } from '../../../../../../libs/common/domain/src/lib/model/user/user.model'
|
|
5
5
|
import { PlatformServiceInterface } from '../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
6
|
+
import { shareReplay } from 'rxjs/operators'
|
|
6
7
|
|
|
7
8
|
@Injectable({
|
|
8
9
|
providedIn: 'root',
|
|
@@ -16,20 +17,6 @@ export class MyOrgService {
|
|
|
16
17
|
userList: UserModel[]
|
|
17
18
|
}>
|
|
18
19
|
|
|
19
|
-
private myOrgDataSubject = new BehaviorSubject<{
|
|
20
|
-
orgName: string
|
|
21
|
-
logoUrl: string
|
|
22
|
-
recordCount: number
|
|
23
|
-
userCount: number
|
|
24
|
-
userList: UserModel[]
|
|
25
|
-
}>({
|
|
26
|
-
orgName: '',
|
|
27
|
-
logoUrl: '',
|
|
28
|
-
recordCount: 0,
|
|
29
|
-
userCount: 0,
|
|
30
|
-
userList: [],
|
|
31
|
-
})
|
|
32
|
-
|
|
33
20
|
constructor(
|
|
34
21
|
private platformService: PlatformServiceInterface,
|
|
35
22
|
private orgService: OrganizationsServiceInterface
|
|
@@ -55,7 +42,8 @@ export class MyOrgService {
|
|
|
55
42
|
userList,
|
|
56
43
|
userCount,
|
|
57
44
|
}
|
|
58
|
-
})
|
|
45
|
+
}),
|
|
46
|
+
shareReplay(1)
|
|
59
47
|
)
|
|
60
48
|
}
|
|
61
49
|
}
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
SupportedTypes,
|
|
10
10
|
} from '../../../../../../libs/util/data-fetcher/src'
|
|
11
11
|
import {
|
|
12
|
-
extensionToFormat,
|
|
13
12
|
getFileFormat,
|
|
13
|
+
getFileFormatFromServiceOutput,
|
|
14
14
|
getMimeTypeForFormat,
|
|
15
15
|
ProxyService,
|
|
16
16
|
} from '../../../../../../libs/util/shared/src'
|
|
@@ -45,7 +45,7 @@ interface WfsDownloadUrls {
|
|
|
45
45
|
export class DataService {
|
|
46
46
|
constructor(private proxy: ProxyService) {}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
getDownloadUrlsFromWfs(
|
|
49
49
|
wfsUrl: string,
|
|
50
50
|
featureTypeName: string
|
|
51
51
|
): Observable<WfsDownloadUrls> {
|
|
@@ -120,7 +120,7 @@ export class DataService {
|
|
|
120
120
|
)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
getDownloadUrlFromEsriRest(apiUrl: string, format: string): string {
|
|
124
124
|
return this.proxy.getProxiedUrl(
|
|
125
125
|
`${apiUrl}/query?f=${format}&where=1=1&outFields=*`
|
|
126
126
|
)
|
|
@@ -138,8 +138,11 @@ export class DataService {
|
|
|
138
138
|
map((urls) =>
|
|
139
139
|
Object.keys(urls).map((format) => ({
|
|
140
140
|
...wfsLink,
|
|
141
|
+
type: 'download',
|
|
141
142
|
url: new URL(urls[format]),
|
|
142
|
-
mimeType: getMimeTypeForFormat(
|
|
143
|
+
mimeType: getMimeTypeForFormat(
|
|
144
|
+
getFileFormatFromServiceOutput(format)
|
|
145
|
+
),
|
|
143
146
|
}))
|
|
144
147
|
)
|
|
145
148
|
)
|
|
@@ -153,7 +156,7 @@ export class DataService {
|
|
|
153
156
|
url: new URL(
|
|
154
157
|
this.getDownloadUrlFromEsriRest(esriRestLink.url.toString(), format)
|
|
155
158
|
),
|
|
156
|
-
mimeType: getMimeTypeForFormat(
|
|
159
|
+
mimeType: getMimeTypeForFormat(getFileFormatFromServiceOutput(format)),
|
|
157
160
|
}))
|
|
158
161
|
}
|
|
159
162
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common'
|
|
2
2
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
|
3
3
|
import { EditorService, FormField } from '../services/editor.service'
|
|
4
|
+
import { UiInputsModule } from '../../../../../../libs/ui/inputs/src'
|
|
4
5
|
|
|
5
6
|
@Component({
|
|
6
7
|
selector: 'gn-ui-record-form',
|
|
@@ -8,7 +9,7 @@ import { EditorService, FormField } from '../services/editor.service'
|
|
|
8
9
|
styleUrls: ['./record-form.component.css'],
|
|
9
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
11
|
standalone: true,
|
|
11
|
-
imports: [CommonModule],
|
|
12
|
+
imports: [CommonModule, UiInputsModule],
|
|
12
13
|
})
|
|
13
14
|
export class RecordFormComponent {
|
|
14
15
|
constructor(public editorService: EditorService) {}
|
|
@@ -17,3 +17,4 @@ export * from './lib/layers-panel/layers-panel.component'
|
|
|
17
17
|
export * from './lib/add-layer-from-catalog/add-layer-from-catalog.component'
|
|
18
18
|
export * from './lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component'
|
|
19
19
|
export * from './lib/map-container/map-container.component'
|
|
20
|
+
export * from './lib/geocoding/geocoding.component'
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div class="flex flex-col gap-2 my-2">
|
|
2
|
+
<div class="flex items-center gap-4">
|
|
3
|
+
<div class="flex-grow rounded-md border-2 border-gray-200">
|
|
4
|
+
<gn-ui-drag-and-drop-file-input
|
|
5
|
+
(fileChange)="handleFileChange($event)"
|
|
6
|
+
[accept]="acceptedMimeType.join(',')"
|
|
7
|
+
[placeholder]="'map.addFromFile.placeholder' | translate"
|
|
8
|
+
class="placeholder-grey"
|
|
9
|
+
></gn-ui-drag-and-drop-file-input>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<p class="text-sm text-gray-600" translate>map.help.addFromFile</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div *ngIf="errorMessage" class="text-red-500 mt-2">
|
|
16
|
+
{{ errorMessage }}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div *ngIf="successMessage" class="text-green-500 mt-2">
|
|
20
|
+
{{ successMessage }}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Component } from '@angular/core'
|
|
2
|
+
import { MapContextLayerModel } from '../map-context/map-context.model'
|
|
3
|
+
import { MapFacade } from '../+state/map.facade'
|
|
4
|
+
|
|
5
|
+
const INVALID_FILE_FORMAT_ERROR_MESSAGE = 'Invalid file format'
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'gn-ui-add-layer-from-file',
|
|
9
|
+
templateUrl: './add-layer-from-file.component.html',
|
|
10
|
+
styleUrls: ['./add-layer-from-file.component.css'],
|
|
11
|
+
})
|
|
12
|
+
export class AddLayerFromFileComponent {
|
|
13
|
+
errorMessage: string | null = null
|
|
14
|
+
successMessage: string | null = null
|
|
15
|
+
loading = false
|
|
16
|
+
readonly acceptedMimeType = ['.geojson']
|
|
17
|
+
readonly maxFileSize = 5000000
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
private mapFacade: MapFacade,
|
|
21
|
+
private changeDetectorRef: ChangeDetectorRef
|
|
22
|
+
) {}
|
|
23
|
+
|
|
24
|
+
async handleFileChange(file: File) {
|
|
25
|
+
if (!file) {
|
|
26
|
+
this.displayMessage(INVALID_FILE_FORMAT_ERROR_MESSAGE, 'error')
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
if (file.size > this.maxFileSize) {
|
|
30
|
+
this.displayMessage('File size exceeds the limit of 5MB', 'error')
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
await this.addLayer(file)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private async addLayer(file: File) {
|
|
37
|
+
this.errorMessage = null
|
|
38
|
+
this.loading = true
|
|
39
|
+
try {
|
|
40
|
+
if (!this.isFileFormatValid(file)) {
|
|
41
|
+
this.displayMessage(INVALID_FILE_FORMAT_ERROR_MESSAGE, 'error')
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const fileExtension = this.getFileExtension(file)
|
|
46
|
+
switch (fileExtension) {
|
|
47
|
+
case 'geojson':
|
|
48
|
+
await this.addGeoJsonLayer(file)
|
|
49
|
+
break
|
|
50
|
+
default:
|
|
51
|
+
this.displayMessage(INVALID_FILE_FORMAT_ERROR_MESSAGE, 'error')
|
|
52
|
+
break
|
|
53
|
+
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
const err = error as Error
|
|
56
|
+
this.displayMessage('Error loading file: ' + err.message, 'error')
|
|
57
|
+
} finally {
|
|
58
|
+
this.loading = false
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private addGeoJsonLayer(file: File) {
|
|
63
|
+
return new Promise<void>((resolve, reject) => {
|
|
64
|
+
try {
|
|
65
|
+
const reader = new FileReader()
|
|
66
|
+
reader.onload = () => {
|
|
67
|
+
const result = reader.result as string
|
|
68
|
+
const title = file.name.split('.').slice(0, -1).join('.')
|
|
69
|
+
const layerToAdd: MapContextLayerModel = {
|
|
70
|
+
type: 'geojson',
|
|
71
|
+
data: result,
|
|
72
|
+
}
|
|
73
|
+
this.mapFacade.addLayer({ ...layerToAdd, title: title })
|
|
74
|
+
this.displayMessage('File successfully added to map', 'success')
|
|
75
|
+
resolve()
|
|
76
|
+
}
|
|
77
|
+
reader.onerror = reject
|
|
78
|
+
reader.readAsText(file)
|
|
79
|
+
} catch (error) {
|
|
80
|
+
reject(error)
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private isFileFormatValid(file: File): boolean {
|
|
86
|
+
const fileExtension = this.getFileExtension(file)
|
|
87
|
+
return this.acceptedMimeType.includes(`.${fileExtension}`)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private getFileExtension(file: File): string | undefined {
|
|
91
|
+
return file.name.split('.').pop()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private displayMessage(message: string, type: 'success' | 'error') {
|
|
95
|
+
if (type === 'success') {
|
|
96
|
+
this.successMessage = message
|
|
97
|
+
} else if (type === 'error') {
|
|
98
|
+
this.errorMessage = message
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
this.successMessage = null
|
|
103
|
+
this.errorMessage = null
|
|
104
|
+
this.changeDetectorRef.detectChanges()
|
|
105
|
+
}, 5000)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<div class="flex items-center mb-5">
|
|
2
|
+
<gn-ui-text-input
|
|
3
|
+
[(value)]="wfsUrl"
|
|
4
|
+
(valueChange)="urlChange.next($event)"
|
|
5
|
+
[hint]="'map.wfs.urlInput.hint' | translate"
|
|
6
|
+
class="w-96"
|
|
7
|
+
>
|
|
8
|
+
</gn-ui-text-input>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div *ngIf="errorMessage" class="text-red-500 mt-2">
|
|
12
|
+
{{ errorMessage }}
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div *ngIf="loading">
|
|
16
|
+
<p class="loading-message" translate>map.loading.service</p>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div *ngIf="!loading && layers.length > 0">
|
|
20
|
+
<h2 class="font-bold" translate>map.layers.available</h2>
|
|
21
|
+
<ng-container *ngFor="let layer of layers">
|
|
22
|
+
<div class="flex items-center justify-between my-2 layer-item-tree">
|
|
23
|
+
<p class="max-w-xs overflow-hidden overflow-ellipsis whitespace-nowrap">
|
|
24
|
+
{{ layer.title }}
|
|
25
|
+
</p>
|
|
26
|
+
<gn-ui-button
|
|
27
|
+
*ngIf="layer.name"
|
|
28
|
+
class="layer-add-btn"
|
|
29
|
+
type="primary"
|
|
30
|
+
(buttonClick)="addLayer(layer)"
|
|
31
|
+
extraClass="text-sm !px-2 !py-1"
|
|
32
|
+
translate
|
|
33
|
+
><span translate> map.layer.add </span></gn-ui-button
|
|
34
|
+
>
|
|
35
|
+
</div>
|
|
36
|
+
</ng-container>
|
|
37
|
+
</div>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Component, OnInit } from '@angular/core'
|
|
2
|
+
import { WfsEndpoint, WfsFeatureTypeBrief } from '@camptocamp/ogc-client'
|
|
3
|
+
import { Subject } from 'rxjs'
|
|
4
|
+
import {
|
|
5
|
+
MapContextLayerModel,
|
|
6
|
+
MapContextLayerTypeEnum,
|
|
7
|
+
} from '../map-context/map-context.model'
|
|
8
|
+
import { MapFacade } from '../+state/map.facade'
|
|
9
|
+
import { debounceTime } from 'rxjs/operators'
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'gn-ui-add-layer-from-wfs',
|
|
13
|
+
templateUrl: './add-layer-from-wfs.component.html',
|
|
14
|
+
styleUrls: ['./add-layer-from-wfs.component.css'],
|
|
15
|
+
})
|
|
16
|
+
export class AddLayerFromWfsComponent implements OnInit {
|
|
17
|
+
wfsUrl = ''
|
|
18
|
+
loading = false
|
|
19
|
+
layers: WfsFeatureTypeBrief[] = []
|
|
20
|
+
wfsEndpoint: WfsEndpoint | null = null
|
|
21
|
+
urlChange = new Subject<string>()
|
|
22
|
+
errorMessage: string | null = null
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
private mapFacade: MapFacade,
|
|
26
|
+
private changeDetectorRef: ChangeDetectorRef
|
|
27
|
+
) {}
|
|
28
|
+
|
|
29
|
+
ngOnInit() {
|
|
30
|
+
this.urlChange.pipe(debounceTime(700)).subscribe(() => this.loadLayers())
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async loadLayers() {
|
|
34
|
+
this.errorMessage = null
|
|
35
|
+
try {
|
|
36
|
+
this.loading = true
|
|
37
|
+
|
|
38
|
+
if (this.wfsUrl.trim() === '') {
|
|
39
|
+
this.layers = []
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.wfsEndpoint = await new WfsEndpoint(this.wfsUrl).isReady()
|
|
44
|
+
this.layers = this.wfsEndpoint.getFeatureTypes()
|
|
45
|
+
console.log(this.layers)
|
|
46
|
+
} catch (error) {
|
|
47
|
+
const err = error as Error
|
|
48
|
+
this.layers = []
|
|
49
|
+
this.errorMessage = 'Error loading layers: ' + err.message
|
|
50
|
+
} finally {
|
|
51
|
+
this.loading = false
|
|
52
|
+
this.changeDetectorRef.markForCheck()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
addLayer(layer: WfsFeatureTypeBrief) {
|
|
57
|
+
const layerToAdd: MapContextLayerModel = {
|
|
58
|
+
name: layer.name,
|
|
59
|
+
url: this.wfsUrl.toString(),
|
|
60
|
+
type: MapContextLayerTypeEnum.WFS,
|
|
61
|
+
}
|
|
62
|
+
this.mapFacade.addLayer({ ...layerToAdd, title: layer.title })
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -21,6 +21,10 @@ import { AddLayerRecordPreviewComponent } from './add-layer-from-catalog/add-lay
|
|
|
21
21
|
import { UiElementsModule } from '../../../../../libs/ui/elements/src'
|
|
22
22
|
import { UiInputsModule } from '../../../../../libs/ui/inputs/src'
|
|
23
23
|
import { AddLayerFromWmsComponent } from './add-layer-from-wms/add-layer-from-wms.component'
|
|
24
|
+
import { AddLayerFromFileComponent } from './add-layer-from-file/add-layer-from-file.component'
|
|
25
|
+
import { AddLayerFromWfsComponent } from './add-layer-from-wfs/add-layer-from-wfs.component'
|
|
26
|
+
import { GeocodingComponent } from './geocoding/geocoding.component'
|
|
27
|
+
import { GEOCODING_PROVIDER, GeocodingProvider } from './geocoding.service'
|
|
24
28
|
|
|
25
29
|
@NgModule({
|
|
26
30
|
declarations: [
|
|
@@ -31,6 +35,9 @@ import { AddLayerFromWmsComponent } from './add-layer-from-wms/add-layer-from-wm
|
|
|
31
35
|
MapContainerComponent,
|
|
32
36
|
AddLayerRecordPreviewComponent,
|
|
33
37
|
AddLayerFromWmsComponent,
|
|
38
|
+
AddLayerFromFileComponent,
|
|
39
|
+
AddLayerFromWfsComponent,
|
|
40
|
+
GeocodingComponent,
|
|
34
41
|
],
|
|
35
42
|
exports: [
|
|
36
43
|
MapContextComponent,
|
|
@@ -38,6 +45,7 @@ import { AddLayerFromWmsComponent } from './add-layer-from-wms/add-layer-from-wm
|
|
|
38
45
|
LayersPanelComponent,
|
|
39
46
|
AddLayerFromCatalogComponent,
|
|
40
47
|
MapContainerComponent,
|
|
48
|
+
GeocodingComponent,
|
|
41
49
|
],
|
|
42
50
|
imports: [
|
|
43
51
|
CommonModule,
|
|
@@ -58,6 +66,10 @@ import { AddLayerFromWmsComponent } from './add-layer-from-wms/add-layer-from-wm
|
|
|
58
66
|
useValue: defaultMapOptions,
|
|
59
67
|
},
|
|
60
68
|
MapFacade,
|
|
69
|
+
{
|
|
70
|
+
provide: GEOCODING_PROVIDER,
|
|
71
|
+
useValue: ['geonames', { maxRows: 5 }] as GeocodingProvider,
|
|
72
|
+
},
|
|
61
73
|
],
|
|
62
74
|
})
|
|
63
75
|
export class FeatureMapModule {}
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<gn-ui-search-input
|
|
2
|
+
[(value)]="searchText"
|
|
3
|
+
(valueChange)="onSearchChange($event)"
|
|
4
|
+
(keyup.enter)="onEnterPress()"
|
|
5
|
+
[placeholder]="'map.geocoding.placeholder' | translate"
|
|
6
|
+
>
|
|
7
|
+
</gn-ui-search-input>
|
|
8
|
+
<ul
|
|
9
|
+
class="bg-gray-50 border border-gray-200 w-full mt-2 shadow-sm rounded-lg"
|
|
10
|
+
*ngIf="results && results.length"
|
|
11
|
+
>
|
|
12
|
+
<li
|
|
13
|
+
*ngFor="let result of results"
|
|
14
|
+
(click)="zoomToLocation(result)"
|
|
15
|
+
class="flex items-center pl-8 pr-4 py-2 border-b border-gray-200 relative cursor-pointer hover:bg-blue-100 hover:text-gray-800 transition duration-300 ease-in-out"
|
|
16
|
+
>
|
|
17
|
+
<svg
|
|
18
|
+
class="stroke-current text-blue-500 absolute w-5 h-5 left-3 top-3"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
fill="none"
|
|
21
|
+
viewBox="0 0 24 24"
|
|
22
|
+
stroke="currentColor"
|
|
23
|
+
>
|
|
24
|
+
<path
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
stroke-width="2"
|
|
28
|
+
d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
stroke-linecap="round"
|
|
32
|
+
stroke-linejoin="round"
|
|
33
|
+
stroke-width="2"
|
|
34
|
+
d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"
|
|
35
|
+
/>
|
|
36
|
+
</svg>
|
|
37
|
+
<span class="font-sans font-semibold ml-4">{{ result.label }}</span>
|
|
38
|
+
</li>
|
|
39
|
+
</ul>
|