Skip to content

Commit

Permalink
don't do anything on noop setPaintProperty
Browse files Browse the repository at this point in the history
Closes #2362
  • Loading branch information
mourner committed Mar 30, 2016
1 parent 5ed1cb5 commit 3e443c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/style/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,11 @@ Style.prototype = util.inherit(Evented, {
setPaintProperty: function(layerId, name, value, klass) {
this._checkLoaded();

this.getLayer(layerId).setPaintProperty(name, value, klass);
var layer = this.getLayer(layerId);

if (layer.getPaintProperty(name, klass) === value) return this;

layer.setPaintProperty(name, value, klass);
this._updates.changed = true;
this._updates.cascade = true;

Expand Down

0 comments on commit 3e443c7

Please sign in to comment.