Fix feature highlighting
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-04-16 13:19:06 +02:00
parent 9fbc946c68
commit d34a2069d6
14 changed files with 101 additions and 79 deletions

View File

@@ -1,4 +1,4 @@
import { Component, Input, Injectable,Directive } from '@angular/core';
import { Component, Input, Injectable,Directive,SimpleChanges } from '@angular/core';
import { Location } from '@angular/common';
import { Feature } from 'ol';
import { Store } from '@ngrx/store';
@@ -16,6 +16,7 @@ import { IQueryState } from '@farmmaps/common';
export abstract class AbstractFeatureListComponent {
@Input() features: Array<Feature>;
@Input() queryState: IQueryState;
@Input() selectedFeature: Feature;
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService, private location: Location) {
}
@@ -37,6 +38,11 @@ export abstract class AbstractFeatureListComponent {
event.preventDefault();
this.location.back();
}
isFeatureSelected(feature:Feature):boolean {
if(!this.selectedFeature) return false;
return feature.getId() == this.selectedFeature.getId();
}
}
@Injectable()