db-vendo-client/format/nearby-req.js

29 lines
510 B
JavaScript
Raw Permalink Normal View History

2022-05-07 16:17:37 +02:00
const formatNearbyReq = (ctx, location) => {
2019-10-31 20:08:56 +01:00
const {profile, opt} = ctx
return {
cfg: {polyEnc: 'GPA'},
meth: 'LocGeoPos',
req: {
ring: {
cCrd: {
x: profile.formatCoord(location.longitude),
y: profile.formatCoord(location.latitude)
},
maxDist: opt.distance || -1,
minDist: 0
},
2020-11-15 13:40:37 +01:00
locFltrL: [
profile.formatProductsFilter(ctx, opt.products || {}),
],
2019-10-31 20:08:56 +01:00
getPOIs: !!opt.poi,
getStops: !!opt.stops,
maxLoc: opt.results
}
}
}
2022-05-07 16:17:37 +02:00
export {
formatNearbyReq,
}