diff --git a/js/id/id.js b/js/id/id.js index 7369ce7a5..644f640ba 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -133,7 +133,14 @@ window.iD = function () { }; var q = iD.util.stringQs(location.hash.substring(1)), detected = false; - if (q.layer) { + if (q.layer && q.layer.indexOf('custom:') === 0) { + context.layers()[0] + .source(iD.BackgroundSource.template({ + template: q.layer.replace(/^custom:/, ''), + name: 'Custom' + })); + detected = true; + } else if (q.layer) { context.layers()[0] .source(_.find(backgroundSources, function(l) { if (l.data.sourcetag === q.layer) { diff --git a/js/id/renderer/background.js b/js/id/renderer/background.js index dd727ae91..3e366282c 100644 --- a/js/id/renderer/background.js +++ b/js/id/renderer/background.js @@ -163,6 +163,9 @@ iD.Background = function(backgroundType) { function setHash(source) { var tag = source.data && source.data.sourcetag; + if (!tag && source.data.name === 'Custom') { + tag = 'custom:' + source.data.template; + } var q = iD.util.stringQs(location.hash.substring(1)); if (tag) { q[backgroundType] = tag;