API.md

February 11, 2018 · View on GitHub

Classes

GeoCode
Bing
Google
OpenStreet
OpenCage

GeoCode

Kind: global class

new GeoCode(options)

ParamTypeDescription
provider.stringdefault 'osm'. 'osm', 'google', 'bing', 'opencage'
optionsobjectfor each provider. api key as in 'key' is required for 'google', 'bing' and 'opencage'

geoCode.geolookup() ⇒ Promise

Kind: instance method of GeoCode
Returns: Promise - with an array format when successful

ParamTypeDescription
address.stringe.g. 'brampton, on'

geoCode.reverse(lat,, lng,) ⇒ Promise

Kind: instance method of GeoCode
Returns: Promise - with an object format when successful

ParamTypeDescription
lat,numberlatitude
lng,numberlatitude

Bing

Kind: global class

new Bing(options)

ParamTypeDescription
optionsobjectoptions for Bing geo lookup. e.g. {key: XXXXX, includeNeighbourhood: 1, maxResult: 50}

bing.geolookup() ⇒ Promise

Kind: instance method of Bing
Returns: Promise - with an array format when successful

ParamTypeDescription
address.stringe.g. 'brampton, on'

bing.reverse(lat,, lng,) ⇒ Promise

Kind: instance method of Bing
Returns: Promise - with an object format when successful

ParamTypeDescription
lat,numberlatitude
lng,numberlongitude

Google

Kind: global class

new Google(options)

ParamTypeDescription
optionsobjectoptions for Google geo lookup. e.g. {key: XXXXX, language: 'en-US'}

google.geolookup() ⇒ Promise

Kind: instance method of Google
Returns: Promise - with an array format when successful

ParamTypeDescription
address.stringe.g. 'brampton, on'

google.reverse(lat,, lng,) ⇒ Promise

Kind: instance method of Google
Returns: Promise - with an object format when successful

ParamTypeDescription
lat,numberlatitude
lng,numberlongitude

OpenStreet

Kind: global class

new OpenStreet(options)

ParamTypeDescription
optionsobjectoptions for OpenStreet geo lookup. e.g. {key: XXXXX, limit: 15, zoom: 18, addressdetail: 1, lang: 'en-US'}

openStreet.geolookup() ⇒ Promise

Kind: instance method of OpenStreet
Returns: Promise - with an array format when successful

ParamTypeDescription
address.stringe.g. 'brampton, on'

openStreet.reverse(lat,, lng,) ⇒ Promise

Kind: instance method of OpenStreet
Returns: Promise - with an object format when successful

ParamTypeDescription
lat,numberlatitude
lng,numberlatitude

OpenCage

Kind: global class

new OpenCage(options)

ParamTypeDescription
optionsobjectoptions for OpenCage geo lookup. e.g. {key: XXXXX, lang: 'en-US'}

openStreet.geolookup() ⇒ Promise

Kind: instance method of OpenCage Returns: Promise - with an array format when successful

ParamTypeDescription
address.stringe.g. 'brampton, on'

openStreet.reverse(lat, lng) ⇒ Promise

Kind: instance method of OpenCage Returns: Promise - with an object format when successful

ParamTypeDescription
lat,numberlatitude
lng,numberlatitude