Move definition to the scope where it's needed

This commit is contained in:
Javier Goizueta 2016-05-18 18:21:17 +02:00
parent 9206b1a1b5
commit 2a06405a58

View File

@ -139,17 +139,17 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
if (params.bbox) { if (params.bbox) {
var bboxFilter = new BBoxFilter({column: 'the_geom', srid: 4326}, {bbox: params.bbox}); var bboxFilter = new BBoxFilter({column: 'the_geom', srid: 4326}, {bbox: params.bbox});
query = bboxFilter.sql(query); query = bboxFilter.sql(query);
var bbox_filter_definition = {
type: 'bbox',
options: {
column: 'the_geom',
srid: 4326,
},
params: {
bbox: params.bbox
}
};
if ( queryRewriteData ) { if ( queryRewriteData ) {
var bbox_filter_definition = {
type: 'bbox',
options: {
column: 'the_geom',
srid: 4326,
},
params: {
bbox: params.bbox
}
};
queryRewriteData = _.extend(queryRewriteData, { bbox_filter: bbox_filter_definition }); queryRewriteData = _.extend(queryRewriteData, { bbox_filter: bbox_filter_definition });
} }
} }