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": {
"local": ["localadmin", "locality", "neighbourhood", "county"],
"regional": ["region_a", "region", "country"]
"regional": ["region_a", "region"],
"country": ["country_a"]
},
"GBR": {
"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',
'layer': 'venue',
'source': 'osm',
'label': 'Empire State Building, Manhattan, NY',
'label': 'Empire State Building, Manhattan, NY, USA',
'name': 'Empire State Building',
'country_a': 'USA',
'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',
'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();
});
};
@ -44,7 +44,7 @@ module.exports.tests.nyc_office = function(test, common) {
'locality': 'New York',
'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();
});
};
@ -65,7 +65,7 @@ module.exports.tests.nyc_bakery = function(test, common) {
'locality': 'New York',
'neighbourhood': 'Koreatown'
};
t.equal(generator(doc),'New York Bakery, Manhattan, NY');
t.equal(generator(doc),'New York Bakery, Manhattan, NY, USA');
t.end();
});
};
@ -83,7 +83,7 @@ module.exports.tests.ferry_building = function(test, common) {
'locality': 'San Francisco',
'neighbourhood': 'Financial District'
};
t.equal(generator(doc),'Ferry Building, San Francisco, CA');
t.equal(generator(doc),'Ferry Building, San Francisco, CA, USA');
t.end();
});
};
@ -98,7 +98,7 @@ module.exports.tests.california = function(test, common) {
'region': 'California',
'region_a': 'CA'
};
t.equal(generator(doc),'California, CA');
t.equal(generator(doc),'California, CA, USA');
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) {
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 = {
local: ['localadmin', 'locality', 'neighbourhood', 'county', 'region'],
regional: ['country']

Loading…
Cancel
Save