From 4e53803b3b3699926244724d550f16d4e8c7cb4f Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 31 May 2017 12:51:07 -0400 Subject: [PATCH] Create BBoxFilter independently from rewrite data --- lib/cartodb/backends/dataview.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index e0515efe..f2e9c7df 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -43,6 +43,12 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param ownFilter = !!ownFilter; var query = (ownFilter) ? dataviewDefinition.sql.own_filter_on : dataviewDefinition.sql.own_filter_off; + var bboxFilter = null; + if (params.bbox) { + bboxFilter = new BBoxFilter({column: 'the_geom_webmercator', srid: 3857}, {bbox: params.bbox}); + query = bboxFilter.sql(query); + } + var sourceId = dataviewDefinition.source.id; // node.id var layer = _.find(mapConfig.obj().layers, function(l) { return l.options.source && (l.options.source.id === sourceId); @@ -56,8 +62,6 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param } if (params.bbox) { - var bboxFilter = new BBoxFilter({column: 'the_geom_webmercator', srid: 3857}, {bbox: params.bbox}); - query = bboxFilter.sql(query); if ( queryRewriteData ) { var bbox_filter_definition = { type: 'bbox',