mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 15:34:49 +02:00
Update background source for history
This commit is contained in:
+1
-1
@@ -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({
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user