Compare commits
No commits in common. "61390214ddb1e7c9416cab498ae1984daa80205e" and "9a85917e22086279f546e97e056b82f1029d4703" have entirely different histories.
61390214dd
...
9a85917e22
@ -13,7 +13,7 @@ const key = process.env.OPEN_TRIP_MAPS_KEY
|
|||||||
* @param {string} lat2 Latitude of the 2nd point of the box
|
* @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#))
|
* @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, rate: string) {
|
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) {
|
||||||
const lonMin = Math.min(parseFloat(lon1), parseFloat(lon2))
|
const lonMin = Math.min(parseFloat(lon1), parseFloat(lon2))
|
||||||
const lonMax = Math.max(parseFloat(lon1), parseFloat(lon2))
|
const lonMax = Math.max(parseFloat(lon1), parseFloat(lon2))
|
||||||
const latMin = Math.min(parseFloat(lat1), parseFloat(lat2))
|
const latMin = Math.min(parseFloat(lat1), parseFloat(lat2))
|
||||||
@ -27,7 +27,6 @@ async function callBox(lon1:string, lat1:string, lon2: string, lat2: string, rat
|
|||||||
lon_max: lonMax,
|
lon_max: lonMax,
|
||||||
lat_min: latMin,
|
lat_min: latMin,
|
||||||
lat_max: latMax,
|
lat_max: latMax,
|
||||||
rate: rate,
|
|
||||||
apikey: key,
|
apikey: key,
|
||||||
kinds: 'bars,cafes,pubs,biergartens'
|
kinds: 'bars,cafes,pubs,biergartens'
|
||||||
},
|
},
|
||||||
@ -184,12 +183,11 @@ export async function getBox(req:express.Request, res: express.Response) {
|
|||||||
const lat1 = req.query["lat1"] as string
|
const lat1 = req.query["lat1"] as string
|
||||||
const lon2 = req.query["lon2"] as string
|
const lon2 = req.query["lon2"] as string
|
||||||
const lat2 = req.query["lat2"] as string
|
const lat2 = req.query["lat2"] as string
|
||||||
const rate = req.query["rate"] as string
|
|
||||||
if(!lon1 || !lat1 || !lon2 || !lat2){
|
if(!lon1 || !lat1 || !lon2 || !lat2){
|
||||||
res.status(400).send("Missing Argument")
|
res.status(400).send("Missing Argument")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
res.send( await callBox(lon1, lat1, lon2, lat2, rate))
|
res.send( await callBox(lon1, lat1, lon2, lat2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ const metadata = {
|
|||||||
document.querySelectorAll<HTMLInputElement>('input[name="note-min"]').forEach(e => {
|
document.querySelectorAll<HTMLInputElement>('input[name="note-min"]').forEach(e => {
|
||||||
e.addEventListener("click", () => {
|
e.addEventListener("click", () => {
|
||||||
minimalNote = e.value
|
minimalNote = e.value
|
||||||
searchBox()
|
|
||||||
})
|
})
|
||||||
|
searchBox()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user