This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Max radius for queryAtLocation() #72
Closed
Description
Through trial and error I've found that the max radius for which query results are returned is about 8587km. For bigger radiuses, onKeyEntered() is never called. Is that a bug? If not, how would I go about querying locations that are further apart? I'm using GeoFire 2.1.1 on Android.
@Test
public void queryAtLocation() throws InterruptedException {
double radius = 8589; // Fails
// double radius = 8587.8; //Passes
CountDownLatch latch = new CountDownLatch(1);
final boolean[] entered = {false};
geoFire.queryAtLocation(new GeoLocation(0, 0), radius)
.addGeoQueryEventListener(new GeoQueryEventListener() {
@Override
public void onKeyEntered(String key, GeoLocation location) {
entered[0] = true;
}
@Override
public void onKeyExited(String key) {
}
@Override
public void onKeyMoved(String key, GeoLocation location) {
}
@Override
public void onGeoQueryReady() {
latch.countDown();
}
@Override
public void onGeoQueryError(DatabaseError error) {
}
});
latch.await();
Assert.assertTrue(entered[0]);
}