From 80fa0be42f53da5227df18e0070613ef28e29416 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Fri, 27 Jun 2014 12:14:22 +0200 Subject: [PATCH] Use setStyle in the constructor --- src/ol/featureoverlay.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ol/featureoverlay.js b/src/ol/featureoverlay.js index 77e3055274..b9db01bb52 100644 --- a/src/ol/featureoverlay.js +++ b/src/ol/featureoverlay.js @@ -65,14 +65,17 @@ ol.FeatureOverlay = function(opt_options) { * @private * @type {ol.style.Style|Array.|ol.feature.StyleFunction} */ - this.style_ = goog.isDef(options.style) ? options.style : null; + this.style_ = null; /** * @private * @type {ol.feature.StyleFunction|undefined} */ - this.styleFunction_ = goog.isDef(options.style) ? - ol.feature.createStyleFunction(options.style) : undefined; + this.styleFunction_ = undefined; + + if (goog.isDef(options.style)) { + this.setStyle(options.style); + } if (goog.isDef(options.features)) { if (goog.isArray(options.features)) {