Code Monkey home page Code Monkey logo

tilelive-vector's Introduction

tilelive-vector

Implements the tilelive API for rendering mapnik vector tiles to raster images.

Build Status

new Vector(options, callback)

  • xml: a Mapnik XML string that will be used to render vector tiles.
  • source: Optional, a uri string suitable for use with tilelive.load(). This is fallback source that will be used if no source is found as part of the Mapnik XML parameters.
  • base: Optional, basepath for Mapnik map. Defaults to __dirname.
  • format: Optional, target output format. Defaults to png8:m=h.
  • scale: Optional, Mapnik scale factor. Defaults to 1.
  • deflate: Optional, whether to expect deflated vector tiles. Defaults to true.
  • maxAge: Optional, length of time to hold vector tiles in memory cache. Defaults to 300e3 (300 seconds).
  • reap: Optional, time between reaps of vector tiles in memory cache. Defaults to 60e3 (60 seconds).

Code concepts

  • Backend z/x/y: a request for a raster tile at, say, 3/3/3 does not always mean 3/3/3 is requested from the backend source. The z/x/y requested from the backend source is referred in code by bz/bx/by and generally represent the same or lower zoom level. This allows for features like overzooming, maskLevel tiles, and scale factor adjustment.
  • Overzooming: if a tile beyond the maxzoom of the backend is requested, Vector will attempt to render the tile using the parent of the request at maxzoom.
  • maskLevel tiles: to avoid requiring many duplicate or empty vector tiles to be generated at high zoom levels, the backend source can specify a maskLevel. If a vector tile is not initially found at some z > maskLevel, Vector will issue an additional request to the backend using the parent tile of of the request at maskLevel. This allows a lower zoom level to "backfill" high zoom levels.
  • Scale factor adjustment: the scale argument decrements the backend zoom level such that the requested tile is the visual equivalent (when viewed on the proper dpi device) of its parent counterpart. For example, scale: 2 decrements bz by 1, scale: 4 decrements by 2, and so on.

tilelive-vector's People

Contributors

taketime avatar yhahn avatar willwhite avatar

Watchers

张宝才 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.