From 613e7233af41c783893891aaf52609d4d94e4cf2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 24 Sep 2014 13:44:17 +0100 Subject: [PATCH] flip lat/lon --- controller/suggest.js | 4 ++-- test/unit/controller/suggest.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/suggest.js b/controller/suggest.js index e11608c3..dbd2b506 100644 --- a/controller/suggest.js +++ b/controller/suggest.js @@ -67,8 +67,8 @@ function geoJsonifyDocs( docs ){ // split payload geo string in to geojson properties if( 'string' !== typeof doc.payload.geo ) return warning(); var geoParts = doc.payload.geo.split(','); - doc.lat = parseFloat( geoParts[0] ); - doc.lng = parseFloat( geoParts[1] ); + doc.lat = parseFloat( geoParts[1] ); + doc.lng = parseFloat( geoParts[0] ); // remove payload from doc delete doc.payload; diff --git a/test/unit/controller/suggest.js b/test/unit/controller/suggest.js index cd9c8c00..d4197e11 100644 --- a/test/unit/controller/suggest.js +++ b/test/unit/controller/suggest.js @@ -21,7 +21,7 @@ module.exports.tests.functional_success = function(test, common) { type: 'Feature', geometry: { type: 'Point', - coordinates: [ -10.1, 101 ] + coordinates: [ 101, -10.1 ] }, properties: { id: 'mockid', @@ -32,7 +32,7 @@ module.exports.tests.functional_success = function(test, common) { type: 'Feature', geometry: { type: 'Point', - coordinates: [ -10.1, 101 ] + coordinates: [ 101, -10.1 ] }, properties: { id: 'mockid',