Skip to content

Commit

Permalink
Fix test-suite failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Aug 24, 2016
1 parent 4bea8b6 commit 74b1466
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/style/style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ StyleLayer.prototype = util.inherit(Evented, {
if (this.maxzoom && zoom >= this.maxzoom) return true;
if (this.layout['visibility'] === 'none') return true;
if (this.isPaintValueFeatureConstant(this.type + '-opacity') && this.paint[this.type + '-opacity'] === 0) return true;
if (this.isPaintValueFeatureConstant(this.type + '-color') && this.paint[this.type + '-color'][3] === 0) return true;
if (this.isPaintValueFeatureConstant(this.type + '-color') && this.paint[this.type + '-color'] && this.paint[this.type + '-color'][3] === 0) return true;

return false;
},
Expand Down
18 changes: 18 additions & 0 deletions js/style/style_layer/fill_style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ FillStyleLayer.prototype = util.inherit(StyleLayer, {
} else {
return StyleLayer.prototype.isPaintValueZoomConstant.call(this, name);
}
},

isHidden: function() {
if (this.minzoom && zoom < this.minzoom) return true;
if (this.maxzoom && zoom >= this.maxzoom) return true;
if (this.layout['visibility'] === 'none') return true;

var isFillHidden = (
(this.isPaintValueFeatureConstant('fill-opacity') && this.paint['fill-opacity'] === 0) ||
(this.isPaintValueFeatureConstant('fill-color') && this.paint['fill-color'][3] === 0)
);

var isOutlineHidden = (
this.isPaintValueFeatureConstant('fill-outline-color') &&
this.paint['fill-outline-color'][3] === 0
);

return isFillHidden && isOutlineHidden;
}

});
Expand Down

0 comments on commit 74b1466

Please sign in to comment.