public class GeoFire extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
GeoFire.CompletionListener
A listener that can be used to be notified about a successful write or an error on writing.
|
Constructor and Description |
---|
GeoFire(com.firebase.client.Firebase firebase)
Creates a new GeoFire instance at the given Firebase reference.
|
Modifier and Type | Method and Description |
---|---|
com.firebase.client.Firebase |
getFirebase() |
void |
getLocation(String key,
LocationCallback callback)
Gets the current location for a key and calls the callback with the current value.
|
GeoQuery |
queryAtLocation(GeoLocation center,
double radius)
Returns a new Query object centered at the given location and with the given radius.
|
void |
removeLocation(String key)
Removes the location for a key from this GeoFire.
|
void |
removeLocation(String key,
GeoFire.CompletionListener completionListener)
Removes the location for a key from this GeoFire.
|
void |
setLocation(String key,
GeoLocation location)
Sets the location for a given key.
|
void |
setLocation(String key,
GeoLocation location,
GeoFire.CompletionListener completionListener)
Sets the location for a given key.
|
public GeoFire(com.firebase.client.Firebase firebase)
firebase
- The Firebase reference this GeoFire instance usespublic com.firebase.client.Firebase getFirebase()
public void setLocation(String key, GeoLocation location)
key
- The key to save the location forlocation
- The location of this keypublic void setLocation(String key, GeoLocation location, GeoFire.CompletionListener completionListener)
key
- The key to save the location forlocation
- The location of this keycompletionListener
- A listener that is called once the location was successfully saved on the server or an
error occurredpublic void removeLocation(String key)
key
- The key to remove from this GeoFirepublic void removeLocation(String key, GeoFire.CompletionListener completionListener)
key
- The key to remove from this GeoFirecompletionListener
- A completion listener that is called once the location is successfully removed
from the server or an error occurredpublic void getLocation(String key, LocationCallback callback)
key
- The key whose location to getcallback
- The callback that is called once the location is retrievedpublic GeoQuery queryAtLocation(GeoLocation center, double radius)
center
- The center of the queryradius
- The radius of the query, in kilometersCopyright © 2015 Firebase. All rights reserved.