Compare commits
No commits in common. "47f77c2819994b0c1e24ec5caaa674285c11e8e0" and "3094170cc2bdce1bf191b415e5752f50e38438ca" have entirely different histories.
47f77c2819
...
3094170cc2
@ -5,7 +5,6 @@ import { IItemLayer } from '../models/item.layer';
|
|||||||
import { IQueryState } from '@farmmaps/common';
|
import { IQueryState } from '@farmmaps/common';
|
||||||
import { IItem } from '@farmmaps/common';
|
import { IItem } from '@farmmaps/common';
|
||||||
import { Feature,Style } from 'ol';
|
import { Feature,Style } from 'ol';
|
||||||
import { IListItem } from 'dist/common/public-api';
|
|
||||||
|
|
||||||
export const SETSTATE = '[Map] SetState';
|
export const SETSTATE = '[Map] SetState';
|
||||||
export const SETMAPSTATE = '[Map] MapState';
|
export const SETMAPSTATE = '[Map] MapState';
|
||||||
@ -17,7 +16,6 @@ export const STARTSEARCHSUCCESS = '[Map] StartSearchSuccess';
|
|||||||
export const SELECTFEATURE = '[Map] SelectFeature';
|
export const SELECTFEATURE = '[Map] SelectFeature';
|
||||||
export const SELECTITEM = '[Map] SelectItem';
|
export const SELECTITEM = '[Map] SelectItem';
|
||||||
export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess';
|
export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess';
|
||||||
export const SELECTTEMPORALITEMSSUCCESS = '[Map] SelectTemporalItemsSuccess';
|
|
||||||
export const ADDFEATURESUCCESS = '[Map] AddFeatureSuccess';
|
export const ADDFEATURESUCCESS = '[Map] AddFeatureSuccess';
|
||||||
export const UPDATEFEATURESUCCESS = '[Map] UpdateFeatureSuccess';
|
export const UPDATEFEATURESUCCESS = '[Map] UpdateFeatureSuccess';
|
||||||
export const EXPANDSEARCH = '[Map] ExpandSearch';
|
export const EXPANDSEARCH = '[Map] ExpandSearch';
|
||||||
@ -99,12 +97,6 @@ export class SelectItemSuccess implements Action {
|
|||||||
constructor(public item: IItem) { }
|
constructor(public item: IItem) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SelectTemporalItemsSuccess implements Action {
|
|
||||||
readonly type = SELECTTEMPORALITEMSSUCCESS;
|
|
||||||
|
|
||||||
constructor(public temporalItems: IItem[]) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
export class AddFeatureSuccess implements Action {
|
export class AddFeatureSuccess implements Action {
|
||||||
readonly type = ADDFEATURESUCCESS;
|
readonly type = ADDFEATURESUCCESS;
|
||||||
|
|
||||||
@ -232,7 +224,6 @@ export type Actions = SetMapState
|
|||||||
| SelectFeature
|
| SelectFeature
|
||||||
| SelectItem
|
| SelectItem
|
||||||
| SelectItemSuccess
|
| SelectItemSuccess
|
||||||
| SelectTemporalItemsSuccess
|
|
||||||
| AddFeatureSuccess
|
| AddFeatureSuccess
|
||||||
| UpdateFeatureSuccess
|
| UpdateFeatureSuccess
|
||||||
| ExpandSearch
|
| ExpandSearch
|
||||||
|
@ -3,7 +3,7 @@ import { HttpClient } from "@angular/common/http";
|
|||||||
import { LayerVectorComponent, LayerTileComponent, LayerGroupComponent, MapComponent } from 'ngx-openlayers';
|
import { LayerVectorComponent, LayerTileComponent, LayerGroupComponent, MapComponent } from 'ngx-openlayers';
|
||||||
import { ItemService } from '@farmmaps/common';
|
import { ItemService } from '@farmmaps/common';
|
||||||
import { AppConfig } from '@farmmaps/common';
|
import { AppConfig } from '@farmmaps/common';
|
||||||
import { IItemLayer,ItemLayer, ITemporalItemLayer} from '../../../models/item.layer';
|
import { IItemLayer} from '../../../models/item.layer';
|
||||||
import { ILayerData} from '../../../models/layer.data';
|
import { ILayerData} from '../../../models/layer.data';
|
||||||
import { IRenderoutputTiles,IRenderoutputImage,IGradientstop,ILayer,IHistogram} from '../../../models/color.map';
|
import { IRenderoutputTiles,IRenderoutputImage,IGradientstop,ILayer,IHistogram} from '../../../models/color.map';
|
||||||
import {Extent} from 'ol/extent';
|
import {Extent} from 'ol/extent';
|
||||||
@ -227,8 +227,6 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
}
|
}
|
||||||
|
|
||||||
createTemporalLayer(item:IItem,itemLayer:IItemLayer):Layer {
|
createTemporalLayer(item:IItem,itemLayer:IItemLayer):Layer {
|
||||||
let i = itemLayer as ITemporalItemLayer;
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,10 +240,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
} else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.layer') {
|
} else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.layer') {
|
||||||
layer = this.createExternalLayer(itemLayer.item,itemLayer);
|
layer = this.createExternalLayer(itemLayer.item,itemLayer);
|
||||||
} else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.temporal') {
|
} else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.temporal') {
|
||||||
var i = itemLayer as ITemporalItemLayer;
|
layer = this.createTemporalLayer(itemLayer.item,itemLayer);
|
||||||
if(i.selectedItem) {
|
|
||||||
layer = this.createLayer( new ItemLayer(i.selectedItem) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (layer) {
|
if (layer) {
|
||||||
let geometry = new GeoJSON().readGeometry(itemLayer.item.geometry);
|
let geometry = new GeoJSON().readGeometry(itemLayer.item.geometry);
|
||||||
|
@ -172,21 +172,6 @@ export class MapEffects {
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
@Effect()
|
|
||||||
selectItemSuccessTemporal$: Observable<Action> = this.actions$.pipe(
|
|
||||||
ofType(mapActions.SELECTITEMSUCCESS),
|
|
||||||
switchMap((action:mapActions.SelectItemSuccess) => {
|
|
||||||
if(action.item.itemType == "vnd.farmmaps.itemtype.temporal") {
|
|
||||||
return this.itemService$.getChildItemList(action.item.code,null).pipe(
|
|
||||||
map(items => items.sort((a, b) => b.dataDate.getTime() - a.dataDate.getTime())),
|
|
||||||
map((items) => new mapActions.SelectTemporalItemsSuccess(items )),
|
|
||||||
catchError(error => of(new commonActions.Fail(error))));
|
|
||||||
} else {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
));
|
|
||||||
|
|
||||||
@Effect()
|
@Effect()
|
||||||
uploadedItemClick$: Observable<Action> = this.actions$.pipe(
|
uploadedItemClick$: Observable<Action> = this.actions$.pipe(
|
||||||
ofType(commonActions.UPLOADEDFILECLICK),
|
ofType(commonActions.UPLOADEDFILECLICK),
|
||||||
|
@ -27,20 +27,18 @@ export class ItemLayer implements IItemLayer {
|
|||||||
|
|
||||||
export interface ITemporalItemLayer extends IItemLayer {
|
export interface ITemporalItemLayer extends IItemLayer {
|
||||||
previousLayer: Layer
|
previousLayer: Layer
|
||||||
|
selectedLayer: Layer,
|
||||||
nextLayer: Layer
|
nextLayer: Layer
|
||||||
temporalItems: IItem[],
|
temporalItems: IListItem[],
|
||||||
previousItem: IItem,
|
selectedItem: IListItem
|
||||||
selectedItem: IItem,
|
|
||||||
nextItem:IItem
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TemporalItemLayer extends ItemLayer implements ITemporalItemLayer {
|
export class TemporalItemLayer extends ItemLayer implements ITemporalItemLayer {
|
||||||
public previousLayer:Layer = null;
|
public previousLayer:Layer = null;
|
||||||
|
public selectedLayer:Layer = null;
|
||||||
public nextLayer:Layer = null;
|
public nextLayer:Layer = null;
|
||||||
public temporalItems:IItem[] = [];
|
public temporalItems:IListItem[] = [];
|
||||||
public previousItem:IItem = null;
|
public selectedItem:IListItem =null;
|
||||||
public selectedItem:IItem =null;
|
|
||||||
public nextItem:IItem = null;
|
|
||||||
|
|
||||||
constructor(item:IItem) {
|
constructor(item:IItem) {
|
||||||
super(item)
|
super(item)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { tassign } from 'tassign';
|
import { tassign } from 'tassign';
|
||||||
import { IItem,Item } from '@farmmaps/common';
|
import { IItem,Item } from '@farmmaps/common';
|
||||||
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer} from '../models/item.layer';
|
import { IItemLayer,ItemLayer,TemporalItemLayer} from '../models/item.layer';
|
||||||
import { IMapState} from '../models/map.state';
|
import { IMapState} from '../models/map.state';
|
||||||
import { IQueryState} from '@farmmaps/common';
|
import { IQueryState} from '@farmmaps/common';
|
||||||
import { IPeriodState} from '../models/period.state';
|
import { IPeriodState} from '../models/period.state';
|
||||||
@ -177,15 +177,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
|||||||
queryState: tassign(state.queryState, {itemCode:a.item ? a.item.code:null})
|
queryState: tassign(state.queryState, {itemCode:a.item ? a.item.code:null})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
case mapActions.SELECTTEMPORALITEMSSUCCESS:{
|
|
||||||
let a = action as mapActions.SelectTemporalItemsSuccess;
|
|
||||||
let selectedItemLayer=tassign(state.selectedItemLayer) as TemporalItemLayer;
|
|
||||||
selectedItemLayer.temporalItems = a.temporalItems;
|
|
||||||
selectedItemLayer.selectedItem = a.temporalItems.length>0?a.temporalItems[a.temporalItems.length-1]:null;
|
|
||||||
selectedItemLayer.previousItem = a.temporalItems.length>1?a.temporalItems[a.temporalItems.length-2]:null;
|
|
||||||
selectedItemLayer.nextItem = null;
|
|
||||||
return tassign(state,{selectedItemLayer:tassign(state.selectedItemLayer,selectedItemLayer as ItemLayer)});
|
|
||||||
}
|
|
||||||
case mapActions.STARTSEARCH: {
|
case mapActions.STARTSEARCH: {
|
||||||
let a = action as mapActions.StartSearch;
|
let a = action as mapActions.StartSearch;
|
||||||
return tassign(state, {
|
return tassign(state, {
|
||||||
|
@ -77,9 +77,7 @@ export class ItemService {
|
|||||||
|
|
||||||
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true): Observable<IItem[]> {
|
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true): Observable<IItem[]> {
|
||||||
var params = new HttpParams();
|
var params = new HttpParams();
|
||||||
if(itemType != null) {
|
params = params.append("it", itemType);
|
||||||
params = params.append("it", itemType);
|
|
||||||
}
|
|
||||||
if (dataFilter != null) {
|
if (dataFilter != null) {
|
||||||
params = params.append("df", JSON.stringify(dataFilter));
|
params = params.append("df", JSON.stringify(dataFilter));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user