Compare commits
2 Commits
9a85917e22
...
61390214dd
Author | SHA1 | Date | |
---|---|---|---|
61390214dd | |||
9a935a922d |
@ -13,7 +13,7 @@ const key = process.env.OPEN_TRIP_MAPS_KEY
|
||||
* @param {string} lat2 Latitude of the 2nd point of the box
|
||||
* @returns {FeatureCollection} a list of POIs with their type, id, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#))
|
||||
*/
|
||||
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) {
|
||||
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string, rate: string) {
|
||||
const lonMin = Math.min(parseFloat(lon1), parseFloat(lon2))
|
||||
const lonMax = Math.max(parseFloat(lon1), parseFloat(lon2))
|
||||
const latMin = Math.min(parseFloat(lat1), parseFloat(lat2))
|
||||
@ -27,6 +27,7 @@ async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) {
|
||||
lon_max: lonMax,
|
||||
lat_min: latMin,
|
||||
lat_max: latMax,
|
||||
rate: rate,
|
||||
apikey: key,
|
||||
kinds: 'bars,cafes,pubs,biergartens'
|
||||
},
|
||||
@ -183,11 +184,12 @@ export async function getBox(req:express.Request, res: express.Response) {
|
||||
const lat1 = req.query["lat1"] as string
|
||||
const lon2 = req.query["lon2"] as string
|
||||
const lat2 = req.query["lat2"] as string
|
||||
const rate = req.query["rate"] as string
|
||||
if(!lon1 || !lat1 || !lon2 || !lat2){
|
||||
res.status(400).send("Missing Argument")
|
||||
return
|
||||
}
|
||||
|
||||
res.send( await callBox(lon1, lat1, lon2, lat2))
|
||||
res.send( await callBox(lon1, lat1, lon2, lat2, rate))
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ const metadata = {
|
||||
document.querySelectorAll<HTMLInputElement>('input[name="note-min"]').forEach(e => {
|
||||
e.addEventListener("click", () => {
|
||||
minimalNote = e.value
|
||||
searchBox()
|
||||
})
|
||||
searchBox()
|
||||
})
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user