Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Userscript to mark tiles as dirty on openstreetmap.org. Usage: alt-click on a tile to mark as dirty.
// ==UserScript==
// @name click n' dirt
// @version 0.1
// @description Alt-click to mark tiles as dirty on openstreetmap.org
// @include http://www.openstreetmap.org/*
// @include https://www.openstreetmap.org/*
// @copyright vax 2014
// ==/UserScript==
var code = '\
$("#map").on("click", ".leaflet-tile", function(e) {\
if (e.altKey) {\
$.ajax({\
url: this.src+"/dirty",\
context: this\
}).done(function() {\
$(this).fadeTo("fast", .2);\
});\
}\
});';
var script = document.createElement("script");
script.textContent = code;
document.body.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.