Fix routes
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-10-31 11:45:03 +01:00
parent cd10165510
commit ab835e904e
3 changed files with 30 additions and 47 deletions

View File

@ -4,30 +4,18 @@ import { MapComponent } from './components/map/map.component';
import { AuthGuard } from '@farmmaps/common'; import { AuthGuard } from '@farmmaps/common';
const routes = [ const routes = [
{
path: '', children: [
{ {
path: '', path: '',
component: MapComponent component: MapComponent
}
]
}, },
{ {
path: ':xCenter/:yCenter/:zoom/:rotation/:baseLayer/:queryState', children: [ path: ':xCenter/:yCenter/:zoom/:rotation/:baseLayer/:queryState',
{
path: '',
component: MapComponent component: MapComponent
}
]
}, },
{ {
path: ':queryState', children: [ path: ':queryState',
{
path: '',
component: MapComponent component: MapComponent
} }
]
}
]; ];
@NgModule({ @NgModule({

View File

@ -251,14 +251,7 @@ export {
FeatureListCropfieldComponent, FeatureListCropfieldComponent,
FeatureListFeatureContainerComponent, FeatureListFeatureContainerComponent,
ZoomToExtentComponent ZoomToExtentComponent
] ],
})
export class AppCommonMapModule {
static forRoot(): ModuleWithProviders<AppCommonMapModule> {
return {
ngModule: AppCommonMapModule,
providers: [ providers: [
FeatureIconService, FeatureIconService,
GeolocationService, GeolocationService,
@ -276,6 +269,8 @@ export class AppCommonMapModule {
{ provide: AbstractItemListItemComponent, useClass: ItemListItemComponent, multi: true }, { provide: AbstractItemListItemComponent, useClass: ItemListItemComponent, multi: true },
{ provide: AbstractItemListComponent, useClass: ItemListComponent, multi: true } { provide: AbstractItemListComponent, useClass: ItemListComponent, multi: true }
] ]
}; })
}
export class AppCommonMapModule {
} }

View File

@ -81,7 +81,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
public styles$:Observable<IStyles> = this.store.select(mapReducers.selectGetStyles); public styles$:Observable<IStyles> = this.store.select(mapReducers.selectGetStyles);
private lastUrl = ""; private lastUrl = "";
private initialized: boolean = false; private initialized: boolean = false;
private rootItems: Observable<IListItem[]> = this.store.select(commonReducers.getRootItems);
@ViewChild('map') map; @ViewChild('map') map;
@ -123,11 +122,12 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
} }
} }
}); });
this.rootItems.subscribe((l) => {
if(l && l.length>0) {
this.store.dispatch(new mapActions.Init()); this.store.dispatch(new mapActions.Init());
} // this.store.select(commonReducers.getRootItems).subscribe((l) => {
}); // if(l && l.length>0) {
// this.store.dispatch(new mapActions.Init());
// }
// });
} }
@HostListener('document:keyup', ['$event']) @HostListener('document:keyup', ['$event'])