store data with a given lat/long pair and retrieve all the entries given a lat/long pair and a radius in that radius. the module uses google's s2 library in node.
var level = ;var nearby = ;var db = ;db;db;
var nearby = ;
db the be able to perform the
createNearStream methods on it.
options can have a
prefix field, than the methods will have that prefix.
db with a key that represents the given latitude (
lat) and longitude (
keyObj can have a
customId than that makes the key unique. By default the customId is a timestamp. If
keyObj is a String it falls back to the default
callback's second argument after the
error is the key String which it was saved with.
retrieves the entries in
db that are in the
radius of the
lng pair. returns a read stream with the results.
radius is measured in meters. In the retrieved
data object there is a
_nearby field besides
value, containing a
npm install level-nearby