diff --git a/src/style_manager/model/Layers.js b/src/style_manager/model/Layers.js index 2d47c94a1..ccc2b7f27 100644 --- a/src/style_manager/model/Layers.js +++ b/src/style_manager/model/Layers.js @@ -1,3 +1,4 @@ +import { isUndefined } from 'underscore'; import Backbone from 'backbone'; import Layer from './Layer'; @@ -110,11 +111,13 @@ export default Backbone.Collection.extend({ return result.join(this.getSeparator()); }, - getPropertyValues(property) { + getPropertyValues(property, defValue) { const result = []; this.each(layer => { const value = layer.getPropertyValue(property); - value && result.push(value); + value + ? result.push(value) + : !isUndefined(defValue) && result.push(defValue); }); return result.join(', '); } diff --git a/src/style_manager/view/PropertyStackView.js b/src/style_manager/view/PropertyStackView.js index b8db0cfde..9481df9c4 100644 --- a/src/style_manager/view/PropertyStackView.js +++ b/src/style_manager/view/PropertyStackView.js @@ -277,7 +277,8 @@ export default PropertyCompositeView.extend({ if (model.get('detached')) { const subProp = subModel.get('property'); - const values = self.getLayers().getPropertyValues(subProp); + const defVal = subModel.getDefaultValue(); + const values = self.getLayers().getPropertyValues(subProp, defVal); view.updateTargetStyle(values, null, opt); } else { // Update only if there is an actual update (to avoid changes for computed styles)