Canvas tiles for tessel, in a browser via browserify.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
index.js
package.json

README.md

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);