From 6be3b66e8e16b894a3a5c1da4c6ca65d1475c7c8 Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 22 Apr 2019 12:23:13 +0300 Subject: [PATCH] GeoJSON._setLayerStyle: call style function only if layer has setStyle method --- src/layer/GeoJSON.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layer/GeoJSON.js b/src/layer/GeoJSON.js index 8d3f7830691..2efe7b4bd17 100644 --- a/src/layer/GeoJSON.js +++ b/src/layer/GeoJSON.js @@ -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); } }