Fix selected style
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
79f45631a0
commit
52b4f90b78
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user