Update background source for history

This commit is contained in:
Ansis Brammanis
2013-01-08 16:26:28 -05:00
parent fe634f4f9f
commit 97bc2429dc
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -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({
+6 -4
View File
@@ -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 () {
+1
View File
@@ -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);
})