2020-02-18 07:03:42 +00:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
import {Router} from '@angular/router';
|
2020-02-19 11:02:56 +00:00
|
|
|
import {mapReducers} from '@farmmaps/common-map';
|
|
|
|
import {StateSerializerService} from '@farmmaps/common';
|
2019-11-05 16:19:33 +00:00
|
|
|
import { tassign } from 'tassign';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-menu',
|
|
|
|
templateUrl: './menu.component.html',
|
|
|
|
styleUrls: ['./menu.component.scss']
|
|
|
|
})
|
2020-02-18 07:03:42 +00:00
|
|
|
export class MenuComponent {
|
2019-11-05 16:19:33 +00:00
|
|
|
|
|
|
|
|
2020-02-18 07:03:42 +00:00
|
|
|
constructor( private stateSerializerService:StateSerializerService,private router:Router ) { }
|
2019-11-05 16:19:33 +00:00
|
|
|
|
|
|
|
handlePredefinedQuery(event: MouseEvent, query: any) {
|
|
|
|
event.preventDefault();
|
2023-03-06 13:04:14 +00:00
|
|
|
const queryState = this.stateSerializerService.serialize(tassign(mapReducers.initialQueryState, query));
|
2020-02-18 07:03:42 +00:00
|
|
|
this.router.navigate(['map',queryState])
|
2019-11-05 16:19:33 +00:00
|
|
|
}
|
|
|
|
}
|