0.6.18 • Published 8 years ago

tilelive-mapnik v0.6.18

Weekly downloads
556
License
-
Repository
-
Last release
8 years ago

tilelive-mapnik

Renderer backend for tilelive.js that uses node-mapnik to render tiles and grids from a Mapnik XML file. tilelive-mapnik implements the Tilesource API.

Build Status Build status

Installation

npm install tilelive-mapnik

Though tilelive is not a dependency of tilelive-mapnik you will want to install it to actually make use of tilelive-mapnik through a reasonable API.

Usage

var tilelive = require('tilelive');
require('tilelive-mapnik').registerProtocols(tilelive);

tilelive.load('mapnik:///path/to/file.xml', function(err, source) {
    if (err) throw err;

    // Interface is in XYZ/Google coordinates.
    // Use `y = (1 << z) - 1 - y` to flip TMS coordinates.
    source.getTile(0, 0, 0, function(err, tile, headers) {
        // `err` is an error object when generation failed, otherwise null.
        // `tile` contains the compressed image file as a Buffer
        // `headers` is a hash with HTTP headers for the image.
    });

    // The `.getGrid` is implemented accordingly.
});

Note that grid generation will only work when there's metadata inside a <Parameters> object in the Mapnik XML.

The key fields are interactivity_layer and interactivity_fields. See an example in the tests. These Parameters are normally added by the application that creates the XML, in this case CartoCSS

0.6.18

8 years ago

0.6.17

9 years ago

0.6.16

9 years ago

0.6.15

9 years ago

0.6.14

9 years ago

0.6.13

10 years ago

0.6.12

10 years ago

0.6.11

10 years ago

0.6.10

10 years ago

0.6.9

10 years ago

0.6.8

10 years ago

0.6.7

10 years ago

0.6.6

10 years ago

0.6.5

10 years ago

0.6.4

10 years ago

0.6.3

11 years ago

0.6.2

11 years ago

0.6.1

11 years ago

0.6.0

11 years ago

0.5.0

11 years ago

0.4.4

12 years ago

0.4.3

12 years ago

0.4.2

12 years ago

0.4.1

12 years ago

0.4.0

12 years ago

0.3.2

12 years ago

0.3.1

12 years ago

0.3.0

12 years ago

0.2.1

13 years ago

0.2.0

13 years ago

0.1.2

13 years ago

0.1.1

13 years ago

0.1.0

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago