Giter Club home page Giter Club logo

node-mapnik's Introduction

Node-Mapnik

Bindings to the Mapnik tile rendering library for node.

var mapnik = require('mapnik');
var http = require('http');

var port = 8000;

http.createServer(function (req, res) {
  var map = new mapnik.Map(256,256);
  map.load("./examples/stylesheet.xml");
  map.zoom_all();
  map.render(map.extent(),"png",function(err,buffer){
      if (err) {
        res.writeHead(500, {'Content-Type':'text/plain'});
        res.end(err.message);
      } else {
        res.writeHead(200, {'Content-Type':'image/png'});
        res.end(buffer);
      }
  });
}).listen(port);

For more see 'examples/'

Development Status

Prototype at this point, API will be frequently changing.

Developed on OS X (10.6)

Tested on Debian Squeeze and Centos 5.4.

Depends

node (development headers)

mapnik (latest trunk >r2397)

node-pool for some examples (npm install generic-pool)

Installation

Install node-mapnik:

$ git clone git://github.com/mapnik/node-mapnik.git
$ cd node-mapnik
$ ./configure
$ make
$ sudo make install
$ node test.js

Make sure the node modules is on your path:

export NODE_PATH=/usr/local/lib/node/

For more details see 'docs/install.txt'

Or you can install via npm:

$ npm install mapnik

Quick rendering test

To see if things are working try rendering a world map with the sample data

From the source checkout root do:

$ examples/render.js examples/stylesheet.xml map.png

Examples

See the 'examples/' folder for more usage examples.

License

BSD, see LICENSE.txt

node-mapnik's People

Contributors

kkaefer avatar

Stargazers

Christian Hochfilzer avatar

Watchers

Christian Hochfilzer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.