Skip to content

Commit

Permalink
Change README examples to use util instead of sys
Browse files Browse the repository at this point in the history
  • Loading branch information
moshen committed Dec 29, 2011
1 parent 26ccfee commit 664acb7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -29,14 +29,14 @@ TODO:


# Usage # Usage
var gm = require('googlemaps'); var gm = require('googlemaps');
var sys = require('sys'); var util = require('util');


gm.reverseGeocode('41.850033,-87.6500523', function(err, data){ 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){ gm.reverseGeocode(gm.checkAndConvertPoint([41.850033, -87.6500523]), function(err, data){
sys.puts(JSON.stringify(data)); util.puts(JSON.stringify(data));
}); });


Both examples print: Both examples print:
Expand Down Expand Up @@ -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" 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: 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'); require('fs').writeFileSync('test_map.png', data, 'binary');
}, false, 'roadmap', markers, styles, paths)); }, false, 'roadmap', markers, styles, paths));


Expand Down

0 comments on commit 664acb7

Please sign in to comment.