import { NgModule } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'

import { MapComponent } from './map.component'
import { BaseMapComponent } from './base-map/base-map.component'
import { TreeLayerComponent } from './tree-layer/tree-layer.component'

const routes: Routes = [
    {
        path: '',
        component: MapComponent,
        children: [
            {
                path: 'info',
                loadChildren: () => import('../info/info.module').then(m => m.InfoModule),
            },
            {
                path: ':baseMap',
                outlet: 'baseMap',
                component: BaseMapComponent,
            },
            {
                path: '',
                component: BaseMapComponent,
                outlet: 'baseMap',
            },
            {
                path: '',
                component: TreeLayerComponent,
                outlet: 'treeLayer',
            },
        ],
    }
]

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule],
})
export class MapRoutingModule { }