Use default style function in FeatureOverlay

This commit is contained in:
Éric Lemoine
2014-03-10 11:32:36 +01:00
parent 8c9d22c5e5
commit 6047a4dcf6

View File

@@ -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;
}