From 239abdf4e792dd6cbc903b3e0fdb2bea6fcd32b3 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 10 Dec 2015 14:02:16 -0800 Subject: [PATCH] Better save and restore map state when entering walkthrough (should cut down on errant edits in Three Rivers, MI) --- js/id/ui/intro.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/id/ui/intro.js b/js/id/ui/intro.js index c3be4a17e..83e0b3241 100644 --- a/js/id/ui/intro.js +++ b/js/id/ui/intro.js @@ -9,6 +9,8 @@ iD.ui.intro = function(context) { // Save current map state var history = context.history().toJSON(), hash = window.location.hash, + center = context.map().center(), + zoom = context.map().zoom(), background = context.background().baseLayerSource(), opacity = d3.select('.background-layer').style('opacity'), loadedTiles = context.connection().loadedTiles(), @@ -62,6 +64,7 @@ iD.ui.intro = function(context) { context.history().reset().merge(d3.values(baseEntities)); context.background().baseLayerSource(background); if (history) context.history().fromJSON(history, false); + context.map().centerZoom(center, zoom); window.location.replace(hash); context.inIntro(false); d3.select('#bar button.save').on('click', save);