Skip to content

Instantly share code, notes, and snippets.

View IvanSanchez's full-sized avatar
🔥
Burnt out, cooling down

Iván Sánchez Ortega IvanSanchez

🔥
Burnt out, cooling down
View GitHub Profile
describe("mouse events", function () {
it("change the center of the map", function (done) {
var container = document.createElement('div');
container.style.width = '600px';
container.style.height = '400px';
container.style.background = '#808080';
container.style.position = 'absolute';
container.style.top = 0;
container.style.left = 0;
L.TileLayer.GeoJSON.Multi = L.TileLayer.GeoJSON.extend({
addTileData: function(json, tilePoint) {
for (var featureName in json) {
var geojson = json[featureName];
L.TileLayer.GeoJSON.prototype.addTileData.apply(geojson, tilePoint);
}
}
});
@IvanSanchez
IvanSanchez / L.TileLayer.ServiceWorker.js
Created October 30, 2015 14:40
Preview of L.TileLayer.ServiceWorker.js
if ('serviceWorker' in navigator && !this.hasOwnProperty('ServiceWorkerGlobalScope')) {
var ownUrl = new URL(document.currentScript.src);
// Before the worker inits, keep tileserver URLs temporarily here
var oldTileLayerProto = L.extend({}, L.TileLayer.prototype);
L.TileLayer._urlsToWatch = [];
L.TileLayer.prototype.initialize = function(url, options) {
@IvanSanchez
IvanSanchez / L.TileLayer.XHR.js
Created August 9, 2015 21:57
L.TileLayer.XHR.js
L.TileLayer.prototype.options.xhr = false;
L.TileLayer.include({
createTile: function(coords, done) {
var tile = document.createElement('img');
@IvanSanchez
IvanSanchez / gist:19236943e971c09263d3
Created April 30, 2015 09:07
Firefox for Android text selection handles bug
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
<div id='container' tabindex='0'>
@IvanSanchez
IvanSanchez / rbush-msie8-bug.js
Created April 1, 2015 11:56
rbush MSIE8 bug
var bush = rbush();
bush.insert( [-449,235,-329,277,] );
bush.insert( [-449,262,-425,286,] );
bush.insert( [-215,200,-49,242,] );
bush.insert( [-215,227,-191,251,] );
bush.insert( [222,98,298,140,] );
bush.insert( [222,125,246,149,] );
bush.insert( [388,184,468,226,] );
bush.insert( [388,211,412,235,] );