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

3
sanitiser/_layers.js

@ -16,8 +16,7 @@ function sanitize( req ){
// default case (no layers specified in GET params) // default case (no layers specified in GET params)
if('string' !== typeof params.layers || !params.layers.length){ if('string' !== typeof params.layers || !params.layers.length){
// @note: 'address' alias disabled by default until feature testing completed params.layers = 'poi,admin,address'; // default layers
params.layers = 'poi,admin'; // default layers
} }
// decide which layers can be queried // 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', defaultError = 'invalid param \'input\': text length, must be >0',
defaultClean = { input: 'test', defaultClean = { input: 'test',
lat: 0, lat: 0,
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood' ], layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood',
'osmaddress', 'openaddresses' ],
lon: 0, lon: 0,
size: 10, size: 10,
zoom: 10 zoom: 10

Loading…
Cancel
Save