Skip to content

Commit

Permalink
GeoJSON._setLayerStyle: call style function only if layer has setStyl…
Browse files Browse the repository at this point in the history
…e method (#6616)
  • Loading branch information
johnd0e authored and IvanSanchez committed Apr 22, 2019
1 parent db15ee8 commit 61e49ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/layer/GeoJSON.js
Expand Up @@ -145,10 +145,10 @@ export var GeoJSON = FeatureGroup.extend({
},

_setLayerStyle: function (layer, style) {
if (typeof style === 'function') {
style = style(layer.feature);
}
if (layer.setStyle) {
if (typeof style === 'function') {
style = style(layer.feature);
}
layer.setStyle(style);
}
}
Expand Down

0 comments on commit 61e49ee

Please sign in to comment.