update example with compressPNG

This commit is contained in:
Mike Morris
2015-02-26 14:35:39 -05:00
parent fc6f0dda14
commit 848fa663a6
2 changed files with 6 additions and 3 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/build
/lib
/node_modules
/test/results
/test/results
image.png

View File

@@ -22,6 +22,8 @@ var map = new mbgl.Map(fileSource);
map.load(require('../test/fixtures/style.json'));
map.render({}, function(err, image) {
if (err) throw err;
fs.writeFileSync('image.png', image);
console.warn('Written image.png');
mbgl.compressPNG(image, function(err, png) {
fs.writeFileSync('image.png', png);
console.warn('Written image.png');
});
});