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

29 lines
532 B
JavaScript
Raw Permalink Normal View History

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