Merge pull request #922 from ahocevar/backbuffer-zindex

Configurable backbuffer order. r=@bartvde
This commit is contained in:
ahocevar
2013-03-27 13:13:36 -07:00
3 changed files with 27 additions and 6 deletions

View File

@@ -98,9 +98,14 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* Two posible values:
*
* "resize" - Existing tiles are resized on zoom to provide a visual
* effect of the zoom having taken place immediately. As the
* new tiles become available, they are drawn over top of the
* resized tiles (this is the default setting).
* effect of the zoom having taken place immediately. As the
* new tiles become available, they are drawn on top of the
* resized tiles (this is the default setting).
* "map-resize" - Existing tiles are resized on zoom and placed below the
* base layer. New tiles for the base layer will cover existing tiles.
* This setting is recommended when having an overlay duplicated during
* the transition is undesirable (e.g. street labels or big transparent
* fills).
* null - No transition effect.
*
* Using "resize" on non-opaque layers can cause undesired visual
@@ -705,6 +710,12 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
backBuffer.id = this.div.id + '_bb';
backBuffer.className = 'olBackBuffer';
backBuffer.style.position = 'absolute';
var map = this.map;
backBuffer.style.zIndex = this.transitionEffect === 'resize' ?
this.getZIndex() - 1 :
// 'map-resize':
map.Z_INDEX_BASE.BaseLayer -
(map.getNumLayers() - map.getLayerIndex(this));
for(var i=0, lenI=this.grid.length; i<lenI; i++) {
for(var j=0, lenJ=this.grid[i].length; j<lenJ; j++) {
var tile = this.grid[i][j],