diff --git a/Express/barAndCafe/src/openTripMaps.ts b/Express/barAndCafe/src/openTripMaps.ts index 1f7e208..7d4ca1b 100644 --- a/Express/barAndCafe/src/openTripMaps.ts +++ b/Express/barAndCafe/src/openTripMaps.ts @@ -3,9 +3,15 @@ import express from "express" import * as dotenv from "dotenv"; dotenv.config({path: '../../.env'}) - const key = process.env.OPEN_TRIP_MAPS_KEY +/** + * make GET request to the OTM for radius search. + * @param {string} lon Longitude of radius center point + * @param {string} lat Latitude du point central du rayon + * @param {string} radius search radius size in meters + * @returns {FeatureCollection} a list of POIs with their type, id, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#)) + */ async function callRadius(lon: string, lat: string, radius = '1000') { const optionsDrink = { method: 'GET', @@ -28,7 +34,11 @@ async function callRadius(lon: string, lat: string, radius = '1000') { } } - +/** + * make GET request to the OTM for city info. + * @param {string} name Name of a city + * @returns {Geoname} info of a search city their name, country, lat, lon, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#)) + */ async function callCity(name:string) { const optionsCity = { method: 'GET', @@ -70,7 +80,7 @@ export async function getCity(req: express.Request, res: express.Response) { } /** - * Handle GET request for city search route ('/otm/radius'). + * Handle GET request for radius search route ('/otm/radius'). * @param {express.Request} req - HTTP Request object. * @param {express.Response} res - HTTP Response object. */