Browse Source

Merge branch '247-remove-geocoding-namespace-from-response'

pull/256/head
Julian Simioni 9 years ago
parent
commit
1dca5adaab
  1. 10
      helper/geojsonify.js
  2. 12
      test/unit/helper/geojsonify.js

10
helper/geojsonify.js

@ -107,15 +107,13 @@ function geojsonifyPlace(details, place) {
return warning('No doc or center_point property'); return warning('No doc or center_point property');
} }
var geocoding = {}; var output = {};
addMetaData(place, geocoding); addMetaData(place, output);
addDetails(details, place, geocoding); addDetails(details, place, output);
addLabel(place, geocoding); addLabel(place, output);
var output = {};
output.geocoding = geocoding;
// map center_point for GeoJSON to work properly // map center_point for GeoJSON to work properly
// these should not show up in the final feature properties // these should not show up in the final feature properties
output.lat = parseFloat(place.center_point.lat); output.lat = parseFloat(place.center_point.lat);

12
test/unit/helper/geojsonify.js

@ -140,7 +140,6 @@ module.exports.tests.search = function(test, common) {
] ]
}, },
'properties': { 'properties': {
'geocoding': {
'id': 'id1', 'id': 'id1',
'layer': 'type1', 'layer': 'type1',
'source': 'type1', 'source': 'type1',
@ -159,7 +158,6 @@ module.exports.tests.search = function(test, common) {
'street': 'Liverpool Road', 'street': 'Liverpool Road',
'postalcode': 'N1 0RW' 'postalcode': 'N1 0RW'
} }
}
}, },
{ {
'type': 'Feature', 'type': 'Feature',
@ -171,7 +169,6 @@ module.exports.tests.search = function(test, common) {
] ]
}, },
'properties': { 'properties': {
'geocoding': {
'id': 'id2', 'id': 'id2',
'layer': 'type2', 'layer': 'type2',
'source': 'type2', 'source': 'type2',
@ -186,7 +183,6 @@ module.exports.tests.search = function(test, common) {
'locality': 'test2', 'locality': 'test2',
'neighbourhood': 'test3' 'neighbourhood': 'test3'
} }
}
}, },
{ {
'type': 'Feature', 'type': 'Feature',
@ -198,7 +194,6 @@ module.exports.tests.search = function(test, common) {
] ]
}, },
'properties': { 'properties': {
'geocoding': {
'id': '34633854', 'id': '34633854',
'layer': 'venue', 'layer': 'venue',
'source': 'osm', 'source': 'osm',
@ -215,7 +210,6 @@ module.exports.tests.search = function(test, common) {
'category': ['tourism', 'transport'] 'category': ['tourism', 'transport']
} }
} }
}
] ]
}; };
@ -249,13 +243,11 @@ module.exports.tests.search = function(test, common) {
] ]
}, },
'properties': { 'properties': {
'geocoding': {
'id': 'id1', 'id': 'id1',
'layer': 'type1', 'layer': 'type1',
'source': 'type1', 'source': 'type1',
'label': '\'Round Midnight Jazz and Blues Bar, test3, Angel' 'label': '\'Round Midnight Jazz and Blues Bar, test3, Angel'
} }
}
}, },
{ {
'type': 'Feature', 'type': 'Feature',
@ -267,13 +259,11 @@ module.exports.tests.search = function(test, common) {
] ]
}, },
'properties': { 'properties': {
'geocoding': {
'id': 'id2', 'id': 'id2',
'layer': 'type2', 'layer': 'type2',
'source': 'type2', 'source': 'type2',
'label': 'Blues Cafe, test3, Smithfield' 'label': 'Blues Cafe, test3, Smithfield'
} }
}
}, },
{ {
'type': 'Feature', 'type': 'Feature',
@ -285,14 +275,12 @@ module.exports.tests.search = function(test, common) {
] ]
}, },
'properties': { 'properties': {
'geocoding': {
'id': '34633854', 'id': '34633854',
'layer': 'venue', 'layer': 'venue',
'source': 'osm', 'source': 'osm',
'label': 'Empire State Building, Manhattan, NY' 'label': 'Empire State Building, Manhattan, NY'
} }
} }
}
] ]
}; };

Loading…
Cancel
Save