Fix style

This commit is contained in:
Willem Dantuma 2020-04-22 12:16:03 +02:00
parent 4dfa2cd96c
commit d57ffe59e7
3 changed files with 30 additions and 45 deletions

View File

@ -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

View File

@ -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,11 +93,9 @@ 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 != "") {
@ -115,13 +113,13 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
}
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);
}
}
}
});
}
@ -261,8 +259,10 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
} return of(new mapActions.SetReplaceUrl(true));
})).subscribe((action) => {
if(action) {
this.zone.run(() => {
console.debug("Url to state");
this.store.dispatch(action);
});
}
});

View File

@ -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),