omnigeo is a node.js library for geocoding addresses with pluggable services. There are no production dependencies outside of node.js itself. The current state of this library is very alpha. You have been warned.
Defaults to google:
var omnigeo = require('omnigeo')
omnigeo().geocode('New York, NY', function(res) {
console.log(res)
// { lat: 40.71, lng: -74.00 }
}
Defining a service:
omnigeo({service: 'mapquest'}).geocode('New York, NY', function(res) {
console.log(res)
// { lat: 40.71, lng: -74.00 }
}
- Bing
- DataScienceToolkit
- Geocoder.ca
- Google Maps
- Mapquest Open
- Nominatim (OpenStreetMaps geocoder)
- Yandex
Additional service adapters can be added to the services
object on the constructor:
var adapter = require('./my_adapter')
omnigeo.services['my api'] = adapter
omnigeo({service: 'my api'}).geocode('New York, NY', function(res) {
...
})
All adapters must be constructors that implement the buildUrl
and parseResponse
methods on their prototype.
If you have an interest in working on something or fixing a bug, file an issue.
BSD