From 4b562e6768f48e5e2621ae36180ce95f48026f20 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 31 May 2017 13:00:37 -0400 Subject: [PATCH] Merge conditions --- lib/cartodb/backends/dataview.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index d4c40f79..a77ba585 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -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;