Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tilelive

Package Overview
Dependencies
Maintainers
0
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tilelive

TileLive

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82
increased by290.48%
Maintainers
0
Weekly downloads
 
Created
Source

tilelive.js

tilelive.js is a tile server for node.js which supports on-the-fly configuration and advanced interaction output. It's powered by Mapnik and can be used to add a tile server to an existing web application or wrapped with a light standalone web tile server.

Examples

See examples/server.js for an example tile server that leverages Express as its web framework.

Requirements

Usage

var express = require('express'),
    Tile = require('tilelive').Tile,
    app = express.createServer();

app.get('/:scheme/:mapfile_64/:z/:x/:y.*', function(req, res) {
    /*
     * scheme: (xyz|tms|tile (tms))
     *
     * format:
     * - Tile: (png|jpg)
     * - Data Tile: (geojson)
     * - Grid Tile: (*.grid.json)
     */
    try {
        var tile = new Tile({
            scheme: req.params.scheme,
            mapfile: req.params.mapfile_64,
            xyz: [
                req.params.x,
                req.params.z,
                req.params.y],
            format: req.params[0],
            mapfile_dir: '/tmp/mapfiles'
        });
    } catch (err) {
        res.send('Tile invalid: ' + err.message);
    }

    tile.render(function(err, data) {
        if (!err) {
            res.send.apply(res, data);
        } else {
            res.send('Tile rendering error: ' + err);
        }
    });
});

Keywords

FAQs

Package last updated on 04 Feb 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc