Return null tiles when out of range
This commit is contained in:
@@ -102,7 +102,12 @@ ol.TileStore.prototype.getTile = function(tileCoord) {
|
||||
return this.tileCache_[key];
|
||||
} else {
|
||||
var tileUrl = this.getTileCoordUrl(tileCoord);
|
||||
var tile = new ol.Tile(tileCoord, tileUrl, this.crossOrigin_);
|
||||
var tile;
|
||||
if (goog.isDef(tileUrl)) {
|
||||
tile = new ol.Tile(tileCoord, tileUrl, this.crossOrigin_);
|
||||
} else {
|
||||
tile = null;
|
||||
}
|
||||
this.tileCache_[key] = tile;
|
||||
return tile;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,8 @@ ol.webgl.TileLayerRenderer.prototype.redraw = function() {
|
||||
|
||||
tileBounds.forEachTileCoord(z, function(tileCoord) {
|
||||
var tile = tileStore.getTile(tileCoord);
|
||||
if (tile.isLoaded()) {
|
||||
if (goog.isNull(tile)) {
|
||||
} else if (tile.isLoaded()) {
|
||||
var x = tileSize.width * (tileCoord.x - tileBounds.minX);
|
||||
var y = tileSize.height * (tileCoord.y - tileBounds.minY);
|
||||
gl.texSubImage2D(goog.webgl.TEXTURE_2D, 0,
|
||||
|
||||
Reference in New Issue
Block a user