diff --git a/js/id/connection.js b/js/id/connection.js index 4e9c90eba..3e7857da7 100644 --- a/js/id/connection.js +++ b/js/id/connection.js @@ -108,7 +108,7 @@ iD.Connection = function() { method: 'PUT', path: '/api/0.6/changeset/create', options: { header: { 'Content-Type': 'text/xml' } }, - content: iD.format.XML.changeset(comment) + content: iD.format.XML.changeset(comment, imagery_used) }, function (err, changeset_id) { if (err) return callback(err); oauth.xhr({ diff --git a/js/id/graph/history.js b/js/id/graph/history.js index 08a3875a3..e31fa5ef9 100644 --- a/js/id/graph/history.js +++ b/js/id/graph/history.js @@ -1,5 +1,6 @@ iD.History = function() { - var stack, index, imagery_used, + var stack, index, + imagery_used = 'Bing', dispatch = d3.dispatch('change'); function perform(actions) { @@ -16,8 +17,6 @@ iD.History = function() { graph = actions[i](graph); } - imagery_used = 'Bing'; // TODO, un-hardcode - return {graph: graph, annotation: annotation, imagery_used: imagery_used}; } @@ -111,7 +110,10 @@ iD.History = function() { }, imagery_used: function(source) { - return _.unique(_.pluck(stack.slice(1, index + 1), 'imagery_used')); + if (source) imagery_used = source; + else return _.without( + _.unique(_.pluck(stack.slice(1, index + 1), 'imagery_used')), + undefined, 'Custom'); }, reset: function () { diff --git a/js/id/ui/layerswitcher.js b/js/id/ui/layerswitcher.js index 832ea15f4..e8a62c0bb 100644 --- a/js/id/ui/layerswitcher.js +++ b/js/id/ui/layerswitcher.js @@ -126,6 +126,7 @@ iD.layerswitcher = function(map) { d.name = 'Custom (configured)'; } map.background.source(d.source); + map.history().imagery_used(d.name); map.redraw(); selectLayer(d); })