FarmMapsLib/src/app/app-routing.module.ts

82 lines
2.1 KiB
TypeScript
Raw Normal View History

2019-07-16 14:15:40 +00:00
import { NgModule } from '@angular/core';
2020-01-07 21:31:27 +00:00
import { RouterModule ,UrlSegment} from '@angular/router';
2019-07-16 14:15:40 +00:00
2019-11-01 14:57:50 +00:00
import { AuthGuard,FullScreenGuard } from '@farmmaps/common';
2019-11-05 07:59:36 +00:00
import { MapComponent } from '@farmmaps/common-map';
2020-10-02 15:48:34 +00:00
import { Switch2D3DComponent } from '@farmmaps/common-map3d';
2019-11-05 16:19:33 +00:00
import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component';
2020-02-04 13:20:32 +00:00
import {RegisterDeviceComponent} from './registerdevice/registerdevice.component';
2019-11-08 12:48:43 +00:00
import {NotImplementedComponent} from '@farmmaps/common';
2020-01-08 10:37:57 +00:00
import { NavBarGuard } from 'projects/common/src/public-api';
2020-10-06 07:07:40 +00:00
import {TestComponent} from './test/test.component';
2019-07-16 14:15:40 +00:00
2020-01-07 21:31:27 +00:00
export function urlMatcher(url: UrlSegment[]) {
return {consumed:url};
}
2019-07-16 14:15:40 +00:00
const routes = [
2020-01-07 21:31:27 +00:00
{
path: '',
component: LogoComponent,
outlet: 'side-panel-logo'
},
{
path: '',
component: MenuComponent,
outlet: 'side-panel-menu'
},
2019-11-01 14:57:50 +00:00
{
path: '',
redirectTo: 'map',
pathMatch: 'full'
2020-02-04 13:20:32 +00:00
},
2019-11-08 12:48:43 +00:00
{
path:'editor/:type/item/:itemcode',
2020-01-08 10:37:57 +00:00
canActivate:[NavBarGuard],
2019-11-08 12:48:43 +00:00
component: NotImplementedComponent
},
{
path:'viewer/:type/item/:itemcode',
2020-01-08 10:37:57 +00:00
canActivate:[NavBarGuard],
2019-11-08 12:48:43 +00:00
component: NotImplementedComponent
},
2019-11-01 14:57:50 +00:00
{ path: 'map', canActivateChild: [AuthGuard],canActivate:[FullScreenGuard], children: [
{
2020-10-02 15:48:34 +00:00
path: '',
component: MapComponent
},
2019-11-01 14:57:50 +00:00
{
path: ':xCenter/:yCenter/:zoom/:rotation/:baseLayer/:queryState',
2020-10-02 15:48:34 +00:00
component: MapComponent ,
children: [
{
path:'',
component: Switch2D3DComponent,
outlet: 'map-controls'
}
]
2020-02-18 07:03:42 +00:00
},
{
path: ':queryState',
2020-10-02 15:48:34 +00:00
component: MapComponent
2020-10-06 07:07:40 +00:00
}
2020-02-04 13:20:32 +00:00
]},
{
path:'registerdevice/:deviceToken',
canActivate:[FullScreenGuard],
component:RegisterDeviceComponent
2020-10-06 07:07:40 +00:00
},
{
path:'test',
component: TestComponent
2020-02-04 13:20:32 +00:00
}
2019-07-16 14:15:40 +00:00
];
@NgModule({
imports: [RouterModule.forRoot(routes,
2020-05-09 07:14:16 +00:00
{ initialNavigation: true })], // , enableTracing: true
2019-07-16 14:15:40 +00:00
exports: [RouterModule]
})
export class AppRoutingModule { }