Sha256: d2f70901b7609948db03804ccb7908e6763e6ac5fe7b9a387c705139ffa78b92

Contents?: true

Size: 894 Bytes

Versions: 3

Compression:

Stored size: 894 Bytes

Contents

L.TileLayer.Canvas = L.TileLayer.extend({
	options: {
		async: false
	},

	initialize: function (options) {
		L.Util.setOptions(this, options);
	},

	_createTileProto: function () {
		this._canvasProto = L.DomUtil.create('canvas', 'leaflet-tile');

		var tileSize = this.options.tileSize;
		this._canvasProto.width = tileSize;
		this._canvasProto.height = tileSize;
	},

	_createTile: function () {
		var tile = this._canvasProto.cloneNode(false);
		tile.onselectstart = tile.onmousemove = L.Util.falseFn;
		return tile;
	},

	_loadTile: function (tile, tilePoint, zoom) {
		tile._layer = this;

		this.drawTile(tile, tilePoint, zoom);

		if (!this.options.async) {
			this.tileDrawn(tile);
		}
	},

	drawTile: function (tile, tilePoint, zoom) {
		// override with rendering code
	},

	tileDrawn: function (tile) {
		this._tileOnLoad.call(tile);
	}
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
leaflet-ruby-0.3.beta4 lib/leaflet/src/layer/tile/TileLayer.Canvas.js
leaflet-ruby-0.3.beta3 lib/leaflet/src/layer/tile/TileLayer.Canvas.js
leaflet-ruby-0.3.beta1 lib/leaflet/src/layer/tile/TileLayer.Canvas.js