Browse Source

flip lat/lon

pull/12/head
Peter Johnson 10 years ago
parent
commit
613e7233af
  1. 4
      controller/suggest.js
  2. 4
      test/unit/controller/suggest.js

4
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;

4
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',

Loading…
Cancel
Save