Skip to content

Latest commit

 

History

History
211 lines (149 loc) · 6.2 KB

API.md

File metadata and controls

211 lines (149 loc) · 6.2 KB

Classes

GeoCode
Bing
Google
OpenStreet
OpenCage

GeoCode

Kind: global class

new GeoCode(options)

Param Type Description
provider. string default 'osm'. 'osm', 'google', 'bing', 'opencage'
options object for 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

Param Type Description
address. string e.g. 'brampton, on'

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

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

Param Type Description
lat, number latitude
lng, number latitude

Bing

Kind: global class

new Bing(options)

Param Type Description
options object options 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

Param Type Description
address. string e.g. 'brampton, on'

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

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

Param Type Description
lat, number latitude
lng, number longitude

Google

Kind: global class

new Google(options)

Param Type Description
options object options 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

Param Type Description
address. string e.g. 'brampton, on'

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

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

Param Type Description
lat, number latitude
lng, number longitude

OpenStreet

Kind: global class

new OpenStreet(options)

Param Type Description
options object options 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

Param Type Description
address. string e.g. 'brampton, on'

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

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

Param Type Description
lat, number latitude
lng, number latitude

OpenCage

Kind: global class

new OpenCage(options)

Param Type Description
options object options 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

Param Type Description
address. string e.g. 'brampton, on'

openStreet.reverse(lat, lng) ⇒ Promise

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

Param Type Description
lat, number latitude
lng, number latitude