diff --git a/src/components/SearchPanel.vue b/src/components/SearchPanel.vue
index 1f91f32bf..f8dff1faa 100644
--- a/src/components/SearchPanel.vue
+++ b/src/components/SearchPanel.vue
@@ -135,6 +135,13 @@
+
+
+
diff --git a/src/components/g3w-search.js b/src/components/g3w-search.js
index 1e968aa01..dad8606f3 100644
--- a/src/components/g3w-search.js
+++ b/src/components/g3w-search.js
@@ -71,6 +71,7 @@ export function SearchPanel(opts = {}, show = false) {
/** keep a reference to initial search options (you shouldn't mutate them..) */
options: d.input.options,
})),
+ autofilter: false, //@since v3.11.0. Used to set already feature layers filtered https://github.com/g3w-suite/g3w-client/issues/676
};
// create search form structure
@@ -175,7 +176,8 @@ async function doSearch({
queryUrl,
formatter: 1,
feature_count,
- raw: false // in order to get a raw response
+ raw: false, // in order to get a raw response
+ autofilter: state.autofilter //Boolean autofilter by server
},
outputs: show && { title: state.title }
});
diff --git a/src/map/layers/layer.js b/src/map/layers/layer.js
index 538655b5f..8a2b319c5 100644
--- a/src/map/layers/layer.js
+++ b/src/map/layers/layer.js
@@ -1767,6 +1767,7 @@ class Layer extends G3WObject {
* @param options.unique
* @param options.queryUrl
* @param options.ordering
+ * @param options.autofilter //@since 3.11.0
* @param { Object } params - OWS search params
*
* @returns { Promise }
@@ -1798,6 +1799,7 @@ class Layer extends G3WObject {
suggest: options.suggest,
/** @since 3.9.0 */
formatter: undefined !== options.formatter ? options.formatter : 1,
+ autofilter: options.autofilter,
})
);
} catch(e) {
@@ -1834,6 +1836,7 @@ class Layer extends G3WObject {
formatter = 1,
queryUrl,
ordering,
+ autofilter, //@since 3.11.0
} = {}) {
const provider = this.getProvider('data');
provider._projections = provider._projections || { map: null, layer: null };
@@ -1845,7 +1848,8 @@ class Layer extends G3WObject {
unique,
fformatter,
ffield,
- filtertoken: ApplicationState.tokens.filtertoken
+ filtertoken: ApplicationState.tokens.filtertoken,
+ autofilter,
};
try {
const url = queryUrl ? queryUrl : provider._layer.getUrl('data');
diff --git a/src/services/data.js b/src/services/data.js
index 9f7f4ad59..7e4984f89 100644
--- a/src/services/data.js
+++ b/src/services/data.js
@@ -232,6 +232,7 @@ export default {
* @param options.feature_count
* @param options.formatter
* @param options.ordering
+ * @param options.autofilter //@since 3.11.0
*
* @returns { Promise<{ data: [], query: { type: 'search', search: * }, type: 'api' | 'ows' }> }
*/
@@ -243,6 +244,7 @@ export default {
feature_count,
formatter: 1,
ordering,
+ autofilter: false,
}) {
const { layer, ...params } = options;
params.filter = [].concat(params.filter); // check if filter is array