Skip to content
Snippets Groups Projects
Commit f51b3253 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

restrict opacity form to polygon & adapt default data value to prop type

parent d569c62b
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
:name="form.color.html_name" :name="form.color.html_name"
> >
</div> </div>
<div> <div v-if="geomType === 'polygon'">
<label>Opacité &nbsp;<span>(%)</span></label> <label>Opacité &nbsp;<span>(%)</span></label>
<div class="range-container"> <div class="range-container">
<input <input
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
html_name: 'couleur', html_name: 'couleur',
value: '#000000', value: '#000000',
}, },
opacity: 1, opacity: '0.5',
} }
}; };
}, },
......
...@@ -99,10 +99,7 @@ ...@@ -99,10 +99,7 @@
feature_type.colors_style.value.icons[option] : feature_type.colors_style.value.icons[option] :
null null
" "
:init-opacity="feature_type.colors_style.value ? :init-opacity="getOpacity(feature_type, option)"
feature_type.colors_style.value.opacities[option] :
null
"
:geom-type="feature_type.customfield_set.geomType" :geom-type="feature_type.customfield_set.geomType"
@set="setColorsStyle" @set="setColorsStyle"
/> />
...@@ -306,6 +303,13 @@ export default { ...@@ -306,6 +303,13 @@ export default {
console.error(err); console.error(err);
this.loading = false; this.loading = false;
}); });
},
getOpacity(feature_type, optionName) {
if (feature_type.colors_style.value && feature_type.colors_style.value.opacities) {
return feature_type.colors_style.value.opacities[optionName];
}
return null;
} }
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment