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
if( clean.lat && clean.lon ){
if( clean['focus.point.lat'] && clean['focus.point.lon'] ){
vs.set({
'focus:point:lat': clean.lat,
'focus:point:lon': clean.lon
'focus:point:lat': clean['focus.point.lat'],
'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) {
var query = generate({
text: 'test', size: 10,
lat: 29.49136, lon: -82.50622,
'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622,
bbox: {
top: 47.47,
right: -61.84,
@ -71,7 +71,7 @@ module.exports.tests.query = function(test, common) {
test('search search + focus', function(t) {
var query = generate({
text: 'test', size: 10,
lat: 29.49136, lon: -82.50622,
'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622,
layers: ['test']
});

Loading…
Cancel
Save