Merge conditions

This commit is contained in:
Raul Ochoa 2017-05-31 13:00:37 -04:00
parent b4fbe0b8cf
commit 4b562e6768

View File

@ -76,20 +76,18 @@ function getQueryRewriteData(mapConfig, dataviewDefinition, params) {
});
}
if (params.bbox) {
if ( queryRewriteData ) {
var bbox_filter_definition = {
type: 'bbox',
options: {
column: 'the_geom_webmercator',
srid: 3857
},
params: {
bbox: params.bbox
}
};
queryRewriteData = _.extend(queryRewriteData, { bbox_filter: bbox_filter_definition });
}
if (params.bbox && queryRewriteData) {
var bbox_filter_definition = {
type: 'bbox',
options: {
column: 'the_geom_webmercator',
srid: 3857
},
params: {
bbox: params.bbox
}
};
queryRewriteData = _.extend(queryRewriteData, { bbox_filter: bbox_filter_definition });
}
return queryRewriteData;