Browse Source

Add borough to geojson output and USA.local labels

pull/492/head
Julian Simioni 9 years ago
parent
commit
39502df284
  1. 3
      helper/geojsonify.js
  2. 2
      helper/labelSchema.js
  3. 15
      test/unit/helper/labelSchema.js

3
helper/geojsonify.js

@ -35,6 +35,9 @@ var DETAILS_PROPS = [
'locality',
'locality_gid',
'locality_a',
'borough',
'borough_gid',
'borough_a',
'neighbourhood',
'neighbourhood_gid',
'bounding_box'

2
helper/labelSchema.js

@ -3,7 +3,7 @@ var _ = require('lodash'),
module.exports = {
'USA': {
'local': getFirstProperty(['localadmin', 'locality', 'neighbourhood', 'county']),
'local': getFirstProperty(['borough', 'localadmin', 'locality', 'neighbourhood', 'county']),
'regional': getUsState,
'country': getFirstProperty(['country_a'])
},

15
test/unit/helper/labelSchema.js

@ -772,6 +772,21 @@ module.exports.tests.default = function(test, common) {
});
test('USA.local borough should be shown if available', function(t) {
var record = {
borough: 'borough value',
region: 'region value',
region_a: 'region_a value',
country_a: 'country_a value'
};
var labelParts = ['initial value'];
var f = schemas.USA.local;
t.deepEqual(f(record, labelParts), ['initial value', 'borough value']);
t.end();
});
};
module.exports.all = function (tape, common) {

Loading…
Cancel
Save