Pass dimensions to d3.geo.tile

This commit is contained in:
Ansis Brammanis
2013-01-24 12:34:39 -05:00
parent 8c330abdd6
commit ec72fb39cd
2 changed files with 4 additions and 3 deletions

View File

@@ -234,12 +234,13 @@ iD.Connection = function() {
bboxFromAPI(e.box, e.tile, done);
}
function loadTiles(projection) {
var scaleExtent = [15, 15],
function loadTiles(projection, dimensions) {
var scaleExtent = [16, 16],
s = projection.scale(),
tiles = d3.geo.tile()
.scaleExtent(scaleExtent)
.scale(s)
.size(dimensions)
.translate(projection.translate())(),
z = Math.max(Math.log(s) / Math.log(2) - 8, 0),
rz = Math.max(scaleExtent[0], Math.min(scaleExtent[1], Math.floor(z))),

View File

@@ -164,7 +164,7 @@ iD.Map = function() {
surface.attr('data-zoom', ~~map.zoom());
tilegroup.call(background);
if (map.editable()) {
connection.loadTiles(projection);
connection.loadTiles(projection, dimensions);
drawVector(difference);
} else {
editOff();