More type fixes
This commit is contained in:
parent
160eb10aba
commit
5d21d66589
@ -57,7 +57,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
|
||||
getSelectedStyle(feature:Feature<Geometry>):style.Style {
|
||||
let key = feature.get('itemType')+"_selected";
|
||||
let evaluatedStyle: style.Style | (Feature<Geometry>) =undefined;
|
||||
let evaluatedStyle: style.Style =undefined;
|
||||
var styleEntry = this.stylesCache[key];
|
||||
if(styleEntry) {
|
||||
if(typeof styleEntry === 'function') {
|
||||
@ -66,10 +66,10 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
evaluatedStyle = styleEntry;
|
||||
}
|
||||
} else {
|
||||
evaluatedStyle = this.stylesCache["selected"];
|
||||
evaluatedStyle = this.stylesCache["selected"] as style.Style;
|
||||
}
|
||||
if(evaluatedStyle ) {
|
||||
evaluatedStyle.setGeometry((feature) => this.geometry(feature));
|
||||
evaluatedStyle .setGeometry((feature:Feature<Geometry>) => this.geometry(feature));
|
||||
}
|
||||
return evaluatedStyle as style.Style
|
||||
}
|
||||
|
@ -3,5 +3,5 @@ import { Style } from 'ol/style';
|
||||
import {Geometry } from 'ol/geom';
|
||||
|
||||
export interface IStyles{
|
||||
[id: string]: Style | (Feature<Geometry>);
|
||||
[id: string]: Style | ((featue:Feature<Geometry>) => Style);
|
||||
};
|
Loading…
Reference in New Issue
Block a user