1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | var focus = { lat: 51.5, lon: -0.06 };
|
9 |
|
10 | var query = require('../index'),
|
11 | vs = new query.Vars( query.defaults );
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | var q = new query.layout.FilteredBooleanQuery()
|
19 | .filter( query.view.boundary_circle )
|
20 | .sort( query.view.sort_distance );
|
21 |
|
22 |
|
23 | vs.var('size', 1);
|
24 |
|
25 |
|
26 | vs.set({
|
27 | 'boundary:circle:lat': focus.lat,
|
28 | 'boundary:circle:lon': focus.lon,
|
29 | 'boundary:circle:radius': '5km'
|
30 | });
|
31 |
|
32 |
|
33 | vs.set({
|
34 | 'focus:point:lat': focus.lat,
|
35 | 'focus:point:lon': focus.lon
|
36 | });
|
37 |
|
38 |
|
39 | var rendered = q.render( vs );
|
40 | console.log( JSON.stringify( rendered, null, 2 ) ); |
\ | No newline at end of file |