Browse Source

Change type back to layer... oooops

pull/210/head
Diana Shkolnikov 9 years ago
parent
commit
1d8db6e5d1
  1. 2
      app.js
  2. 2
      helper/geojsonify.js
  3. 6
      middleware/geocodeJSON.js
  4. 2
      package.json
  5. 12
      test/unit/helper/geojsonify.js

2
app.js

@ -69,7 +69,7 @@ app.get( '/reverse', routers.reverse );
// TODO: name mapping for admin values (admin0 => country, etc)
app.use(require('./middleware/renamePlacenames')());
app.use(require('./middleware/geocodeJSON')());
app.use(require('./middleware/geocodeJSON')(peliasConfig));
app.use(require('./middleware/sendJSON'));

2
helper/geojsonify.js

@ -152,7 +152,7 @@ function addMetaData(src, dst) {
var meta = META_MAP[src._type] || { type: src._type, source: src._type };
dst.id = src._id;
dst.type = meta.type;
dst.layer = meta.type;
dst.source = meta.source;
}

6
middleware/geocodeJSON.js

@ -29,12 +29,12 @@ function convertToGeocodeJSON(peliasConfig, req, next) {
// and then multiple licences, can be an object with one key by source.
// Can be a freeform text property describing the licensing details.
// Can be a URI on the server, which outlines licensing details.
req.results.geojson.geocoding.license = peliasConfig.host + '/license'; // TODO: add to config
req.results.geojson.geocoding.license = peliasConfig.host + '/license';
// OPTIONAL. Default: null. The attribution of the data. In case of multiple sources,
// and then multiple attributions, can be an object with one key by source.
// Can be a URI on the server, which outlines attribution details.
req.results.geojson.geocoding.attribution = peliasConfig.host + '/attribution'; // TODO: add to config
req.results.geojson.geocoding.attribution = peliasConfig.host + '/attribution';
// OPTIONAL. Default: null. The query that has been issued to trigger the
// search.
@ -71,7 +71,7 @@ function addEngine(peliasConfig, geocoding) {
geocoding.engine = {
name: 'Pelias',
author: 'Mapzen',
version: peliasConfig.version // TODO: add to config
version: peliasConfig.version
};
}

2
package.json

@ -45,7 +45,7 @@
"markdown": "0.5.0",
"microtime": "1.4.0",
"morgan": "1.5.2",
"pelias-config": "^0.1.4",
"pelias-config": "^1.0.1",
"pelias-esclient": "0.0.25",
"pelias-logger": "^0.0.8",
"pelias-schema": "1.0.0",

12
test/unit/helper/geojsonify.js

@ -142,7 +142,7 @@ module.exports.tests.search = function(test, common) {
'properties': {
'geocoding': {
'id': 'id1',
'type': 'type1',
'layer': 'type1',
'source': 'type1',
'label': '\'Round Midnight Jazz and Blues Bar, test3, Angel',
'name': '\'Round Midnight Jazz and Blues Bar',
@ -173,7 +173,7 @@ module.exports.tests.search = function(test, common) {
'properties': {
'geocoding': {
'id': 'id2',
'type': 'type2',
'layer': 'type2',
'source': 'type2',
'label': 'Blues Cafe, test3, Smithfield',
'name': 'Blues Cafe',
@ -200,7 +200,7 @@ module.exports.tests.search = function(test, common) {
'properties': {
'geocoding': {
'id': '34633854',
'type': 'venue',
'layer': 'venue',
'source': 'osm',
'label': 'Empire State Building, Manhattan, NY',
'name': 'Empire State Building',
@ -251,7 +251,7 @@ module.exports.tests.search = function(test, common) {
'properties': {
'geocoding': {
'id': 'id1',
'type': 'type1',
'layer': 'type1',
'source': 'type1',
'label': '\'Round Midnight Jazz and Blues Bar, test3, Angel'
}
@ -269,7 +269,7 @@ module.exports.tests.search = function(test, common) {
'properties': {
'geocoding': {
'id': 'id2',
'type': 'type2',
'layer': 'type2',
'source': 'type2',
'label': 'Blues Cafe, test3, Smithfield'
}
@ -287,7 +287,7 @@ module.exports.tests.search = function(test, common) {
'properties': {
'geocoding': {
'id': '34633854',
'type': 'venue',
'layer': 'venue',
'source': 'osm',
'label': 'Empire State Building, Manhattan, NY'
}

Loading…
Cancel
Save