Fix click on feature
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,7 +1,7 @@
|
||||
import { Component, Input, Injectable,Directive,SimpleChanges } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { Feature } from 'ol';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Store,Action} from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers,ItemTypeService, IItem, Item } from '@farmmaps/common';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
@@ -21,9 +21,16 @@ export abstract class AbstractFeatureListComponent {
|
||||
}
|
||||
|
||||
handleFeatureClick(feature:Feature) {
|
||||
var newQuery: any = tassign(mapReducers.initialState.query);
|
||||
newQuery.itemCode = feature.get('code');
|
||||
this.store.dispatch(new mapActions.DoQuery(newQuery));
|
||||
if(feature) {
|
||||
let action = this.getAction(feature);
|
||||
this.store.dispatch(action);
|
||||
}
|
||||
}
|
||||
|
||||
getAction(feature:Feature):Action {
|
||||
var newQuery: any = tassign(mapReducers.initialState.query);
|
||||
newQuery.itemCode = feature.get('code');
|
||||
return new mapActions.DoQuery(newQuery)
|
||||
}
|
||||
|
||||
handleFeatureMouseEnter(feature) {
|
||||
|
Reference in New Issue
Block a user