Browse Source

Use flat structure for focus.point.{lat|lon} in query/search.js

pull/271/head
Julian Simioni 9 years ago
parent
commit
190304b039
  1. 6
      query/search.js
  2. 4
      test/unit/query/search.js

6
query/search.js

@ -58,10 +58,10 @@ function generateQuery( clean ){
} }
// focus point // focus point
if( clean.lat && clean.lon ){ if( clean['focus.point.lat'] && clean['focus.point.lon'] ){
vs.set({ vs.set({
'focus:point:lat': clean.lat, 'focus:point:lat': clean['focus.point.lat'],
'focus:point:lon': clean.lon 'focus:point:lon': clean['focus.point.lon']
}); });
} }

4
test/unit/query/search.js

@ -16,7 +16,7 @@ module.exports.tests.query = function(test, common) {
test('valid search + focus + bbox', function(t) { test('valid search + focus + bbox', function(t) {
var query = generate({ var query = generate({
text: 'test', size: 10, text: 'test', size: 10,
lat: 29.49136, lon: -82.50622, 'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622,
bbox: { bbox: {
top: 47.47, top: 47.47,
right: -61.84, right: -61.84,
@ -71,7 +71,7 @@ module.exports.tests.query = function(test, common) {
test('search search + focus', function(t) { test('search search + focus', function(t) {
var query = generate({ var query = generate({
text: 'test', size: 10, text: 'test', size: 10,
lat: 29.49136, lon: -82.50622, 'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622,
layers: ['test'] layers: ['test']
}); });

Loading…
Cancel
Save