@@ -73,7 +73,7 @@ describe('Geo Point', () => {
73
73
let query = new Parse . Query ( TestObject ) ;
74
74
let point = new Parse . GeoPoint ( 24 , 19 ) ;
75
75
query . equalTo ( 'construct' , 'line' ) ;
76
- query . withinMiles ( 'location' , point , 10000 ) ;
76
+ query . withinMiles ( 'location' , point , 10000 , true ) ;
77
77
return query . find ( ) ;
78
78
} ) . then ( ( results ) => {
79
79
assert . equal ( results . length , 10 ) ;
@@ -97,7 +97,7 @@ describe('Geo Point', () => {
97
97
let query = new Parse . Query ( TestObject ) ;
98
98
let point = new Parse . GeoPoint ( 1 , - 1 ) ;
99
99
query . equalTo ( 'construct' , 'large_dist' ) ;
100
- query . withinRadians ( 'location' , point , 3.14 ) ;
100
+ query . withinRadians ( 'location' , point , 3.14 , true ) ;
101
101
return query . find ( ) ;
102
102
} ) . then ( ( results ) => {
103
103
assert . equal ( results . length , 3 ) ;
@@ -119,7 +119,7 @@ describe('Geo Point', () => {
119
119
let query = new Parse . Query ( TestObject ) ;
120
120
let point = new Parse . GeoPoint ( 1 , - 1 ) ;
121
121
query . equalTo ( 'construct' , 'medium_dist' ) ;
122
- query . withinRadians ( 'location' , point , 3.14 * 0.5 ) ;
122
+ query . withinRadians ( 'location' , point , 3.14 * 0.5 , true ) ;
123
123
return query . find ( ) ;
124
124
} ) . then ( ( results ) => {
125
125
assert . equal ( results . length , 2 ) ;
@@ -143,7 +143,7 @@ describe('Geo Point', () => {
143
143
let query = new Parse . Query ( TestObject ) ;
144
144
let point = new Parse . GeoPoint ( 1 , - 1 ) ;
145
145
query . equalTo ( 'construct' , 'small_dist' ) ;
146
- query . withinRadians ( 'location' , point , 3.14 * 0.25 ) ;
146
+ query . withinRadians ( 'location' , point , 3.14 * 0.25 , true ) ;
147
147
return query . find ( ) ;
148
148
} ) . then ( ( results ) => {
149
149
assert . equal ( results . length , 1 ) ;
@@ -155,7 +155,7 @@ describe('Geo Point', () => {
155
155
it ( 'can measure distance within km - everywhere' , ( done ) => {
156
156
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
157
157
let query = new Parse . Query ( TestPoint ) ;
158
- query . withinKilometers ( 'location' , sfo , 4000.0 ) ;
158
+ query . withinKilometers ( 'location' , sfo , 4000.0 , true ) ;
159
159
query . find ( ) . then ( ( results ) => {
160
160
assert . equal ( results . length , 3 ) ;
161
161
done ( ) ;
@@ -165,7 +165,7 @@ describe('Geo Point', () => {
165
165
it ( 'can measure distance within km - california' , ( done ) => {
166
166
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
167
167
let query = new Parse . Query ( TestPoint ) ;
168
- query . withinKilometers ( 'location' , sfo , 3700.0 ) ;
168
+ query . withinKilometers ( 'location' , sfo , 3700.0 , true ) ;
169
169
query . find ( ) . then ( ( results ) => {
170
170
assert . equal ( results . length , 2 ) ;
171
171
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -177,7 +177,7 @@ describe('Geo Point', () => {
177
177
it ( 'can measure distance within km - bay area' , ( done ) => {
178
178
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
179
179
let query = new Parse . Query ( TestPoint ) ;
180
- query . withinKilometers ( 'location' , sfo , 100.0 ) ;
180
+ query . withinKilometers ( 'location' , sfo , 100.0 , true ) ;
181
181
query . find ( ) . then ( ( results ) => {
182
182
assert . equal ( results . length , 1 ) ;
183
183
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -188,7 +188,7 @@ describe('Geo Point', () => {
188
188
it ( 'can measure distance within km - mid peninsula' , ( done ) => {
189
189
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
190
190
let query = new Parse . Query ( TestPoint ) ;
191
- query . withinKilometers ( 'location' , sfo , 10.0 ) ;
191
+ query . withinKilometers ( 'location' , sfo , 10.0 , true ) ;
192
192
query . find ( ) . then ( ( results ) => {
193
193
assert . equal ( results . length , 0 ) ;
194
194
done ( ) ;
@@ -198,7 +198,7 @@ describe('Geo Point', () => {
198
198
it ( 'can measure distance within miles - everywhere' , ( done ) => {
199
199
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
200
200
let query = new Parse . Query ( TestPoint ) ;
201
- query . withinMiles ( 'location' , sfo , 2500.0 ) ;
201
+ query . withinMiles ( 'location' , sfo , 2500.0 , true ) ;
202
202
query . find ( ) . then ( ( results ) => {
203
203
assert . equal ( results . length , 3 ) ;
204
204
done ( ) ;
@@ -208,7 +208,7 @@ describe('Geo Point', () => {
208
208
it ( 'can measure distance within miles - california' , ( done ) => {
209
209
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
210
210
let query = new Parse . Query ( TestPoint ) ;
211
- query . withinMiles ( 'location' , sfo , 2200.0 ) ;
211
+ query . withinMiles ( 'location' , sfo , 2200.0 , true ) ;
212
212
query . find ( ) . then ( ( results ) => {
213
213
assert . equal ( results . length , 2 ) ;
214
214
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -220,7 +220,7 @@ describe('Geo Point', () => {
220
220
it ( 'can measure distance within miles - bay area' , ( done ) => {
221
221
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
222
222
let query = new Parse . Query ( TestPoint ) ;
223
- query . withinMiles ( 'location' , sfo , 75.0 ) ;
223
+ query . withinMiles ( 'location' , sfo , 75.0 , true ) ;
224
224
query . find ( ) . then ( ( results ) => {
225
225
assert . equal ( results . length , 1 ) ;
226
226
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -231,7 +231,7 @@ describe('Geo Point', () => {
231
231
it ( 'can measure distance within km - mid peninsula' , ( done ) => {
232
232
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
233
233
let query = new Parse . Query ( TestPoint ) ;
234
- query . withinMiles ( 'location' , sfo , 10.0 ) ;
234
+ query . withinMiles ( 'location' , sfo , 10.0 , true ) ;
235
235
query . find ( ) . then ( ( results ) => {
236
236
assert . equal ( results . length , 0 ) ;
237
237
done ( ) ;
@@ -252,7 +252,7 @@ describe('Geo Point', () => {
252
252
let query = new Parse . Query ( TestObject ) ;
253
253
let point = new Parse . GeoPoint ( 1 , - 1 ) ;
254
254
query . equalTo ( 'construct' , 'large_dist' ) ;
255
- query . withinRadiansUnsorted ( 'location' , point , 3.14 ) ;
255
+ query . withinRadians ( 'location' , point , 3.14 , false ) ;
256
256
return query . find ( ) ;
257
257
} ) . then ( ( results ) => {
258
258
assert . equal ( results . length , 3 ) ;
@@ -274,7 +274,7 @@ describe('Geo Point', () => {
274
274
let query = new Parse . Query ( TestObject ) ;
275
275
let point = new Parse . GeoPoint ( 1 , - 1 ) ;
276
276
query . equalTo ( 'construct' , 'medium_dist' ) ;
277
- query . withinRadiansUnsorted ( 'location' , point , 3.14 * 0.5 ) ;
277
+ query . withinRadians ( 'location' , point , 3.14 * 0.5 , false ) ;
278
278
return query . find ( ) ;
279
279
} ) . then ( ( results ) => {
280
280
assert . equal ( results . length , 2 ) ;
@@ -298,7 +298,7 @@ describe('Geo Point', () => {
298
298
let query = new Parse . Query ( TestObject ) ;
299
299
let point = new Parse . GeoPoint ( 1 , - 1 ) ;
300
300
query . equalTo ( 'construct' , 'small_dist' ) ;
301
- query . withinRadiansUnsorted ( 'location' , point , 3.14 * 0.25 ) ;
301
+ query . withinRadians ( 'location' , point , 3.14 * 0.25 , false ) ;
302
302
return query . find ( ) ;
303
303
} ) . then ( ( results ) => {
304
304
assert . equal ( results . length , 1 ) ;
@@ -310,7 +310,7 @@ describe('Geo Point', () => {
310
310
it ( 'can measure distance within km unsorted - everywhere' , ( done ) => {
311
311
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
312
312
let query = new Parse . Query ( TestPoint ) ;
313
- query . withinKilometersUnsorted ( 'location' , sfo , 4000.0 ) ;
313
+ query . withinKilometers ( 'location' , sfo , 4000.0 , false ) ;
314
314
query . find ( ) . then ( ( results ) => {
315
315
assert . equal ( results . length , 3 ) ;
316
316
done ( ) ;
@@ -320,7 +320,7 @@ describe('Geo Point', () => {
320
320
it ( 'can measure distance within km unsorted - california' , ( done ) => {
321
321
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
322
322
let query = new Parse . Query ( TestPoint ) ;
323
- query . withinKilometersUnsorted ( 'location' , sfo , 3700.0 ) ;
323
+ query . withinKilometers ( 'location' , sfo , 3700.0 , false ) ;
324
324
query . find ( ) . then ( ( results ) => {
325
325
assert . equal ( results . length , 2 ) ;
326
326
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -332,7 +332,7 @@ describe('Geo Point', () => {
332
332
it ( 'can measure distance within km unsorted - bay area' , ( done ) => {
333
333
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
334
334
let query = new Parse . Query ( TestPoint ) ;
335
- query . withinKilometersUnsorted ( 'location' , sfo , 100.0 ) ;
335
+ query . withinKilometers ( 'location' , sfo , 100.0 , false ) ;
336
336
query . find ( ) . then ( ( results ) => {
337
337
assert . equal ( results . length , 1 ) ;
338
338
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -343,7 +343,7 @@ describe('Geo Point', () => {
343
343
it ( 'can measure distance within km unsorted - mid peninsula' , ( done ) => {
344
344
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
345
345
let query = new Parse . Query ( TestPoint ) ;
346
- query . withinKilometersUnsorted ( 'location' , sfo , 10.0 ) ;
346
+ query . withinKilometers ( 'location' , sfo , 10.0 , false ) ;
347
347
query . find ( ) . then ( ( results ) => {
348
348
assert . equal ( results . length , 0 ) ;
349
349
done ( ) ;
@@ -353,7 +353,7 @@ describe('Geo Point', () => {
353
353
it ( 'can measure distance within miles unsorted - everywhere' , ( done ) => {
354
354
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
355
355
let query = new Parse . Query ( TestPoint ) ;
356
- query . withinMilesUnsorted ( 'location' , sfo , 2500.0 ) ;
356
+ query . withinMiles ( 'location' , sfo , 2500.0 , false ) ;
357
357
query . find ( ) . then ( ( results ) => {
358
358
assert . equal ( results . length , 3 ) ;
359
359
done ( ) ;
@@ -363,7 +363,7 @@ describe('Geo Point', () => {
363
363
it ( 'can measure distance within miles unsorted - california' , ( done ) => {
364
364
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
365
365
let query = new Parse . Query ( TestPoint ) ;
366
- query . withinMilesUnsorted ( 'location' , sfo , 2200.0 ) ;
366
+ query . withinMiles ( 'location' , sfo , 2200.0 , false ) ;
367
367
query . find ( ) . then ( ( results ) => {
368
368
assert . equal ( results . length , 2 ) ;
369
369
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -375,7 +375,7 @@ describe('Geo Point', () => {
375
375
it ( 'can measure distance within miles unsorted - bay area' , ( done ) => {
376
376
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
377
377
let query = new Parse . Query ( TestPoint ) ;
378
- query . withinMilesUnsorted ( 'location' , sfo , 75.0 ) ;
378
+ query . withinMiles ( 'location' , sfo , 75.0 , false ) ;
379
379
query . find ( ) . then ( ( results ) => {
380
380
assert . equal ( results . length , 1 ) ;
381
381
assert . equal ( results [ 0 ] . get ( 'name' ) , 'San Francisco' ) ;
@@ -386,7 +386,7 @@ describe('Geo Point', () => {
386
386
it ( 'can measure distance within km unsorted - mid peninsula' , ( done ) => {
387
387
let sfo = new Parse . GeoPoint ( 37.6189722 , - 122.3748889 ) ;
388
388
let query = new Parse . Query ( TestPoint ) ;
389
- query . withinMilesUnsorted ( 'location' , sfo , 10.0 ) ;
389
+ query . withinMiles ( 'location' , sfo , 10.0 , false ) ;
390
390
query . find ( ) . then ( ( results ) => {
391
391
assert . equal ( results . length , 0 ) ;
392
392
done ( ) ;
0 commit comments