Skip to content
Permalink
Browse files

Use limit and filter parameters in WSGI search

  • Loading branch information...
uprel committed Sep 13, 2019
1 parent 9a3d1bd commit 2191ba713e321887b2aa2f97015388dc4be460e3
Showing with 26 additions and 6 deletions.
  1. +17 −4 client/site/js/QGISExtensions.js
  2. +9 −2 client/site/js/WebgisInit_functions.js
@@ -594,6 +594,8 @@ QGIS.SearchComboBox = Ext.extend(Ext.form.ComboBox, {
forceSelection: true,
searchtables: null,
srs: null,
limit: null,
filter: null,

initComponent: function() {

@@ -604,6 +606,20 @@ QGIS.SearchComboBox = Ext.extend(Ext.form.ComboBox, {
this.on("keyUp", this.keyUpHandler);
this.on("afterrender", this.afterrenderHandler);
this.on("beforeselect", this.beforeselectHandler);


var params = {
searchtables: this.getSearchTables(),
srs: this.srs
};

if(this.limit) {
params.limit = this.limit;
}
if(this.filter) {
params.filter = this.filter;
}

this.store = new Ext.data.JsonStore({
proxy: new Ext.data.ScriptTagProxy({
url: this.url,
@@ -612,10 +628,7 @@ QGIS.SearchComboBox = Ext.extend(Ext.form.ComboBox, {
nocache: false,
autoAbort: true
}),
baseParams: {
searchtables: this.getSearchTables(),
srs: this.srs
},
baseParams: params,
root: 'results',
fields: ['searchtable', 'searchtext', 'displaytext', 'bbox', 'showlayer', 'selectable']
});
@@ -1083,7 +1083,7 @@ function postLoading() {
maxRows: 10
});
} else {
qgisSearchCombo = new QGIS.SearchComboBox({
var conf = {
map: geoExtMap.map,
highlightLayerName: 'attribHighLight',
hasReverseAxisOrder: false, // PostGIS returns bbox' coordinates always x/y
@@ -1093,7 +1093,14 @@ function postLoading() {
url: searchBoxQueryURL,
geomUrl: searchBoxGetGeomURL,
srs: projectData.crs.split(':')[1] //this is the map coordinate system and that's what we need to get from server
});
}
if(projectData.wsgi.limit) {
conf.limit = projectData.wsgi.limit;
}
if(projectData.wsgi.filter) {
conf.filter = projectData.wsgi.filter;
}
qgisSearchCombo = new QGIS.SearchComboBox(conf);
}
myTopToolbar.insert(myTopToolbar.items.length, qgisSearchCombo);
}

0 comments on commit 2191ba7

Please sign in to comment.
You can’t perform that action at this time.