diff --git a/components/MapSelection.jsx b/components/MapSelection.jsx
index 5f22869c6..b27c12c9b 100644
--- a/components/MapSelection.jsx
+++ b/components/MapSelection.jsx
@@ -19,22 +19,24 @@ import MeasureUtils from '../utils/MeasureUtils';
class MapSelection extends React.Component {
static propTypes = {
- /* Whether the selection tool is active */
+ /** Whether the selection tool is active */
active: PropTypes.bool,
- /* Optional, a css-cursor to use when drawing */
+ /** Optional, a css-cursor to use when drawing */
cursor: PropTypes.string,
- /* The selection geometry type (Point, LineString, Polygon, Circle, DragBox, Box) */
+ /** The selection geometry type (Point, LineString, Polygon, Circle, DragBox, Box) */
geomType: PropTypes.string,
- /* Initial geometry or geometry to update. */
+ /** Initial geometry or geometry to update. */
geometry: PropTypes.object,
- /* The callback which is invoked with a drawn geometry. */
+ /** The callback which is invoked with a drawn geometry. */
geometryChanged: PropTypes.func,
- /* Whether to show measurements while drawing. */
+ /** Whether to hide the current selection (except while drawing). */
+ hideGeometry: PropTypes.bool,
+ /** Whether to show measurements while drawing. */
measure: PropTypes.bool,
projection: PropTypes.string,
- /* Optional: the selection feature style name. */
+ /** Optional: the selection feature style name. */
styleName: PropTypes.string,
- /* Optional: the selection feature style options. */
+ /** Optional: the selection feature style options. */
styleOptions: PropTypes.object
};
static defaultProps = {
@@ -64,6 +66,9 @@ class MapSelection extends React.Component {
}
}
componentDidUpdate(prevProps, prevState) {
+ if (this.props.hideGeometry !== prevProps.hideGeometry) {
+ this.selectionLayer.setVisible(!this.props.hideGeometry);
+ }
if (this.props.geomType !== prevProps.geomType) {
this.selectionLayer.getSource().clear();
}
diff --git a/plugins/MapFilter.jsx b/plugins/MapFilter.jsx
index 38fbd9a7e..e8556b70d 100644
--- a/plugins/MapFilter.jsx
+++ b/plugins/MapFilter.jsx
@@ -315,6 +315,7 @@ class MapFilter extends React.Component {
geomType={selGeomType}
geometry={this.state.geomFilter?.geom}
geometryChanged={this.setFilterGeometry}
+ hideGeometry={this.state.geomFilter?.hideFilterGeom}
key="MapSelection"
styleOptions={this.props.highlightStyle} />
];
@@ -545,6 +546,9 @@ class MapFilter extends React.Component {
);
@@ -562,6 +566,9 @@ class MapFilter extends React.Component {
filterGeomPicked = (layer, feature) => {
this.setState((state) => ({geomFilter: {...state.geomFilter, geom: feature.geometry, geomType: feature.geometry.type}}));
};
+ toggleHideFilterGeom = (ev) => {
+ this.setState((state) => ({geomFilter: {...state.geomFilter, hideFilterGeom: ev.target.checked}}));
+ };
toggleFilter = (filterId, active) => {
this.setState((state) => ({
filters: {
diff --git a/translations/ca-ES.json b/translations/ca-ES.json
index 18546263a..819f96843 100644
--- a/translations/ca-ES.json
+++ b/translations/ca-ES.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/cs-CZ.json b/translations/cs-CZ.json
index 26e2f036a..601bf28b3 100644
--- a/translations/cs-CZ.json
+++ b/translations/cs-CZ.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/de-CH.json b/translations/de-CH.json
index a8e3532f4..0d9e7c59e 100644
--- a/translations/de-CH.json
+++ b/translations/de-CH.json
@@ -283,6 +283,7 @@
"brokenrendering": "Die Kartendarstellung könnte aufgrund eines ungültigen Filterausdrucks fehlerhaft sein",
"cancel": "Abbrechen",
"geomfilter": "Geometrie",
+ "hidefiltergeom": "Filtergeometrie ausblenden",
"invalidfilter": "Ungültiger Filterausdruck",
"save": "Speichern",
"select": "Auswählen...",
diff --git a/translations/de-DE.json b/translations/de-DE.json
index 578a3fcd7..ee7c076fe 100644
--- a/translations/de-DE.json
+++ b/translations/de-DE.json
@@ -283,6 +283,7 @@
"brokenrendering": "Die Kartendarstellung könnte aufgrund eines ungültigen Filterausdrucks fehlerhaft sein",
"cancel": "Abbrechen",
"geomfilter": "Geometrie",
+ "hidefiltergeom": "",
"invalidfilter": "Ungültiger Filterausdruck",
"save": "Speichern",
"select": "Auswählen...",
diff --git a/translations/en-US.json b/translations/en-US.json
index 7419ac7e0..a787240e3 100644
--- a/translations/en-US.json
+++ b/translations/en-US.json
@@ -283,6 +283,7 @@
"brokenrendering": "Map rendering may be broken due to an invalid filter expression",
"cancel": "Cancel",
"geomfilter": "Geometry",
+ "hidefiltergeom": "Hide filter geometry",
"invalidfilter": "Invalid filter expression",
"save": "Save",
"select": "Select...",
diff --git a/translations/es-ES.json b/translations/es-ES.json
index 1d0b089a8..bdf324604 100644
--- a/translations/es-ES.json
+++ b/translations/es-ES.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/fi-FI.json b/translations/fi-FI.json
index b6108f1ee..89f3e688e 100644
--- a/translations/fi-FI.json
+++ b/translations/fi-FI.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/fr-FR.json b/translations/fr-FR.json
index ea219bdbb..cd9846b0c 100644
--- a/translations/fr-FR.json
+++ b/translations/fr-FR.json
@@ -283,6 +283,7 @@
"brokenrendering": "Le rendu de la carte peut être interrompu à cause d'une expression filtre invalide",
"cancel": "Annuler",
"geomfilter": "Géométrique",
+ "hidefiltergeom": "Masquer la géométrie du filtre",
"invalidfilter": "Expression de filtre non valide",
"save": "Enregistrer",
"select": "Sélectionner...",
diff --git a/translations/hu-HU.json b/translations/hu-HU.json
index 9cf47eda7..301642b38 100644
--- a/translations/hu-HU.json
+++ b/translations/hu-HU.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/it-IT.json b/translations/it-IT.json
index f3fb3852a..a40572cf5 100644
--- a/translations/it-IT.json
+++ b/translations/it-IT.json
@@ -283,6 +283,7 @@
"brokenrendering": "Il rendering della mappa potrebbe essere interrotto a causa di un'espressione filtro invalida",
"cancel": "Annulla",
"geomfilter": "Geometrico",
+ "hidefiltergeom": "Nascondi geometria filtro",
"invalidfilter": "Espressione filtro non valida",
"save": "Salva",
"select": "Seleziona...",
diff --git a/translations/no-NO.json b/translations/no-NO.json
index af6a6e154..03e9d24fe 100644
--- a/translations/no-NO.json
+++ b/translations/no-NO.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/pl-PL.json b/translations/pl-PL.json
index b6b348d21..9b221e28a 100644
--- a/translations/pl-PL.json
+++ b/translations/pl-PL.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/pt-BR.json b/translations/pt-BR.json
index d16bb7c31..f7674dc2d 100644
--- a/translations/pt-BR.json
+++ b/translations/pt-BR.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/pt-PT.json b/translations/pt-PT.json
index a7eb0bcbc..b4b615ef4 100644
--- a/translations/pt-PT.json
+++ b/translations/pt-PT.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/ro-RO.json b/translations/ro-RO.json
index 9e1545754..31f5583d4 100644
--- a/translations/ro-RO.json
+++ b/translations/ro-RO.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/ru-RU.json b/translations/ru-RU.json
index b262d2050..22348b40b 100644
--- a/translations/ru-RU.json
+++ b/translations/ru-RU.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/sv-SE.json b/translations/sv-SE.json
index 6dac1a936..2e29ca53e 100644
--- a/translations/sv-SE.json
+++ b/translations/sv-SE.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/tr-TR.json b/translations/tr-TR.json
index a7b3e26de..3f4c42f2b 100644
--- a/translations/tr-TR.json
+++ b/translations/tr-TR.json
@@ -283,6 +283,7 @@
"brokenrendering": "",
"cancel": "",
"geomfilter": "",
+ "hidefiltergeom": "",
"invalidfilter": "",
"save": "",
"select": "",
diff --git a/translations/tsconfig.json b/translations/tsconfig.json
index 8d669d89b..9a8180d75 100644
--- a/translations/tsconfig.json
+++ b/translations/tsconfig.json
@@ -246,6 +246,7 @@
"mapfilter.brokenrendering",
"mapfilter.cancel",
"mapfilter.geomfilter",
+ "mapfilter.hidefiltergeom",
"mapfilter.invalidfilter",
"mapfilter.save",
"mapfilter.select",