Debian Codegraph @

test/qunit/find.js

raw symbols SCIP
1 QUnit.test( 'nothingToFind', function( assert ) {
2 var map = $('#map').geomap();
3
4 var geo = map.geomap( 'find', {
5 type: 'Point',
6 coordinates: [ -71, 40 ]
7 }, 1 );
8
9 assert.equal( geo.length, 0, "no features found (non were available)!" );
10 });
11
12 QUnit.asyncTest( "basicFind", function( assert ) {
13 var map = $('#map').geomap();
14
15 setTimeout( function() {
16 map.geomap( 'append', {
17 type: 'Point',
18 coordinates: [ -71, 40 ]
19 } );
20
21 var geo = map.geomap( 'find', {
22 type: 'Point',
23 coordinates: [ -71, 40 ]
24 }, 1 );
25
26 assert.equal( geo.length, 1, "Point found!" );
27 }, 32 );
28 });
29
30 QUnit.test( 'alwaysPass', function( assert ) {
31 assert.equal( '1', 1, "always pass!" );
32 });
33
34
35 /*
36 QUnit.test( "findTopFirst", function( assert ) {
37 // the last shape to be appended,
38 // should be the first to be found
39 var map = $('#map').geomap();
40
41 map.geomap( 'append', {
42 type: 'Feature',
43 geometry: {
44 type: 'Point',
45 coordinates: [ -71, 40 ]
46 },
47 properties: {
48 name: '1'
49 }
50 } );
51
52 var geo = map.geomap( 'find', {
53 type: 'Point',
54 coordinates: [ -71, 40 ]
55 }, 1 );
56
57 assert.equal( geo.length, 1, "Another Point found!" );
58 });
59 */