diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index a8eebea2a7..ec3bf42826 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -2390,10 +2390,10 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) { // FIXME the styles returned by the style function are supposed to be // resolution-independent here var styles = styleFunction.call(feature, 0); - if (styles && styles.length > 0) { - var style = styles[0]; + if (styles) { + var style = goog.isArray(styles) ? styles[0] : styles; if (this.writeStyles_) { - properties['Style'] = styles[0]; + properties['Style'] = style; } var textStyle = style.getText(); if (textStyle) { diff --git a/src/ol/source/imagevectorsource.js b/src/ol/source/imagevectorsource.js index a9ed188db1..97c02e34d6 100644 --- a/src/ol/source/imagevectorsource.js +++ b/src/ol/source/imagevectorsource.js @@ -264,6 +264,9 @@ ol.source.ImageVector.prototype.renderFeature_ = function(feature, resolution, p return false; } var i, ii, loading = false; + if (!goog.isArray(styles)) { + styles = [styles]; + } for (i = 0, ii = styles.length; i < ii; ++i) { loading = ol.renderer.vector.renderFeature( replayGroup, feature, styles[i], diff --git a/src/ol/style/style.js b/src/ol/style/style.js index 7ee8039d08..1e037366ef 100644 --- a/src/ol/style/style.js +++ b/src/ol/style/style.js @@ -19,6 +19,7 @@ goog.require('ol.style.Stroke'); * feature or layer that uses the style is re-rendered. * * @constructor + * @struct * @param {olx.style.StyleOptions=} opt_options Style options. * @api */