Merge branch '2.12'

This commit is contained in:
Éric Lemoine
2012-04-02 21:10:19 +02:00
9 changed files with 115 additions and 40 deletions

View File

@@ -320,20 +320,6 @@ OpenLayers.Layer = OpenLayers.Class({
*/
wrapDateLine: false,
/**
* APIProperty: transitionEffect
* {String} The transition effect to use when the map is panned or
* zoomed.
*
* There are currently two supported values:
* - *null* No transition effect (the default).
* - *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.
*/
transitionEffect: null,
/**
* Property: metadata
* {Object} This object can be used to store additional information on a

View File

@@ -91,6 +91,22 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
*/
buffer: 0,
/**
* APIProperty: transitionEffect
* {String} The transition effect to use when the map is zoomed.
* Two posible values:
*
* null - No transition effect (the default).
* "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.
*
* Using "resize" on non-opaque layers can cause undesired visual
* effects. This is therefore discouraged.
*/
transitionEffect: null,
/**
* APIProperty: numLoadingTiles
* {Integer} How many tiles are still loading?
@@ -184,9 +200,45 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* APIProperty: removeBackBufferDelay
* {Number} Delay for removing the backbuffer when all tiles have finished
* loading. Can be set to 0 when no css opacity transitions for the
* olTileImage class are used. Default is 2500.
* olTileImage class are used. Default is 0 for <singleTile> layers,
* 2500 for tiled layers. See <className> for more information on
* tile animation.
*/
removeBackBufferDelay: 2500,
removeBackBufferDelay: null,
/**
* APIProperty: className
* {String} Name of the class added to the layer div. If not set in the
* options passed to the constructor then className defaults to
* "olLayerGridSingleTile" for single tile layers (see <singleTile>),
* and "olLayerGridTile" for non single tile layers.
*
* Note:
*
* The displaying of tiles is not animated by default for single tile
* layers - OpenLayers' default theme (style.css) includes this:
* (code)
* .olLayerGridTile .olTileImage {
* -webkit-transition: opacity 0.2s linear;
* -moz-transition: opacity 0.2s linear;
* -o-transition: opacity 0.2s linear;
* transition: opacity 0.2s linear;
* }
* (end)
* To animate tile displaying for any grid layer the following
* CSS rule can be used:
* (code)
* .olTileImage {
* -webkit-transition: opacity 0.2s linear;
* -moz-transition: opacity 0.2s linear;
* -o-transition: opacity 0.2s linear;
* transition: opacity 0.2s linear;
* }
* (end)
* In that case, to avoid flash effects, <removeBackBufferDelay>
* should not be zero.
*/
className: null,
/**
* Register a listener for a particular event with the following syntax:
@@ -232,7 +284,16 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
arguments);
this.grid = [];
this.tileQueue = [];
if (this.removeBackBufferDelay === null) {
this.removeBackBufferDelay = this.singleTile ? 0 : 2500;
}
if (this.className === null) {
this.className = this.singleTile ? 'olLayerGridSingleTile' :
'olLayerGridTile';
}
if (!OpenLayers.Animation.isNative) {
this.deferMoveGriddedTiles = OpenLayers.Function.bind(function() {
this.moveGriddedTiles(true);
@@ -241,6 +302,17 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
}
},
/**
* Method: setMap
*
* Parameters:
* map - {<OpenLayers.Map>} The map.
*/
setMap: function(map) {
OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this, map);
OpenLayers.Element.addClass(this.div, this.className);
},
/**
* Method: removeMap
* Called when the layer is removed from the map.