geocoder


License
ISC
Install
npm install geocodr@1.1.3

Documentation

geocodr

this simple component allows for geocoding from various providers

Build Status

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
})