set centerzoom before drawing map

This commit is contained in:
Ansis Brammanis
2013-02-28 13:12:00 -05:00
parent ae003b1d5f
commit 4081d1234e
2 changed files with 12 additions and 9 deletions
+4 -1
View File
@@ -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.
+8 -8
View File
@@ -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()