mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
593 B
28 lines
593 B
const url = require('url'); |
|
|
|
const _ = require('lodash'); |
|
|
|
const ServiceConfiguration = require('pelias-microservice-wrapper').ServiceConfiguration; |
|
|
|
class Language extends ServiceConfiguration { |
|
constructor(o) { |
|
super('interpolation', o); |
|
} |
|
|
|
getParameters(req, hit) { |
|
return { |
|
number: req.clean.parsed_text.number, |
|
street: hit.address_parts.street || req.clean.parsed_text.street, |
|
lat: hit.center_point.lat, |
|
lon: hit.center_point.lon |
|
}; |
|
|
|
} |
|
|
|
getUrl(req) { |
|
return url.resolve(this.baseUrl, 'search/geojson'); |
|
} |
|
|
|
} |
|
|
|
module.exports = Language;
|
|
|