Simple geocoding and location-based utilities
npm install locuplocup is a Node.js module for simple geocoding. Use it to get the coordinates for addresses and to get addresses for coordinates.
Currently, locup uses Google's geocoding API, but it's ready to be extended to multiple providers.
npm install locupProvide you API credentials as an environmental variable api_key
``javascript
var Locup = new require('locup')({api_key: "YOUR KEY"});
Locup.get_address(lat, long, function(err, address){
console.log(address);
return;
});
`
* geocode(address, callback) - Pass a geocoding object to callback
* get_coordinates(address, callback) - Pass an object to callback with lat and long`
* get_bounds(address, callback) - Pass bounds of a location to callback
* get_formatted_address(address, callback) - Pass human-readable, normalized address to callback
* get_components(address, callback) - Pass object of address components to callback
* reverse_geocode(lat, long, callback) - Pass a geocoding object to callback
* get_address(lat, long, callback) - Pass a human-readable, normalized address to callback
* get_address_components(lat, long, callback) - Pass object of address components to callback