npm.io
2.0.2 • Published 10 years ago

geolocation-distances

Licence
ISC
Version
2.0.2
Deps
0
Vulns
0
Weekly
0

Members

Constant

Functions

getDistance(location1, location2) ⇒ Number

Find distance between two geolocations.

getNearLocationsBorder(center, distance) ⇒ Object

Find lat/lng min/max within given distance.

getNearLocations(center, results, distance) ⇒ Array.<Object>

Filter lat/lng by getDistance, so that only the cirle area matches stay.

Constant

Kind: global variable
Summary: A singleton exposing common geolocation methods related to distances.
Author: Vidul Nikolaev Petrov

getDistance(location1, location2) ⇒ Number

Find distance between two geolocations.

Kind: global function
Returns: Number - kilometers

Param Type Description
location1 Object the 1st geolocation
location2 Object the 2nd geolocation

getNearLocationsBorder(center, distance) ⇒ Object

Find lat/lng min/max within given distance.

Kind: global function
Returns: Object - min/max latitude and min/max longitude

Param Type Description
center Object the center object with lat/lng
distance Number distance in kilometers

getNearLocations(center, results, distance) ⇒ Array.<Object>

Filter lat/lng by getDistance, so that only the cirle area matches stay.

Kind: global function

Param Type Description
center Object the center object with lat/lng
results Array.<data> all lat/lng within the square
distance Number distance in kilometers

Keywords