diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 0dfae7d13..1e50c2a41 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -1,5 +1,5 @@ iD.Map = function(context) { - var dimensions = [], + var dimensions = [1, 1], dispatch = d3.dispatch('move', 'drawn'), projection = d3.geo.mercator().scale(1024), roundedProjection = iD.svg.RoundProjection(projection), @@ -148,6 +148,9 @@ iD.Map = function(context) { } function redraw(difference) { + + if (!surface) return; + clearTimeout(timeoutId); // If we are in the middle of a zoom/pan, we can't do differenced redraws. diff --git a/js/id/ui.js b/js/id/ui.js index e9d507b67..1cb7bdd22 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -17,6 +17,14 @@ iD.ui = function(context) { if (iD.detect().opera) container.classed('opera', true); + var hash = iD.behavior.Hash(context); + + hash(); + + if (!hash.hadHash) { + map.centerZoom([-77.02271, 38.90085], 20); + } + var m = container.append('div') .attr('id', 'map') .call(map); @@ -123,14 +131,6 @@ iD.ui = function(context) { d3.select(document) .call(keybinding); - var hash = iD.behavior.Hash(context); - - hash(); - - if (!hash.hadHash) { - map.centerZoom([-77.02271, 38.90085], 20); - } - context.enter(iD.modes.Browse(context)); context.container()