Browse Source

combined checks for boundary circle radius into one block

pull/931/head
Lily He 8 years ago
parent
commit
2a73bb34ac
  1. 21
      query/reverse.js

21
query/reverse.js

@ -65,25 +65,24 @@ function generateQuery( clean ){
// where point.lan/point.lon are provided in the // where point.lan/point.lon are provided in the
// absense of boundary.circle.lat/boundary.circle.lon // absense of boundary.circle.lat/boundary.circle.lon
if( check.number(clean['boundary.circle.lat']) && if( check.number(clean['boundary.circle.lat']) &&
check.number(clean['boundary.circle.lon']) && check.number(clean['boundary.circle.lon']) ){
check.number(clean['boundary.circle.radius']) ){
vs.set({ vs.set({
'boundary:circle:lat': clean['boundary.circle.lat'], 'boundary:circle:lat': clean['boundary.circle.lat'],
'boundary:circle:lon': clean['boundary.circle.lon'], 'boundary:circle:lon': clean['boundary.circle.lon']
'boundary:circle:radius': clean['boundary.circle.radius'] + 'km'
}); });
logStr += '[param:boundary_circle] ';
}
if (check.undefined(clean['boundary.circle.radius'])){
// for coarse reverse when boundary circle radius is undefined // for coarse reverse when boundary circle radius is undefined
if( check.number(clean['boundary.circle.lat']) &&
check.number(clean['boundary.circle.lon']) &&
check.undefined(clean['boundary.circle.radius']) ){
vs.set({ vs.set({
'boundary:circle:lat': clean['boundary.circle.lat'],
'boundary:circle:lon': clean['boundary.circle.lon'],
'boundary:circle:radius': defaults['boundary:circle:radius'] 'boundary:circle:radius': defaults['boundary:circle:radius']
}); });
} else if (check.number(clean['boundary.circle.radius'])){
// plain reverse where boundary circle is a valid number
vs.set({
'boundary:circle:radius': clean['boundary.circle.radius'] + 'km'
});
}
logStr += '[param:boundary_circle] '; logStr += '[param:boundary_circle] ';
} }

Loading…
Cancel
Save