tessel-canvas-browser

canvas output for tessel in browsers

npm install tessel-canvas-browser
2 downloads in the last week
4 downloads in the last month

Canvas tiles for tessel, in a browser via browserify.

install

npm install --save tessel-canvas-browser

api

tesselCanvas(mapState, canvasElement, callback, crossOrigin)

Given a tessel map state and a canvas element from the DOM, download all necessary tiles and render them into the canvas, calling callback with any errors and the canvas element when finished.

crossOrigin is a boolean flag for whether images are loaded with CORS so that the resulting Canvas does not suffer from the same origin policy.

example

var tessel = require('tessel'),
    tesselCanvas = require('tessel-canvas-browser');

var map = tessel.map(),
    canvas = document.body.appendChild(document.createElement('canvas'));

canvas.width = 500;
canvas.height = 500;

tesselCanvas(map.state(), canvas);
npm loves you