Skip to content

Instantly share code, notes, and snippets.

@programscode
programscode / TileLayer.GeoJSON.js
Created March 24, 2020 09:05 — forked from glenrobertson/TileLayer.GeoJSON.js
Leaflet GeoJSON Tile Layer Example
// Load data tiles from an AJAX data source
L.TileLayer.Ajax = L.TileLayer.extend({
_requests: [],
_addTile: function (tilePoint) {
var tile = { datum: null, processed: false };
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile;
this._loadTile(tile, tilePoint);
},
// XMLHttpRequest handler; closure over the XHR object, the layer, and the tile
_xhrHandler: function (req, layer, tile, tilePoint) {