Skip to content

Instantly share code, notes, and snippets.

View apollolm's full-sized avatar

Ryan Whitley apollolm

View GitHub Profile
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);
@apollolm
apollolm / gist:8720143
Last active August 29, 2015 13:55 — forked from fnicollet/gist:5764080
DynamicSingleTile is similar to SingleTileWMS overlay for Leaflet map framework, except that it's requesting images from a custom Node.js map server built with mapnik (Chubbs Spatial Server/PGRestAPI)
/*
* from - https://gist.github.com/fnicollet/5764080
* Modified by Ryan Whitley - Jan 30, 2013
* L.DynamicSingleTile uses L.ImageOverlay to display a single-tile layer from node-mapnik.
* url parameter must accept width, height and bbox.
*/
L.DynamicSingleTile = L.ImageOverlay.extend({
initialize: function (url, bounds, options) { // (String, Object)
@apollolm
apollolm / SingleTile.js
Last active December 31, 2015 02:29 — forked from Zverik/SingleTile.js
Use this with Leaflet map API to request a single dynamic tile to be generated when user stops panning. Request is made to PGRestAPI (Chubbs Spatial Server)
/*
* from - https://gist.github.com/Zverik/5757305
* L.DynamicSingleTile uses L.ImageOverlay to display a single-tile layer from node-mapnik.
* url parameter must accept width, height and bbox.
*/
L.DynamicSingleTile = L.ImageOverlay.extend({
initialize: function (url, options) {
L.ImageOverlay.prototype.initialize.call(this, url, null, options);
},