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

This commit is contained in:
Willem Dantuma
2020-04-16 15:47:15 +02:00
parent d34a2069d6
commit 3e0cf6d691
7 changed files with 50 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import {IQueryState } from '@farmmaps/common';
import * as mapReducers from '../../reducers/map.reducer';
import * as mapActions from '../../actions/map.actions';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
@Component({
@@ -21,6 +22,7 @@ export class FeatureListContainerComponent {
@Input() features: Array<Feature>
@Input() queryState: IQueryState;
@Input() selectedFeature: Feature;
@Input() clickedFeature:Observable<Feature>;
@ViewChild(WidgetHostDirective, { static: true }) widgetHost: WidgetHostDirective;
componentRef:any;
@@ -52,6 +54,12 @@ export class FeatureListContainerComponent {
(<AbstractFeatureListComponent>this.componentRef.instance).selectedFeature = this.selectedFeature;
}
ngOnInit() {
this.clickedFeature.subscribe((feature => {
(<AbstractFeatureListComponent>this.componentRef.instance).handleFeatureClick(feature);
}));
}
ngOnChanges(changes: SimpleChanges) {
if ((changes["features"] && changes["features"].currentValue)) {
if (this.queryState) {