Fix selected style
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2020-02-13 16:51:23 +01:00
parent 79f45631a0
commit 52b4f90b78

View File

@ -56,10 +56,18 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
getSelectedStyle(feature:Feature):style.Style { getSelectedStyle(feature:Feature):style.Style {
let key = feature.get('itemType')+"_selected"; let key = feature.get('itemType')+"_selected";
if(this.stylesCache[key]) { let evaluatedStyle =null;
return this.stylesCache[key]; var styleEntry = this.stylesCache[key];
if(styleEntry) {
if(typeof styleEntry === 'function') {
evaluatedStyle = styleEntry(feature);
} else {
evaluatedStyle = styleEntry;
}
} else {
evaluatedStyle = this.stylesCache["selected"];
} }
return this.stylesCache["selected"]; return evaluatedStyle
} }
ngOnInit() { ngOnInit() {