Currently I am using node version 0.12.0. I wanted to switch to node version 4.0.0 but I doubt if mapnik works on higher version. Because in documentation they have specified it only for Node v0.10.x or v0.12.x.
It does work. I tested it on Ubuntu 14.04 64bit with NodeJS v4.2.6 and node-mapnik v3.4.16, these are the most current releases at this point. There are also a few discussions about NodeJS 4.x compatibility on the node-mapnik Github repository, it seems that the readme is just outdated.
I ran the following script to verify:
var mapnik = require('mapnik');
var fs = require('fs');
mapnik.register_default_input_plugins();
var map = new mapnik.Map(800, 600);
map.loadSync("map.xml");
map.zoomAll();
map.renderFileSync("out.png");
console.log(map);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.