1.0.4 • Published 6 years ago

leaflet.canvas v1.0.4

Weekly downloads
19
License
-
Repository
github
Last release
6 years ago

Intro

NOTE: NPM package works with Leaflet 1.3.1, repo still only comptible with Leaflet 0.6.4

Leaflet.CanvasLayer is a full map canvas layer that allows you to render stuff on top of a map with HTML5 canvas element. Leaflet provides a tiled canvas layer which provides one canvas per tile to render. Some things require a single canvas to render them properly.

see a running example: http://cartodb.github.io/Leaflet.CanvasLayer/example.html

how to use

just subclass it and override render method

var MyLayer = L.CanvasLayer.extend({
    render: function() {
        var canvas = this.getCanvas();
        var ctx = canvas.getContext('2d');
        // render
    }
});


// create and add to the map
var layer = new MyLayer();
layer.addTo(map);

if you are creating an animation just use redraw method to schedule a canvas refresh

example

license

MIT

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago