diff --git a/src/ol/featureoverlay.js b/src/ol/featureoverlay.js index 84df05262a..ade310c5c9 100644 --- a/src/ol/featureoverlay.js +++ b/src/ol/featureoverlay.js @@ -144,14 +144,18 @@ ol.FeatureOverlay.prototype.handleFeaturesRemove_ = * @private */ ol.FeatureOverlay.prototype.handleMapPostCompose_ = function(event) { - if (goog.isNull(this.features_) || !goog.isDef(this.styleFunction_)) { + if (goog.isNull(this.features_)) { return; } + var styleFunction = this.styleFunction_; + if (!goog.isDef(styleFunction)) { + styleFunction = ol.feature.defaultStyleFunction; + } var resolution = event.frameState.view2DState.resolution; var vectorContext = event.vectorContext; var i, ii, feature, styles; this.features_.forEach(function(feature) { - styles = this.styleFunction_(feature, resolution); + styles = styleFunction(feature, resolution); if (!goog.isDefAndNotNull(styles)) { return; }