Some refactoring

This commit is contained in:
Willem Dantuma
2020-02-27 16:28:10 +01:00
parent 795e8fdf0e
commit 3094170cc2
3 changed files with 198 additions and 144 deletions

View File

@@ -1,6 +1,6 @@
import { tassign } from 'tassign';
import { IItem,Item } from '@farmmaps/common';
import { IItemLayer,ItemLayer} from '../models/item.layer';
import { IItemLayer,ItemLayer,TemporalItemLayer} from '../models/item.layer';
import { IMapState} from '../models/map.state';
import { IQueryState} from '@farmmaps/common';
import { IPeriodState} from '../models/period.state';
@@ -164,6 +164,8 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
var itemLayer = null;
if (a.item && "vnd.farmmaps.itemtype.layer,vnd.farmmaps.itemtype.shape.processed,vnd.farmmaps.itemtype.geotiff.processed".indexOf(a.item.itemType) >=0 ) {
itemLayer = new ItemLayer(a.item);
} else if (a.item && a.item.itemType == "vnd.farmmaps.itemtype.temporal") {
itemLayer = new TemporalItemLayer(a.item);
}
return tassign(state, {
selectedItem: a.item,