Tile may be null.
This commit is contained in:
@@ -183,19 +183,23 @@ ol.renderer.TileLayerRenderer.prototype.draw = function(center, resolution) {
|
|||||||
}
|
}
|
||||||
for (var j=0; j<numTilesHigh; ++j) {
|
for (var j=0; j<numTilesHigh; ++j) {
|
||||||
tileY = topTileY + (j * yDown);
|
tileY = topTileY + (j * yDown);
|
||||||
tile = this.layer_.getTileForXYZ(tileX, tileY, tileZ);
|
|
||||||
img = tile.getImg();
|
|
||||||
img.style.top = pxTileTop + "px";
|
|
||||||
img.style.left = pxTileLeft + "px";
|
|
||||||
if (scale !== 1) {
|
if (scale !== 1) {
|
||||||
pxTileBottom = Math.round(pxMinY + ((j+1) * pxTileHeight));
|
pxTileBottom = Math.round(pxMinY + ((j+1) * pxTileHeight));
|
||||||
img.style.height = (pxTileRight - pxTileLeft) + "px";
|
|
||||||
img.style.width = (pxTileBottom - pxTileTop) + "px";
|
|
||||||
} else {
|
} else {
|
||||||
pxTileBottom = pxTileTop + pxTileHeight;
|
pxTileBottom = pxTileTop + pxTileHeight;
|
||||||
}
|
}
|
||||||
tile.load();
|
tile = this.layer_.getTileForXYZ(tileX, tileY, tileZ);
|
||||||
fragment.appendChild(img);
|
if (tile != null) {
|
||||||
|
img = tile.getImg();
|
||||||
|
img.style.top = pxTileTop + "px";
|
||||||
|
img.style.left = pxTileLeft + "px";
|
||||||
|
if (scale !== 1) {
|
||||||
|
img.style.height = (pxTileRight - pxTileLeft) + "px";
|
||||||
|
img.style.width = (pxTileBottom - pxTileTop) + "px";
|
||||||
|
}
|
||||||
|
tile.load();
|
||||||
|
fragment.appendChild(img);
|
||||||
|
}
|
||||||
pxTileTop = pxTileBottom;
|
pxTileTop = pxTileBottom;
|
||||||
}
|
}
|
||||||
pxTileLeft = pxTileRight;
|
pxTileLeft = pxTileRight;
|
||||||
|
|||||||
Reference in New Issue
Block a user