diff --git a/src/ol/interaction/drawinteraction.js b/src/ol/interaction/drawinteraction.js index b1bef46f70..96df0f93a3 100644 --- a/src/ol/interaction/drawinteraction.js +++ b/src/ol/interaction/drawinteraction.js @@ -148,18 +148,16 @@ ol.interaction.Draw = function(opt_options) { */ this.overlay_ = new ol.render.FeaturesOverlay(); this.overlay_.setStyleFunction(goog.isDef(opt_options.styleFunction) ? - opt_options.styleFunction : ol.interaction.Draw.defaultStyleFunction + opt_options.styleFunction : ol.interaction.Draw.getDefaultStyleFunction() ); }; goog.inherits(ol.interaction.Draw, ol.interaction.Interaction); /** - * @param {ol.Feature} feature Feature. - * @param {number} resolution Resolution. - * @return {Array.} Styles. + * @return {ol.feature.StyleFunction} Styles. */ -ol.interaction.Draw.defaultStyleFunction = (function() { +ol.interaction.Draw.getDefaultStyleFunction = function() { /** @type {Object.>} */ var styles = {}; styles[ol.geom.GeometryType.POLYGON] = [ @@ -210,7 +208,7 @@ ol.interaction.Draw.defaultStyleFunction = (function() { return function(feature, resolution) { return styles[feature.getGeometry().getType()]; }; -})(); +}; /**