Browse Source

using precision levels 1..5 only

pull/24/head
Harish Krishna 10 years ago
parent
commit
e7e449a914
  1. 17
      query/suggest.js

17
query/suggest.js

@ -5,13 +5,20 @@ var logger = require('../src/logger');
function generate( params ){ function generate( params ){
var getPrecision = function(zoom) { var getPrecision = function(zoom) {
if (zoom>=15) { switch (true) {
return 9; case (zoom < 5):
} else { return 1; // zoom: 1-3
return parseInt(zoom/2) || 1; case (zoom < 6):
return 2; // zoom: 4-5
case (zoom < 10):
return 3; // zoom: 6-9
case (zoom < 16):
return 4; // zoom: 10-15
default:
return 5; // zoom: >= 16
} }
}; };
var cmd = { var cmd = {
'pelias' : { 'pelias' : {
'text' : params.input, 'text' : params.input,

Loading…
Cancel
Save