Fix feature highlighting
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user