diff --git a/query/indeces.js b/query/indeces.js index 57dd5617..04d744b6 100644 --- a/query/indeces.js +++ b/query/indeces.js @@ -9,5 +9,6 @@ module.exports = [ 'admin1', 'admin2', 'neighborhood', + 'osmaddress', 'openaddresses' ]; \ No newline at end of file diff --git a/sanitiser/_layers.js b/sanitiser/_layers.js index 3cdb9f47..96739146 100644 --- a/sanitiser/_layers.js +++ b/sanitiser/_layers.js @@ -50,7 +50,7 @@ function sanitize( req ){ layers = expand_aliases('poi', layers, ['geoname','osmnode','osmway']); layers = expand_aliases('admin', layers, ['admin0','admin1','admin2','neighborhood']); - layers = expand_aliases('address', layers, ['openaddresses']); + layers = expand_aliases('address', layers, ['osmaddress','openaddresses']); // de-dupe layers = layers.filter(function(item, pos) { diff --git a/test/unit/query/indeces.js b/test/unit/query/indeces.js index cc17a3c7..924aed69 100644 --- a/test/unit/query/indeces.js +++ b/test/unit/query/indeces.js @@ -6,7 +6,7 @@ module.exports.tests = {}; module.exports.tests.interface = function(test, common) { test('valid interface', function(t) { t.true(Array.isArray(indeces), 'valid array'); - t.equal(indeces.length, 8, 'valid array'); + t.equal(indeces.length, 9, 'valid array'); t.end(); }); }; diff --git a/test/unit/sanitiser/suggest.js b/test/unit/sanitiser/suggest.js index 1b360152..f746f006 100644 --- a/test/unit/sanitiser/suggest.js +++ b/test/unit/sanitiser/suggest.js @@ -181,7 +181,7 @@ module.exports.tests.sanitize_layers = function(test, common) { }); }); test('address (alias) layer', function(t) { - var address_layers = ['openaddresses']; + var address_layers = ['osmaddress','openaddresses']; sanitize({ layers: 'address', input: 'test', lat: 0, lon: 0 }, function( err, clean ){ t.deepEqual(clean.layers, address_layers, 'address layers set'); t.end(); @@ -204,7 +204,7 @@ module.exports.tests.sanitize_layers = function(test, common) { }); }); test('address alias layer plus regular layers', function(t) { - var address_layers = ['openaddresses']; + var address_layers = ['osmaddress','openaddresses']; var reg_layers = ['geoname', 'osmway']; sanitize({ layers: 'address,geoname,osmway', input: 'test', lat: 0, lon: 0 }, function( err, clean ){ t.deepEqual(clean.layers, reg_layers.concat(address_layers), 'address + regular layers set');