Browse Source

combined checks for boundary circle radius into one block

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

37
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
vs.set({
// for coarse reverse when boundary circle radius is undefined 'boundary:circle:radius': defaults['boundary:circle:radius']
if( check.number(clean['boundary.circle.lat']) && });
check.number(clean['boundary.circle.lon']) && } else if (check.number(clean['boundary.circle.radius'])){
check.undefined(clean['boundary.circle.radius']) ){ // plain reverse where boundary circle is a valid number
vs.set({ vs.set({
'boundary:circle:lat': clean['boundary.circle.lat'], 'boundary:circle:radius': clean['boundary.circle.radius'] + 'km'
'boundary:circle:lon': clean['boundary.circle.lon'], });
'boundary:circle:radius': defaults['boundary:circle:radius'] }
});
logStr += '[param:boundary_circle] '; logStr += '[param:boundary_circle] ';
} }

Loading…
Cancel
Save