Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 5300488

Browse files
jingsammikemorris
authored andcommitted
Update README.md
1 parent 389c761 commit 5300488

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

platform/node/README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,25 @@ npm run test-suite
2929
## Rendering a map tile
3030

3131
```js
32+
var fs = require('fs');
33+
var path = require('path');
3234
var mbgl = require('mapbox-gl-native');
3335
var sharp = require('sharp');
34-
var map = new mbgl.Map({ request: function() {} });
36+
37+
var options = {
38+
request: function(req, callback) {
39+
fs.readFile(path.join(__dirname, 'test', req.url), function(err, data) {
40+
callback(err, { data: data });
41+
});
42+
},
43+
ratio: 1
44+
};
45+
46+
var map = new mbgl.Map(options);
3547

3648
map.load(require('./test/fixtures/style.json'));
3749

38-
map.render({}, function(err, buffer) {
50+
map.render({zoom: 0}, function(err, buffer) {
3951
if (err) throw err;
4052

4153
map.release();

0 commit comments

Comments
 (0)