Fix style
This commit is contained in:
parent
4dfa2cd96c
commit
d57ffe59e7
@ -68,7 +68,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
} else {
|
||||
evaluatedStyle = this.stylesCache["selected"];
|
||||
}
|
||||
if(evaluatedStyle && evaluatedStyle.geometry_ == null) {
|
||||
if(evaluatedStyle ) {
|
||||
evaluatedStyle.setGeometry((feature) => this.geometry(feature));
|
||||
}
|
||||
return evaluatedStyle
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, OnDestroy, HostListener, ViewChild, AfterViewInit,NgZone } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { Observable, Subject, Subscription, from,of } from 'rxjs';
|
||||
import { withLatestFrom, switchMap } from 'rxjs/operators';
|
||||
import { withLatestFrom, switchMap,skip } from 'rxjs/operators';
|
||||
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
//import { proj,Map } from 'openlayers';
|
||||
@ -93,33 +93,31 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
private geolocationService: GeolocationService,
|
||||
private zone: NgZone,
|
||||
private deviceorientationService:DeviceOrientationService) {
|
||||
this.querySub = this.query$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{
|
||||
this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{
|
||||
if(queryState) {
|
||||
let newQueryState = tassign(mapReducers.initialQueryState);
|
||||
let initial = this.serializeService.serialize(newQueryState) == this.serializeService.serialize(queryState);
|
||||
if(setStateCount>1 && !initial) {
|
||||
console.debug(`Do Query ${setStateCount}`);
|
||||
let urlparts=[];
|
||||
if (queryState.itemCode && queryState.itemCode != "") {
|
||||
if(queryState.itemType && queryState.itemType!= "") {
|
||||
let itemType = this.itemTypeService.itemTypes[queryState.itemType];
|
||||
if (itemType && itemType.viewer && itemType.viewer == "edit_in_editor" && itemType.editor) {
|
||||
urlparts.push('/editor');
|
||||
urlparts.push(itemType.editor);
|
||||
urlparts.push('item');
|
||||
urlparts.push(queryState.itemCode);
|
||||
}
|
||||
console.debug(`Do Query ${setStateCount}`);
|
||||
let urlparts=[];
|
||||
if (queryState.itemCode && queryState.itemCode != "") {
|
||||
if(queryState.itemType && queryState.itemType!= "") {
|
||||
let itemType = this.itemTypeService.itemTypes[queryState.itemType];
|
||||
if (itemType && itemType.viewer && itemType.viewer == "edit_in_editor" && itemType.editor) {
|
||||
urlparts.push('/editor');
|
||||
urlparts.push(itemType.editor);
|
||||
urlparts.push('item');
|
||||
urlparts.push(queryState.itemCode);
|
||||
}
|
||||
} else {
|
||||
newQueryState= queryState;
|
||||
}
|
||||
if(urlparts.length==0 ) {
|
||||
newQueryState.itemCode = queryState.itemCode;
|
||||
} else {
|
||||
newQueryState= queryState;
|
||||
}
|
||||
if(urlparts.length==0 ) {
|
||||
newQueryState.itemCode = queryState.itemCode;
|
||||
this.zone.run(() => {
|
||||
this.store.dispatch(new mapActions.SetQueryState(newQueryState,false));
|
||||
//this.replaceUrl(mapState,newQueryState,false);
|
||||
} else {
|
||||
this.router.navigate(urlparts);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.router.navigate(urlparts);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -261,8 +259,10 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
} return of(new mapActions.SetReplaceUrl(true));
|
||||
})).subscribe((action) => {
|
||||
if(action) {
|
||||
console.debug("Url to state");
|
||||
this.store.dispatch(action);
|
||||
this.zone.run(() => {
|
||||
console.debug("Url to state");
|
||||
this.store.dispatch(action);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -220,21 +220,6 @@ export class MapEffects {
|
||||
switchMap((action: commonActions.UploadedFileClick) => of(new mapActions.DoQuery(tassign(mapReducers.initialState.query, {itemCode:action.itemCode})))
|
||||
));
|
||||
|
||||
//@Effect()
|
||||
//itemAdded$: Observable<Action> = this.actions$.pipe(
|
||||
// ofType(commonActions.ITEMADDEDEVENT),
|
||||
// withLatestFrom(this.store$.select(mapReducers.selectGetParentCode)),
|
||||
// mergeMap(([action, parentCode]) => {
|
||||
// let itemAddedAction = action as commonActions.ItemAddedEvent;
|
||||
// if (parentCode && itemAddedAction.attributes["parentCode"] == parentCode) {
|
||||
// return this.itemService$.getFeature(itemAddedAction.itemCode,"EPSG:3857").pipe(
|
||||
// map((feature: Feature) => new mapActions.AddFeatureSuccess(this.toPointFeature(feature))),
|
||||
// catchError(error => of(new commonActions.Fail(error))))
|
||||
// } else
|
||||
// return [
|
||||
// ];
|
||||
// }));
|
||||
|
||||
@Effect()
|
||||
featureUpdate$: Observable<Action> = this.actions$.pipe(
|
||||
ofType(commonActions.DEVICEUPDATEEVENT),
|
||||
|
Loading…
Reference in New Issue
Block a user