Browse Source

Merge pull request #576 from pelias/adding-county-name

Shows county in label if there isnt a locality or local admin
pull/578/head
Julian Simioni 8 years ago committed by GitHub
parent
commit
09756e4eb2
  1. 2
      helper/labelSchema.js
  2. 19
      test/unit/helper/labelGenerator_USA.js

2
helper/labelSchema.js

@ -12,7 +12,7 @@ module.exports = {
},
'USA': {
'borough': getFirstProperty(['borough']),
'local': getFirstProperty(['locality', 'localadmin']),
'local': getFirstProperty(['locality', 'localadmin', 'county']),
'regional': getUsOrCaState,
'country': getUSACountryValue
},

19
test/unit/helper/labelGenerator_USA.js

@ -51,6 +51,25 @@ module.exports.tests.united_states = function(test, common) {
t.end();
});
test('county value should be used when there is no localadmin', function(t) {
var doc = {
'name': 'venue name',
'layer': 'venue',
'housenumber': 'house number',
'street': 'street name',
'neighbourhood': 'neighbourhood name',
'county': 'county name',
'macrocounty': 'macrocounty name',
'region_a': 'region abbr',
'region': 'region name',
'macroregion': 'macroregion name',
'country_a': 'USA',
'country': 'United States'
};
t.equal(generator(doc),'venue name, county name, region abbr, USA');
t.end();
});
test('street', function(t) {
var doc = {
'name': 'house number street name',

Loading…
Cancel
Save