diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index bea41bfa4..79a4a5190 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -86,12 +86,12 @@ export default Property.extend({ }, __getFromStyle(style = {}) { - let result = {}; + let result = style; const fromStyle = this.get('fromStyle'); if (fromStyle) { result = fromStyle(style); - } else if (!this.isDetached()) { + } else { const name = this.getName(); const value = style[name]; if (value) { @@ -104,9 +104,11 @@ export default Property.extend({ const value = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)]; result[prop.getId()] = value || ''; }); + result = { + ...style, + ...result, + }; } - } else { - result = style; } return result; diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index ad0e31f51..28dae473b 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -105,6 +105,12 @@ export default Property.extend({ return parseFn ? parseFn({ value, values }) : values; }, + __getFromStyle(style = {}) { + const fromStyle = this.get('fromStyle'); + + return fromStyle ? fromStyle(style) : style; + }, + /** * Add new layer to the stack * @param {Object} [props={}] Layer props