geocodr

1.1.6 • Public • Published

node-geocodr

this simple component allows for geocoding from various providers

Build Status XO code style

currently supported adapters

adapters

example usage

currently just returns an array of the form [lon, lat] or null if the address can't be geocoded

geocode single

import geocode, {nominatim} from 'geocodr'

geocode('10021', nominatim).then((coordinates)=>{
  // do stuff with coordinates
})

geocode multiple

import geocode, {geocodio} from 'geocodr'

geocode(['10021', '06067', '06108'], geocodio).then((coordinates)=>{
  // do stuff with coordinates (will be an array of [lon, lat] arrays in respective order)
})

override default

import geocode, {mapzen} from 'geocodr'

geocode('10021', {...mapzen, api_key: 'my-api-key'}).then((coordinates)=>{
  // do stuff with coordinates
})

Readme

Keywords

none

Package Sidebar

Install

npm i geocodr

Weekly Downloads

2

Version

1.1.6

License

ISC

Last publish

Collaborators

  • tony-kerz