Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to get list of objects in the area? #57

Closed
Moonrise1275 opened this issue Nov 16, 2014 · 1 comment
Closed

Is it possible to get list of objects in the area? #57

Moonrise1275 opened this issue Nov 16, 2014 · 1 comment

Comments

@Moonrise1275
Copy link

with geofire?
I mean existing objects. not a new/removed/moved one.

@jwngr
Copy link

jwngr commented Nov 16, 2014

Hey @Moonrise1275 - if I understand you correctly, you essentially just want to get all keys which are currently in an area and not listen for added/removed keys. You can do this using a combination of the "key_entered" and "ready" events:

var onReadyRegistration = geoQuery.on("ready", function() {
  console.log("GeoQuery has loaded and fired all other events for initial data");

  // Cancel the "key_entered" callback
  onKeyEnteredRegistration.cancel();
});

var onKeyEnteredRegistration = geoQuery.on("key_entered", function(key, location, distance) {
  console.log(key + " is in the query at " + location + " (" + distance + " km from center)");
});

@jwngr jwngr closed this as completed Nov 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants