gocoder

3.0.0 • Public • Published

gocoder

A node module that uses Google's Geocoding API to return latitude and longitude

Getting Started

  1. Install geocodr and save it to your project. npm install --save 'gocoder'
  2. Obtain a Google Geocoding API key: Getting an API key

Sample Usage

var Geocoder = require('gocoder').Geocoder;

let geo = new Geocoder(YOUR_API_KEY_HERE);

geo.geocode(process.argv[2] || 'San Juan, PR', function(err, coordinates) {
	if (err) { console.error('ERROR: ' + err); }

	console.log(coordinates);
});

geo.reverseGeocode(process.argv[3] || '18.465540', process.argv[4] || '-66.105736', function(err, address) {
	if (err) { console.error('ERROR: ' + err); }

	console.log(address);
});

Package Sidebar

Install

npm i gocoder

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

4.64 kB

Total Files

4

Last publish

Collaborators

  • otolock