use Bing for walkthrough

fixes #1210
This commit is contained in:
Ansis Brammanis
2013-04-01 10:51:41 -04:00
parent b0ef106584
commit 78cf64b64e
+6
View File
@@ -9,6 +9,7 @@ iD.ui.intro = function(context) {
// Save current map state
var history = context.history().toJSON(),
hash = window.location.hash,
background = context.background().source(),
opacity = d3.select('.layer-layer:first-child').style('opacity'),
loadedTiles = context.connection().loadedTiles(),
baseEntities = context.history().graph().base().entities;
@@ -18,6 +19,10 @@ iD.ui.intro = function(context) {
context.history().save().reset();
context.history().merge(iD.Graph().load(JSON.parse(iD.introGraph)).entities);
context.background().source(_.find(context.backgroundSources(), function(d) {
return d.data.sourcetag === "Bing";
}));
// Block saving
var savebutton = d3.select('#bar button.save'),
save = savebutton.on('click');
@@ -53,6 +58,7 @@ iD.ui.intro = function(context) {
d3.select('.layer-layer:first-child').style('opacity', opacity);
context.connection().toggle(true).flush().loadedTiles(loadedTiles);
context.history().reset().merge(baseEntities);
context.background().source(background);
if (history) context.history().fromJSON(history);
window.location.replace(hash);
window.onbeforeunload = beforeunload;