Browse Source

added empire to coarse translation

pull/1002/head
Stephen Hess 7 years ago
parent
commit
18e7673dc1
  1. 10
      helper/type_mapping.js
  2. 2
      test/unit/helper/type_mapping.js
  3. 8
      test/unit/sanitizer/_layers.js

10
helper/type_mapping.js

@ -49,7 +49,7 @@ var LAYERS_BY_SOURCE = {
openaddresses: [ 'address' ],
geonames: [ 'country','macroregion', 'region', 'county','localadmin',
'locality','borough', 'neighbourhood', 'venue' ],
whosonfirst: [ 'continent', 'country', 'dependency', 'macroregion', 'region',
whosonfirst: [ 'continent', 'empire', 'country', 'dependency', 'macroregion', 'region',
'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'borough',
'neighbourhood', 'microhood', 'disputed', 'venue', 'postalcode',
'continent', 'ocean', 'marinearea']
@ -61,10 +61,10 @@ var LAYERS_BY_SOURCE = {
* may have layers that mean the same thing but have a different name
*/
var LAYER_ALIASES = {
'coarse': [ 'continent', 'country', 'dependency', 'macroregion', 'region',
'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'borough',
'neighbourhood', 'microhood', 'disputed', 'postalcode',
'continent', 'ocean', 'marinearea']
'coarse': [ 'continent', 'empire', 'country', 'dependency', 'macroregion',
'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood',
'borough', 'neighbourhood', 'microhood', 'disputed', 'postalcode',
'continent', 'ocean', 'marinearea']
};
// create a list of all layers by combining each entry from LAYERS_BY_SOURCE

2
test/unit/helper/type_mapping.js

@ -12,7 +12,7 @@ module.exports.tests.interfaces = function(test, common) {
test('alias layer mapping', function(t) {
t.deepEquals(type_mapping.layer_mapping.coarse,
[ 'continent', 'country', 'dependency', 'macroregion',
[ 'continent', 'empire', 'country', 'dependency', 'macroregion',
'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood',
'borough', 'neighbourhood', 'microhood', 'disputed', 'postalcode',
'continent', 'ocean', 'marinearea']);

8
test/unit/sanitizer/_layers.js

@ -34,14 +34,14 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.layers, venue_layers, 'venue layers set');
t.end();
});
test('coarse (alias) layer', function(t) {
var raw = { layers: 'coarse' };
var clean = {};
sanitizer.sanitize(raw, clean);
var admin_layers = [ 'continent', 'country', 'dependency', 'macroregion',
var admin_layers = [ 'continent', 'empire', 'country', 'dependency', 'macroregion',
'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood',
'borough', 'neighbourhood', 'microhood', 'disputed', 'postalcode', 'ocean',
'marinearea' ];
@ -77,7 +77,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
sanitizer.sanitize(raw, clean);
var expected_layers = [ 'continent', 'country', 'dependency',
var expected_layers = [ 'continent', 'empire', 'country', 'dependency',
'macroregion', 'region', 'locality', 'localadmin', 'macrocounty', 'county',
'macrohood', 'borough', 'neighbourhood', 'microhood', 'disputed', 'postalcode',
'ocean', 'marinearea'];
@ -114,7 +114,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
sanitizer.sanitize(raw, clean);
var coarse_layers = [ 'continent',
var coarse_layers = [ 'continent', 'empire',
'country', 'dependency', 'macroregion', 'region', 'locality', 'localadmin',
'macrocounty', 'county', 'macrohood', 'borough', 'neighbourhood', 'microhood',
'disputed', 'postalcode', 'ocean', 'marinearea' ];

Loading…
Cancel
Save