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