mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
Better save and restore map state when entering walkthrough
(should cut down on errant edits in Three Rivers, MI)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user