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

Loading…
Cancel
Save