Merge branch 'master' of github.com:openlayers/ol3 into vector

This commit is contained in:
ahocevar
2013-03-11 15:21:01 +01:00
46 changed files with 699 additions and 227 deletions

View File

@@ -152,10 +152,6 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
tileCoord = new ol.TileCoord(z, x, y);
tile = tileSource.getTile(tileCoord, tileGrid, projection);
if (goog.isNull(tile)) {
continue;
}
tileState = tile.getState();
if (tileState == ol.TileState.IDLE) {
this.updateWantedTiles(frameState.wantedTiles, tileSource, tileCoord);
@@ -163,7 +159,8 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
frameState.tileQueue.enqueue(tile, tileSourceKey, tileCenter);
} else if (tileState == ol.TileState.LOADING) {
this.listenToTileChange(tile);
} else if (tileState == ol.TileState.LOADED) {
} else if (tileState == ol.TileState.LOADED ||
tileState == ol.TileState.EMPTY) {
tilesToDrawByZ[z][tileCoord.toString()] = tile;
continue;
} else if (tileState == ol.TileState.ERROR) {
@@ -198,10 +195,13 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
if (this.renderedTiles_[index] != tile) {
x = tileSize.width * (tile.tileCoord.x - tileRange.minX);
y = tileSize.height * (tileRange.maxY - tile.tileCoord.y);
if (!opaque) {
tileState = tile.getState();
if (tileState == ol.TileState.EMPTY || !opaque) {
context.clearRect(x, y, tileSize.width, tileSize.height);
}
context.drawImage(tile.getImage(), x, y);
if (tileState == ol.TileState.LOADED) {
context.drawImage(tile.getImage(), x, y);
}
this.renderedTiles_[index] = tile;
}
}
@@ -214,10 +214,13 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
y = (origin.y - tileExtent.maxY) / tileResolution;
width = scale * tileSize.width;
height = scale * tileSize.height;
if (!opaque) {
tileState = tile.getState();
if (tileState == ol.TileState.EMPTY || !opaque) {
context.clearRect(x, y, width, height);
}
context.drawImage(tile.getImage(), x, y, width, height);
if (tileState == ol.TileState.LOADED) {
context.drawImage(tile.getImage(), x, y, width, height);
}
interimTileRange =
tileGrid.getTileRangeForExtentAndZ(tileExtent, z);
minX = Math.max(interimTileRange.minX, tileRange.minX);

View File

@@ -110,10 +110,6 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
tileCoord = new ol.TileCoord(z, x, y);
tile = tileSource.getTile(tileCoord, tileGrid, projection);
if (goog.isNull(tile)) {
continue;
}
tileState = tile.getState();
if (tileState == ol.TileState.IDLE) {
this.updateWantedTiles(frameState.wantedTiles, tileSource, tileCoord);
@@ -124,7 +120,8 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
} else if (tileState == ol.TileState.LOADED) {
tilesToDrawByZ[z][tileCoord.toString()] = tile;
continue;
} else if (tileState == ol.TileState.ERROR) {
} else if (tileState == ol.TileState.ERROR ||
tileState == ol.TileState.EMPTY) {
continue;
}

View File

@@ -153,7 +153,7 @@ ol.renderer.webgl.Map = function(container, map) {
goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.LOST,
this.handleWebGLContextLost, false, this);
goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.RESTORED,
this.handleWebGLContextResourced, false, this);
this.handleWebGLContextRestored, false, this);
/**
* @private
@@ -433,9 +433,9 @@ ol.renderer.webgl.Map.prototype.handleWebGLContextLost = function(event) {
/**
* @protected
*/
ol.renderer.webgl.Map.prototype.handleWebGLContextResourced = function() {
ol.renderer.webgl.Map.prototype.handleWebGLContextRestored = function() {
if (goog.DEBUG) {
this.logger.info('WebGLContextResourced');
this.logger.info('WebGLContextRestored');
}
this.initializeGL_();
this.getMap().render();

View File

@@ -385,10 +385,6 @@ ol.renderer.webgl.TileLayer.prototype.renderFrame =
tileCoord = new ol.TileCoord(z, x, y);
tile = tileSource.getTile(tileCoord, tileGrid, projection);
if (goog.isNull(tile)) {
continue;
}
tileState = tile.getState();
if (tileState == ol.TileState.IDLE) {
this.updateWantedTiles(frameState.wantedTiles, tileSource, tileCoord);
@@ -407,7 +403,8 @@ ol.renderer.webgl.TileLayer.prototype.renderFrame =
priority = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
tilesToLoad.enqueue(priority, tile);
}
} else if (tileState == ol.TileState.ERROR) {
} else if (tileState == ol.TileState.ERROR ||
tileState == ol.TileState.EMPTY) {
continue;
}