Use tree.Zoom.all instead custom constant

This commit is contained in:
IagoLast 2017-08-21 17:38:42 +02:00
parent fef8cb369f
commit 55c0786130

View File

@ -209,14 +209,13 @@ tree.Definition.prototype.toXML = function(env, existing) {
}; };
tree.Definition.prototype.toJS = function(env) { tree.Definition.prototype.toJS = function(env) {
var DEFAULT_ZOOM_VALUE = 8388607;
var shaderAttrs = {}; var shaderAttrs = {};
var frame_offset = this.frame_offset; var frame_offset = this.frame_offset;
var zoomFilter = "(" + this.zoom + " & (1 << ctx.zoom))"; var zoomFilter = "(" + this.zoom + " & (1 << ctx.zoom))";
var filters = [zoomFilter]; var filters = [zoomFilter];
var originalFilters = this.filters.toJS(env); var originalFilters = this.filters.toJS(env);
// Ignore default zoom for filtering (https://github.com/CartoDB/carto/issues/40) // Ignore default zoom for filtering (https://github.com/CartoDB/carto/issues/40)
var zoomFiltered = this.zoom !== DEFAULT_ZOOM_VALUE; var zoomFiltered = this.zoom !== tree.Zoom.all;
if (originalFilters) { if (originalFilters) {
filters.push(originalFilters); filters.push(originalFilters);