2.0.2 • Published 9 years ago

geolocation-distances v2.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 years ago

Members

Functions

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

ParamTypeDescription
location1Objectthe 1st geolocation
location2Objectthe 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

ParamTypeDescription
centerObjectthe center object with lat/lng
distanceNumberdistance in kilometers

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

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

Kind: global function

ParamTypeDescription
centerObjectthe center object with lat/lng
resultsArray.<data>all lat/lng within the square
distanceNumberdistance in kilometers
2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago