From 5fc04a060d67cf0930bb397fb114a74e93e94feb Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Tue, 14 Jun 2016 14:10:35 -0700 Subject: [PATCH] Use linear interpolation for rotated icons --- js/data/bucket/symbol_bucket.js | 2 ++ js/style/style_layer.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/js/data/bucket/symbol_bucket.js b/js/data/bucket/symbol_bucket.js index 0b31a53c9a3..b708184ac48 100644 --- a/js/data/bucket/symbol_bucket.js +++ b/js/data/bucket/symbol_bucket.js @@ -235,6 +235,8 @@ SymbolBucket.prototype.populateBuffers = function(collisionTile, stacks, icons) } if (image.pixelRatio !== 1) { this.iconsNeedLinear = true; + } else if (layout['icon-rotate'] !== 0 || !this.layer.isLayoutValueFeatureConstant('icon-rotate')) { + this.iconsNeedLinear = true; } } } else { diff --git a/js/style/style_layer.js b/js/style/style_layer.js index 404f16edd6c..95722527740 100644 --- a/js/style/style_layer.js +++ b/js/style/style_layer.js @@ -193,6 +193,16 @@ StyleLayer.prototype = util.inherit(Evented, { } }, + isLayoutValueFeatureConstant: function(name) { + var declaration = this._layoutDeclarations[name]; + + if (declaration) { + return declaration.isFeatureConstant; + } else { + return true; + } + }, + isPaintValueZoomConstant: function(name) { var transition = this._paintTransitions[name];