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

@@ -2,12 +2,13 @@ import { Component, Injectable } from '@angular/core';
import { Location } from '@angular/common';
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
import { ForItemType } from '../for-item/for-itemtype.decorator';
import { Store } from '@ngrx/store';
import { Store,Action } from '@ngrx/store';
import * as mapReducers from '../../reducers/map.reducer';
import { commonReducers, ItemTypeService } from '@farmmaps/common';
import * as mapActions from '../../actions/map.actions';
import { tassign } from 'tassign';
import { Router } from '@angular/router';
import { Feature } from 'ol';
@ForItemType("vnd.farmmaps.itemtype.croppingscheme")
@Injectable()
@@ -22,8 +23,8 @@ export class FeatureListCroppingschemeComponent extends AbstractFeatureListCompo
super(store, itemTypeService, location);
}
handleFeatureClick(feature) {
getAction(feature:Feature):Action {
var queryState = tassign(mapReducers.initialState.queryState, { parentCode: feature.get('code'), itemType: "vnd.farmmaps.itemtype.cropfield" });
this.store.dispatch(new mapActions.DoQuery(queryState));
return new mapActions.DoQuery(queryState);
}
}