Make ol.style.Style a @struct
And take into account that `styles` may be a style or an array of style.
This commit is contained in:
@@ -2390,10 +2390,10 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
|
|||||||
// FIXME the styles returned by the style function are supposed to be
|
// FIXME the styles returned by the style function are supposed to be
|
||||||
// resolution-independent here
|
// resolution-independent here
|
||||||
var styles = styleFunction.call(feature, 0);
|
var styles = styleFunction.call(feature, 0);
|
||||||
if (styles && styles.length > 0) {
|
if (styles) {
|
||||||
var style = styles[0];
|
var style = goog.isArray(styles) ? styles[0] : styles;
|
||||||
if (this.writeStyles_) {
|
if (this.writeStyles_) {
|
||||||
properties['Style'] = styles[0];
|
properties['Style'] = style;
|
||||||
}
|
}
|
||||||
var textStyle = style.getText();
|
var textStyle = style.getText();
|
||||||
if (textStyle) {
|
if (textStyle) {
|
||||||
|
|||||||
@@ -264,6 +264,9 @@ ol.source.ImageVector.prototype.renderFeature_ = function(feature, resolution, p
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var i, ii, loading = false;
|
var i, ii, loading = false;
|
||||||
|
if (!goog.isArray(styles)) {
|
||||||
|
styles = [styles];
|
||||||
|
}
|
||||||
for (i = 0, ii = styles.length; i < ii; ++i) {
|
for (i = 0, ii = styles.length; i < ii; ++i) {
|
||||||
loading = ol.renderer.vector.renderFeature(
|
loading = ol.renderer.vector.renderFeature(
|
||||||
replayGroup, feature, styles[i],
|
replayGroup, feature, styles[i],
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ goog.require('ol.style.Stroke');
|
|||||||
* feature or layer that uses the style is re-rendered.
|
* feature or layer that uses the style is re-rendered.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
|
* @struct
|
||||||
* @param {olx.style.StyleOptions=} opt_options Style options.
|
* @param {olx.style.StyleOptions=} opt_options Style options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user