Browse Source

adding address type to layers by default

pull/64/head
Harish Krishna 10 years ago
parent
commit
a67f640acb
  1. 8
      helper/queryMixer.json
  2. 3
      sanitiser/_layers.js
  3. 3
      test/unit/sanitiser/suggest.js

8
helper/queryMixer.json

@ -1,7 +1,7 @@
{
"suggest": [
{
"layers": ["poi", "admin"],
"layers": ["poi", "admin", "address"],
"precision": [5, 3, 1]
},
{
@ -9,18 +9,18 @@
"precision": []
},
{
"layers": ["poi", "admin"],
"layers": ["poi", "admin", "address"],
"precision": [3],
"fuzzy": "AUTO"
}
],
"suggest_nearby": [
{
"layers": ["poi", "admin"],
"layers": ["poi", "admin", "address"],
"precision": []
},
{
"layers": ["poi", "admin"],
"layers": ["poi", "admin", "address"],
"precision": [],
"fuzzy": "AUTO"
}

3
sanitiser/_layers.js

@ -16,8 +16,7 @@ function sanitize( req ){
// default case (no layers specified in GET params)
if('string' !== typeof params.layers || !params.layers.length){
// @note: 'address' alias disabled by default until feature testing completed
params.layers = 'poi,admin'; // default layers
params.layers = 'poi,admin,address'; // default layers
}
// decide which layers can be queried

3
test/unit/sanitiser/suggest.js

@ -5,7 +5,8 @@ var suggest = require('../../../sanitiser/suggest'),
defaultError = 'invalid param \'input\': text length, must be >0',
defaultClean = { input: 'test',
lat: 0,
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood' ],
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood',
'osmaddress', 'openaddresses' ],
lon: 0,
size: 10,
zoom: 10

Loading…
Cancel
Save