Permalink
Browse files

Change README examples to use util instead of sys

  • Loading branch information...
1 parent 26ccfee commit 664acb781787034d4e66a0a8499115a067c6e6a0 @moshen committed Dec 29, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 README.md
View
@@ -29,14 +29,14 @@ TODO:
# Usage
var gm = require('googlemaps');
- var sys = require('sys');
+ var util = require('util');
gm.reverseGeocode('41.850033,-87.6500523', function(err, data){
- sys.puts(JSON.stringify(data));
+ util.puts(JSON.stringify(data));
});
gm.reverseGeocode(gm.checkAndConvertPoint([41.850033, -87.6500523]), function(err, data){
- sys.puts(JSON.stringify(data));
+ util.puts(JSON.stringify(data));
});
Both examples print:
@@ -66,13 +66,13 @@ For the Static Maps API, you can pass in all the required parameters as well as
}
]
- sys.puts(gm.staticMap('444 W Main St Lock Haven PA', 15, '500x400', false, false, 'roadmap', markers, styles, paths));
+ util.puts(gm.staticMap('444 W Main St Lock Haven PA', 15, '500x400', false, false, 'roadmap', markers, styles, paths));
This example prints the URL for the Static Map image: "http://maps.googleapis.com/maps/api/staticmap?center=444%20W%20Main%20St%20Lock%20Haven%20PA&zoom=15&size=500x400&maptype=roadmap&markers=%7C300%20W%20Main%20St%20Lock%20Haven%2C%20PA&markers=%7Ccolor%3Ared%7Clabel%3AA%7Cicon%3Ahttp%3A%2F%2Fchart.apis.google.com%2Fchart%3Fchst%3Dd_map_pin_icon%26chld%3Dcafe%257C996600%7Cshadow%3Afalse%7C444%20W%20Main%20St%20Lock%20Haven%2C%20PA&style=%7Cfeature%3Aroad%7Celement%3Aall%7Chue%3A0x00ff00&path=weight%3A5%7Ccolor%3A0x0000ff%7C41.139817%2C-77.454439%7C41.138621%2C-77.451596&sensor=false"
By giving gm.staticMap an optional callback, you can retreive the static map PNG data:
- sys.puts(gm.staticMap('444 W Main St Lock Haven PA', 15, '500x400', function(err, data){
+ util.puts(gm.staticMap('444 W Main St Lock Haven PA', 15, '500x400', function(err, data){
require('fs').writeFileSync('test_map.png', data, 'binary');
}, false, 'roadmap', markers, styles, paths));

0 comments on commit 664acb7

Please sign in to comment.