Browse Source

added `country_a` to label for all USA results

pull/430/head
Stephen Hess 9 years ago committed by Julian Simioni
parent
commit
3e11e6687c
  1. 3
      helper/labelSchema.json
  2. 2
      test/unit/helper/geojsonify.js
  3. 10
      test/unit/helper/labelGenerator_USA.js
  4. 2
      test/unit/helper/labelSchema.js

3
helper/labelSchema.json

@ -1,7 +1,8 @@
{ {
"USA": { "USA": {
"local": ["localadmin", "locality", "neighbourhood", "county"], "local": ["localadmin", "locality", "neighbourhood", "county"],
"regional": ["region_a", "region", "country"] "regional": ["region_a", "region"],
"country": ["country_a"]
}, },
"GBR": { "GBR": {
"local": ["neighbourhood", "county", "localadmin", "locality", "region"], "local": ["neighbourhood", "county", "localadmin", "locality", "region"],

2
test/unit/helper/geojsonify.js

@ -199,7 +199,7 @@ module.exports.tests.search = function(test, common) {
'gid': 'osm:venue:34633854', 'gid': 'osm:venue:34633854',
'layer': 'venue', 'layer': 'venue',
'source': 'osm', 'source': 'osm',
'label': 'Empire State Building, Manhattan, NY', 'label': 'Empire State Building, Manhattan, NY, USA',
'name': 'Empire State Building', 'name': 'Empire State Building',
'country_a': 'USA', 'country_a': 'USA',
'country': 'United States', 'country': 'United States',

10
test/unit/helper/labelGenerator_USA.js

@ -22,7 +22,7 @@ module.exports.tests.san_francisco = function(test, common) {
'county': 'San Francisco County', 'county': 'San Francisco County',
'locality': 'San Francisco' 'locality': 'San Francisco'
}; };
t.equal(generator(doc),'San Francisco, San Francisco County, CA'); t.equal(generator(doc),'San Francisco, San Francisco County, CA, USA');
t.end(); t.end();
}); });
}; };
@ -44,7 +44,7 @@ module.exports.tests.nyc_office = function(test, common) {
'locality': 'New York', 'locality': 'New York',
'neighbourhood': 'Flatiron District' 'neighbourhood': 'Flatiron District'
}; };
t.equal(generator(doc),'30 West 26th Street, Manhattan, NY'); t.equal(generator(doc),'30 West 26th Street, Manhattan, NY, USA');
t.end(); t.end();
}); });
}; };
@ -65,7 +65,7 @@ module.exports.tests.nyc_bakery = function(test, common) {
'locality': 'New York', 'locality': 'New York',
'neighbourhood': 'Koreatown' 'neighbourhood': 'Koreatown'
}; };
t.equal(generator(doc),'New York Bakery, Manhattan, NY'); t.equal(generator(doc),'New York Bakery, Manhattan, NY, USA');
t.end(); t.end();
}); });
}; };
@ -83,7 +83,7 @@ module.exports.tests.ferry_building = function(test, common) {
'locality': 'San Francisco', 'locality': 'San Francisco',
'neighbourhood': 'Financial District' 'neighbourhood': 'Financial District'
}; };
t.equal(generator(doc),'Ferry Building, San Francisco, CA'); t.equal(generator(doc),'Ferry Building, San Francisco, CA, USA');
t.end(); t.end();
}); });
}; };
@ -98,7 +98,7 @@ module.exports.tests.california = function(test, common) {
'region': 'California', 'region': 'California',
'region_a': 'CA' 'region_a': 'CA'
}; };
t.equal(generator(doc),'California, CA'); t.equal(generator(doc),'California, CA, USA');
t.end(); t.end();
}); });
}; };

2
test/unit/helper/labelSchema.js

@ -13,7 +13,7 @@ module.exports.tests.interface = function(test, common) {
}; };
module.exports.tests.valid = function(test, common) { module.exports.tests.valid = function(test, common) {
var valid_keys = ['localadmin', 'locality', 'neighbourhood', 'county', 'region_a', 'region', 'country']; var valid_keys = ['localadmin', 'locality', 'neighbourhood', 'county', 'region_a', 'region', 'country', 'country_a'];
var default_schema = { var default_schema = {
local: ['localadmin', 'locality', 'neighbourhood', 'county', 'region'], local: ['localadmin', 'locality', 'neighbourhood', 'county', 'region'],
regional: ['country'] regional: ['country']

Loading…
Cancel
Save