Skip to content

Commit

Permalink
make note when to use JSDatasource vs MemoryDatasource
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Apr 13, 2011
1 parent 20942ce commit f1c3f3b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
10 changes: 8 additions & 2 deletions examples/js_datasource/osm_xapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
// * node-mapnik
// * node-get

// WARNING - mapnik.JSDatasource cannot be used with the async mapnik.render() (will hang)
// and only will work with mapnik.render_to_string() or mapnik.render_to_file()
/*
NOTE - maps using mapnik.JSDatasource can only be rendered with
mapnik.render_to_string() or mapnik.render_to_file() as the javascript
callback only works if the rendering happens in the main thread.
If you want async rendering using mapnik.render() then use the
mapnik.MemoryDatasource instead of mapnik.JSDatasource.
*/

var mapnik = require('mapnik');
var sys = require('fs');
Expand Down
12 changes: 11 additions & 1 deletion examples/js_datasource/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ javascript callback that leverages experimental javascript
datasource support
*/

// WARNING - mapnik.JSDatasource cannot be used with the async mapnik.render() (will hang)
/*
NOTE - maps using mapnik.JSDatasource can only be rendered with
mapnik.render_to_string() or mapnik.render_to_file() as the javascript
callback only works if the rendering happens in the main thread.
If you want async rendering using mapnik.render() then use the
mapnik.MemoryDatasource instead of mapnik.JSDatasource.
*/


cannot be used with the async mapnik.render() (will hang)
// and only will work with mapnik.render_to_string() or mapnik.render_to_file()

var mapnik = require('mapnik');
Expand Down
10 changes: 8 additions & 2 deletions examples/js_datasource/usgs_quakes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
// * node-mapnik
// * node-get

// WARNING - mapnik.JSDatasource cannot be used with the async mapnik.render() (will hang)
// and only will work with mapnik.render_to_string() or mapnik.render_to_file()
/*
NOTE - maps using mapnik.JSDatasource can only be rendered with
mapnik.render_to_string() or mapnik.render_to_file() as the javascript
callback only works if the rendering happens in the main thread.
If you want async rendering using mapnik.render() then use the
mapnik.MemoryDatasource instead of mapnik.JSDatasource.
*/

var mapnik = require('mapnik');
var sys = require('fs');
Expand Down

0 comments on commit f1c3f3b

Please sign in to comment.