Added parentitem title to geotiff, shape and temporal selected-item components.
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit

This commit is contained in:
2020-07-15 23:15:31 +02:00
parent 0f5a5251db
commit c0f689331e
10 changed files with 117 additions and 90 deletions

View File

@@ -60,7 +60,7 @@ export class MapEffects {
anchor: [0.5, 1],
scale: 0.05,
src: this.featureIconService$.getIconImageDataUrl("fa fa-file-o")
}),
}),
stroke: new style.Stroke({
color: 'red',
width: 1
@@ -82,7 +82,7 @@ export class MapEffects {
fill: new style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
})));
})));
return actions;
}
@@ -116,7 +116,7 @@ export class MapEffects {
switchMap(([action,setStateCount]) => {
let a = action as mapActions.StartSearch;
var startDate = a.queryState.startDate;
var endDate = a.queryState.endDate;
var endDate = a.queryState.endDate;
var newAction:Observable<Action>;
if (a.queryState.itemCode || a.queryState.parentCode || a.queryState.itemType || a.queryState.query || a.queryState.tags) {
newAction= this.itemService$.getFeatures(a.queryState.bbox, "EPSG:3857", a.queryState.query, a.queryState.tags, startDate, endDate, a.queryState.itemType, a.queryState.parentCode).pipe(
@@ -132,7 +132,7 @@ export class MapEffects {
catchError(error => of(new commonActions.Fail(error))));
} else {
return [];
}
}
return newAction;
}));
@@ -145,12 +145,12 @@ export class MapEffects {
let actions =[];
actions.push(new commonActions.SetMenuVisible(false));
let extent = createEmpty();
if (!action.query.bboxFilter) {
if (!action.query.bboxFilter) {
if (extent) {
for (let f of action.features) {
extend(extent, (f as Feature).getGeometry().getExtent());
}
}
}
actions.push(new mapActions.SetExtent(extent));
}
return actions;
@@ -173,7 +173,14 @@ export class MapEffects {
let itemCode = selectedItem ? selectedItem.code : "";
if (a.itemCode != itemCode || setStateCount == 1) {
return this.itemService$.getItem(a.itemCode).pipe(
map((item: IItem) => new mapActions.SelectItemSuccess(item)),
switchMap(child => {
return this.itemService$.getItem(child.parentCode)
.pipe(map(parent => {
return {child, parent};
})
);
}),
map(data => new mapActions.SelectItemSuccess(data.child, data.parent)),
catchError(error => of(new commonActions.Fail(error))))
} else {
return [];
@@ -202,14 +209,14 @@ export class MapEffects {
if(action.item.itemType == "vnd.farmmaps.itemtype.temporal") {
return this.itemService$.getChildItemList(action.item.code,null).pipe(
map(items => new mapActions.SelectTemporalItemsSuccess(
items.sort((a, b) =>
items.sort((a, b) =>
-(Date.parse(b.dataDate) - Date.parse(a.dataDate))
)
)),
catchError(error => of(new commonActions.Fail(error))));
} else {
return [];
}
}
}
));
@@ -231,9 +238,9 @@ export class MapEffects {
feature = f;
break;
}
}
}
if (feature) {
return of(new mapActions.UpdateFeatureSuccess(this.toPointFeature(deviceUpdateEventAction)));
return of(new mapActions.UpdateFeatureSuccess(this.toPointFeature(deviceUpdateEventAction)));
} else {
return [];
}
@@ -244,10 +251,17 @@ export class MapEffects {
ofType(commonActions.ITEMCHANGEDEVENT),
withLatestFrom(this.store$.select(mapReducers.selectGetSelectedItem)),
mergeMap(([action, selectedItem]) => {
let itemChangedAction = action as commonActions.ItemChangedEvent;
let itemChangedAction = action as commonActions.ItemChangedEvent;
if (selectedItem && selectedItem.code == itemChangedAction.itemCode) {
return this.itemService$.getItem(itemChangedAction.itemCode).pipe(
map((item: IItem) => new mapActions.SelectItemSuccess(item)),
switchMap(child => {
return this.itemService$.getItem(child.parentCode)
.pipe(map(parent => {
return {child, parent};
})
);
}),
map(data => new mapActions.SelectItemSuccess(data.child, data.parent)),
catchError(error => of(new commonActions.Fail(error))));
} else {
return [];
@@ -256,17 +270,17 @@ export class MapEffects {
getActionFromQueryState(queryState:IQueryState, inSearch:boolean):Observable<Action>|[] {
if(!inSearch && (queryState.itemType || queryState.parentCode || queryState.itemCode || queryState.query || queryState.tags)) {
var newAction:Action;
if (queryState.itemCode && queryState.itemCode != "") {
newAction= new mapActions.SelectItem(queryState.itemCode);
var newAction:Action;
if (queryState.itemCode && queryState.itemCode != "") {
newAction= new mapActions.SelectItem(queryState.itemCode);
} else {
newAction= new mapActions.StartSearch(queryState);
}
return of(newAction);
return of(newAction);
} else {
return of(new commonActions.Escape(true,false));
}
}
}
@Effect()
setQueryState$: Observable<Action> = this.actions$.pipe(