Add nofilters query param

This commit is contained in:
Ivan Malagon 2017-12-12 11:54:09 +01:00
parent 00f81db57e
commit 605be77a04
2 changed files with 5 additions and 4 deletions

View File

@ -40,8 +40,8 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
var pg = new PSQL(dbParamsFromReqParams(params));
var ownFilter = +params.own_filter;
// ownFilter = !!ownFilter;
var query = getDaviewQuery(dataviewDefinition, ownFilter);
var noFilters = !!params.no_filters;
var query = getDaviewQuery(dataviewDefinition, ownFilter, noFilters);
if (params.bbox) {
var bboxFilter = new BBoxFilter({column: 'the_geom_webmercator', srid: 3857}, {bbox: params.bbox});
query = bboxFilter.sql(query);
@ -62,8 +62,8 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
);
};
function getDaviewQuery(dataviewDefinition, ownFilter) {
if (ownFilter === -1) {
function getDaviewQuery(dataviewDefinition, ownFilter, noFilters) {
if (noFilters) {
return dataviewDefinition.sql.no_filters;
} else if (ownFilter === 1) {
return dataviewDefinition.sql.own_filter_on;

View File

@ -109,6 +109,7 @@ LayergroupController.prototype.register = function(app) {
var allowedDataviewQueryParams = [
'filters', // json
'own_filter', // 0, 1
'no_filters', // 0, 1
'bbox', // w,s,e,n
'start', // number
'end', // number