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';
|
2019-11-05 16:19:33 +00:00
|
|
|
import { LogoComponent } from './logo/logo.component';
|
|
|
|
import { MenuComponent } from './menu/menu.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';
|
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-01-07 21:31:27 +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: [
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
component: MapComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: ':xCenter/:yCenter/:zoom/:rotation/:baseLayer/:queryState',
|
2020-01-07 21:31:27 +00:00
|
|
|
component: MapComponent
|
|
|
|
}
|
|
|
|
]}
|
2019-07-16 14:15:40 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [RouterModule.forRoot(routes,
|
|
|
|
{ initialNavigation: false })], // , enableTracing: true
|
|
|
|
exports: [RouterModule]
|
|
|
|
})
|
|
|
|
export class AppRoutingModule { }
|