Script and makefile adjustments for updating extlib
[larjonas-mediagoblin.git] / extlib / leaflet / src / layer / tile / TileLayer.Canvas.js
blob08bbaae2534daf78c90d36924eb8661fe7794145
1 L.TileLayer.Canvas = L.TileLayer.extend({
2 options: {
3 async: false
4 },
6 initialize: function(options) {
7 L.Util.setOptions(this, options);
8 },
10 _createTileProto: function() {
11 this._canvasProto = L.DomUtil.create('canvas', 'leaflet-tile');
13 var tileSize = this.options.tileSize;
14 this._canvasProto.width = tileSize;
15 this._canvasProto.height = tileSize;
18 _createTile: function() {
19 var tile = this._canvasProto.cloneNode(false);
20 tile.onselectstart = tile.onmousemove = L.Util.falseFn;
21 return tile;
24 _loadTile: function(tile, tilePoint, zoom) {
25 tile._layer = this;
27 this.drawTile(tile, tilePoint, zoom);
29 if (!this.options.async) {
30 this.tileDrawn(tile);
34 drawTile: function(tile, tilePoint, zoom) {
35 // override with rendering code
38 tileDrawn: function(tile) {
39 this._tileOnLoad.call(tile);
41 });