Package Exports
- googlemaps
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (googlemaps) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Google Maps API for Node.js
A simple way to query the Google Maps API from Node.js
This was a quick hack to work with Node.js. Criticism/Suggestions/Patches/PullReq's welcome.
Installation
Installing npm (node package manager)
curl http://npmjs.org/install.sh | sh
Installing googlemaps
npm install googlemaps
Status
APIs implemented:
- Geocoding
- Directions
- Elevation
- Places (thx evnm)
TODO:
- Static Maps
- Tests for everything (using vows)
Usage
var gm = require('googlemaps');
var sys = require('sys');
gm.reverseGeocode('41.850033,-87.6500523', function(err, data){
sys.puts(JSON.stringify(data));
});
gm.reverseGeocode(gm.checkAndConvertPoint([41.850033, -87.6500523]), function(err, data){
sys.puts(JSON.stringify(data));
});
Both examples print: {"status":"OK","results":[{"types":["postal_code"],"formatted_address":"Chicago, IL 60695, USA"...
All the googlemaps functions follow this scheme: function(required, callback, optional)
All callbacks are expected to follow: function(error, results) Where the error returned is an Error object.
Please refer to the code, tests and the Google Maps API docs for further usage information.