mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
pass dimensions to tile
This commit is contained in:
@@ -84,7 +84,7 @@ function loadTiles(which, url, projection) {
|
||||
var s = projection.scale() * 2 * Math.PI;
|
||||
var currZoom = Math.floor(Math.max(Math.log(s) / Math.log(2) - 8, 0));
|
||||
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(tileZoom, projection));
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(tileZoom, projection, projection.clipExtent()[1], 0));
|
||||
geoTile.removeInflightRequests(which, tiles, abortRequest, ',0');
|
||||
|
||||
tiles.forEach(function(tile) {
|
||||
|
||||
@@ -79,7 +79,7 @@ function loadTiles(which, url, projection) {
|
||||
var s = projection.scale() * 2 * Math.PI,
|
||||
currZoom = Math.floor(Math.max(Math.log(s) / Math.log(2) - 8, 0));
|
||||
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(tileZoom, projection));
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(tileZoom, projection, projection.clipExtent()[1], 0));
|
||||
geoTile.removeInflightRequests(which, tiles, abortRequest, ',0');
|
||||
|
||||
tiles.forEach(function(tile) {
|
||||
|
||||
@@ -778,15 +778,8 @@ export default {
|
||||
tilezoom = _tileZoom;
|
||||
}
|
||||
|
||||
var s = projection.scale() * 2 * Math.PI;
|
||||
var z = Math.max(Math.log(s) / Math.log(2) - 8, 0);
|
||||
var ts = 256 * Math.pow(2, z - tilezoom);
|
||||
var origin = [
|
||||
s / 2 - projection.translate()[0],
|
||||
s / 2 - projection.translate()[1]
|
||||
];
|
||||
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(_tileZoom, projection));
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(_tileZoom, projection, dimensions, 0));
|
||||
|
||||
// remove inflight requests that no longer cover the view..
|
||||
var hadRequests = !_isEmpty(cache.inflight);
|
||||
|
||||
@@ -94,7 +94,7 @@ function loadTiles(which, url, projection, margin) {
|
||||
var s = projection.scale() * 2 * Math.PI;
|
||||
var currZoom = Math.floor(Math.max(Math.log(s) / Math.log(2) - 8, 0));
|
||||
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(tileZoom, projection, margin));
|
||||
var tiles = geoTile.filterNullIsland(geoTile.getTiles(tileZoom, projection, projection.clipExtent()[1], margin));
|
||||
|
||||
tiles.forEach(function (tile) {
|
||||
loadNextTilePage(which, currZoom, url, tile);
|
||||
|
||||
@@ -71,7 +71,7 @@ export function utilTile() {
|
||||
* Using d3.geo.tiles.js from lib, gets tile extents for each grid tile in a grid created from
|
||||
* an area around (and including) the current map view extents.
|
||||
*/
|
||||
tile.getTiles = function(tileZoom, projection, margin) {
|
||||
tile.getTiles = function(tileZoom, projection, dimensions, margin) {
|
||||
// s is the current map scale
|
||||
// z is the 'Level of Detail', or zoom-level, where Level 1 is far from the earth, and Level 23 is close to the ground.
|
||||
// ts ('tile size') here is the formula for determining the width/height of the map in pixels, but with a modification.
|
||||
@@ -88,7 +88,7 @@ export function utilTile() {
|
||||
var tiler = this
|
||||
.scaleExtent([tileZoom, tileZoom])
|
||||
.scale(s)
|
||||
.size(projection.clipExtent()[1])
|
||||
.size(dimensions)
|
||||
.translate(projection.translate())
|
||||
.margin(margin || 0); // request nearby tiles so we can connect sequences.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user