diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index 89b811bb..b7bb6d0b 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -139,17 +139,17 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param if (params.bbox) { var bboxFilter = new BBoxFilter({column: 'the_geom', srid: 4326}, {bbox: params.bbox}); query = bboxFilter.sql(query); - var bbox_filter_definition = { - type: 'bbox', - options: { - column: 'the_geom', - srid: 4326, - }, - params: { - bbox: params.bbox - } - }; 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 }); } }