|
|
@ -2,7 +2,7 @@ |
|
|
|
var logger = require('../src/logger'); |
|
|
|
var logger = require('../src/logger'); |
|
|
|
|
|
|
|
|
|
|
|
// Build pelias suggest query
|
|
|
|
// Build pelias suggest query
|
|
|
|
function generate( params ){ |
|
|
|
function generate( params, precision ){ |
|
|
|
|
|
|
|
|
|
|
|
var cmd = { |
|
|
|
var cmd = { |
|
|
|
'pelias' : { |
|
|
|
'pelias' : { |
|
|
@ -14,7 +14,7 @@ function generate( params ){ |
|
|
|
'dataset': ['admin0','admin1','admin2'], |
|
|
|
'dataset': ['admin0','admin1','admin2'], |
|
|
|
'location': { |
|
|
|
'location': { |
|
|
|
'value': [ params.lon, params.lat ], |
|
|
|
'value': [ params.lon, params.lat ], |
|
|
|
'precision': 1 |
|
|
|
'precision': precision || 1 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|