shape rendering in nodejs with LearnBoost's node-canvas
✓ Published0🌍 Public
RRandomEtc
Last edited Nov 9, 2010
Created on Nov 9, 2010
This example demonstrates dynamic, tile-based map rendering in Node.js using LearnBoost's node-canvas library. It projects GeoJSON feature coordinates onto a spherical Mercator grid and serves individual 256x256 pixel tiles over HTTP. The code loads multiple geographic layers, such as park boundaries, water bodies, and street centerlines from naturalearthdata.com or datasf.org, applies fill and stroke styles, and caches rendered canvases for reuse. It uses the canvas context's `moveTo`, `lineTo`, `scale`, and `translate` methods to draw the parsed geometries, then streams PNG output to the client.
AI-generated description