Implementation: map based picker for geospatial point fields - #5872
Implementation: map based picker for geospatial point fields#5872kanasznagyzoltan wants to merge 4 commits into
Conversation
|
This is a short demo where you can use the map based picker for creating Point values. map_based_picker_demo_converted.mp4 |
…ipeline: [disabled] → [dsBtnDisabled]
|
Hi @kanasznagyzoltan, |
…-picker-for-geospatial-point-fields Resolve the conflict in dso-edit-metadata-value-field.decorator.ts: upstream replaced the hardcoded component map with a generated decorator registry, so the geospatial field component now registers itself via @editMetadataValueFieldComponent(GEOSPATIAL) instead of being listed in the map.
|
Updated: merged current main and resolved the conflict. Upstream has since replaced the hardcoded edit-metadata component map with the generated decorator registry, so the geospatial field component now registers itself via editMetadataValueFieldComponent(EditMetadataValueFieldType.GEOSPATIAL), like the text/entity/authority fields. As a result it also gets lazy loading, and dso-edit-metadata-value-field.decorator.ts no longer needs to be touched at all — the PR is now purely additive. Unit tests and lint pass locally. There's a short demo video earlier in this thread if anyone wants to see the picker in action without checking out the branch — feedback very welcome. |
References
Description
Adds a map-based picker for geospatial point metadata fields (e.g.
dcterms.spatial), so a WKTPOINT(longitude latitude)value can be picked or visually verified on a Leaflet map instead of being typed by hand, on both the submission form and the item metadata editor.Instructions for Reviewers
List of changes in this PR:
GeospatialMapPickerComponent(src/app/shared/geospatial-map-picker/): a modal Leaflet map that lets a single point be picked (click/drag a marker) or, if the field already has a value, opens centred on that point so it can be verified/corrected. Closes with the resulting WKT string, ornullif the point is removed. The plain-text WKT input remains available alongside it.geospatialinput-type (ParserType.Geospatial/DynamicGeospatialMapModel/DsDynamicGeospatialMapComponent), wired into the existing parser/dynamic-form-control pipeline the same way astag/onebox.EditMetadataValueFieldType.GEOSPATIAL/DsoEditMetadataGeospatialFieldComponent. The field type is recognised automatically fromgeospatialMapViewer.spatialMetadataFields(no extra per-field configuration needed beyond what the existing geospatial map viewer already requires).How to test:
geospatialinput-type to a metadata field insubmission-forms.xmlinto a form definition you are using for a collection, e.g.:geospatialMapViewer.spatialMetadataFields, so the item metadata editor also recognises it. The rest of thegeospatialMapViewerblock isn't required for the picker itself, but enabling it is useful for reviewing the full round-trip (the point you pick showing up on the existing item-page/search map viewer):The same map-pin button should appear; opening it should centre the map on the existing point.
enableItemPageFields/enableBrowseMap/enableSearchViewModeenabled, confirm the picked point renders correctly on the item page map / browse-by-map / search "map view".npm run test:headless(or focus the four new spec files) to run the new unit tests.Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.