1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Controller, Get, Query } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||
import { MapsService } from './maps.service';
|
||||
|
||||
@ApiTags('maps')
|
||||
@Controller('maps')
|
||||
export class MapsController {
|
||||
constructor(private readonly mapsService: MapsService) {}
|
||||
|
||||
@Get('route')
|
||||
@ApiOperation({ summary: 'Calculate a route between two points 🚗' })
|
||||
async getRoute(
|
||||
@Query('fromLat') fromLat: number,
|
||||
@Query('fromLng') fromLng: number,
|
||||
@Query('toLat') toLat: number,
|
||||
@Query('toLng') toLng: number,
|
||||
) {
|
||||
return this.mapsService.getRoute([fromLat, fromLng], [toLat, toLng]);
|
||||
}
|
||||
|
||||
@Get('config')
|
||||
@ApiOperation({ summary: 'Get map configuration for the region 🗺️' })
|
||||
async getConfig() {
|
||||
return this.mapsService.getMapConfig();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user