diff options
Diffstat (limited to 'platform')
-rwxr-xr-x | platform/node/examples/load-from-fs.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/platform/node/examples/load-from-fs.js b/platform/node/examples/load-from-fs.js deleted file mode 100755 index f8c072d4b5..0000000000 --- a/platform/node/examples/load-from-fs.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node -/* jshint node: true, unused: false */ -'use strict'; - -var mbgl = require('../../..'); -var fs = require('fs'); -var path = require('path'); -var PNG = require('pngjs').PNG; - -var base = path.join(__dirname, '../test'); - -var map = new mbgl.Map({ - request: function(req) { - fs.readFile(path.join(base, req.url), function(err, data) { - req.respond(err, { data: data }); - }); - }, - ratio: 1.0 -}); - -map.load(require('../test/fixtures/style.json')); - -map.render({}, function(err, data) { - if (err) throw err; - - var png = new PNG({ - width: data.width, - height: data.height - }); - - png.data = data.pixels; - - png.pack() - .pipe(fs.createWriteStream('image.png')) - .on('finish', function() { - console.warn('Written image.png'); - }); -}); |