FarmMapsLib/src/app/app-routing.module.ts
Willem Dantuma b8dcc4e9e0
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
Add 3D example to test app
2020-10-02 17:48:34 +02:00

77 lines
1.9 KiB
TypeScript

import { NgModule } from '@angular/core';
import { RouterModule ,UrlSegment} from '@angular/router';
import { AuthGuard,FullScreenGuard } from '@farmmaps/common';
import { MapComponent } from '@farmmaps/common-map';
import { Switch2D3DComponent } from '@farmmaps/common-map3d';
import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component';
import {RegisterDeviceComponent} from './registerdevice/registerdevice.component';
import {NotImplementedComponent} from '@farmmaps/common';
import { NavBarGuard } from 'projects/common/src/public-api';
export function urlMatcher(url: UrlSegment[]) {
return {consumed:url};
}
const routes = [
{
path: '',
component: LogoComponent,
outlet: 'side-panel-logo'
},
{
path: '',
component: MenuComponent,
outlet: 'side-panel-menu'
},
{
path: '',
redirectTo: 'map',
pathMatch: 'full'
},
{
path:'editor/:type/item/:itemcode',
canActivate:[NavBarGuard],
component: NotImplementedComponent
},
{
path:'viewer/:type/item/:itemcode',
canActivate:[NavBarGuard],
component: NotImplementedComponent
},
{ path: 'map', canActivateChild: [AuthGuard],canActivate:[FullScreenGuard], children: [
{
path: '',
component: MapComponent
},
{
path: ':xCenter/:yCenter/:zoom/:rotation/:baseLayer/:queryState',
component: MapComponent ,
children: [
{
path:'',
component: Switch2D3DComponent,
outlet: 'map-controls'
}
]
},
{
path: ':queryState',
component: MapComponent
}
]},
{
path:'registerdevice/:deviceToken',
canActivate:[FullScreenGuard],
component:RegisterDeviceComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes,
{ initialNavigation: true })], // , enableTracing: true
exports: [RouterModule]
})
export class AppRoutingModule { }