[OpenLayers-Commits] r6450 - sandbox/pagameba/transition-resize/lib/OpenLayers

commits at openlayers.org commits at openlayers.org
Thu Mar 6 16:18:45 EST 2008


Author: pagameba
Date: 2008-03-06 16:18:45 -0500 (Thu, 06 Mar 2008)
New Revision: 6450

Modified:
   sandbox/pagameba/transition-resize/lib/OpenLayers/Layer.js
   sandbox/pagameba/transition-resize/lib/OpenLayers/Tile.js
Log:
Re #933.  Add list of supported transitions and check for a valid transition effect before enabling transitions.

Modified: sandbox/pagameba/transition-resize/lib/OpenLayers/Layer.js
===================================================================
--- sandbox/pagameba/transition-resize/lib/OpenLayers/Layer.js	2008-03-06 20:53:21 UTC (rev 6449)
+++ sandbox/pagameba/transition-resize/lib/OpenLayers/Layer.js	2008-03-06 21:18:45 UTC (rev 6450)
@@ -272,6 +272,13 @@
     transitionEffect: null,
     
     /**
+     * Property: supportedTransitions
+     * {Array} An immutable (that means don't change it!) list of supported 
+     *     transitionEffect values.
+     */
+    supportedTransitions: ['resize'],
+    
+    /**
      * Constructor: OpenLayers.Layer
      *
      * Parameters:

Modified: sandbox/pagameba/transition-resize/lib/OpenLayers/Tile.js
===================================================================
--- sandbox/pagameba/transition-resize/lib/OpenLayers/Tile.js	2008-03-06 20:53:21 UTC (rev 6449)
+++ sandbox/pagameba/transition-resize/lib/OpenLayers/Tile.js	2008-03-06 21:18:45 UTC (rev 6450)
@@ -143,7 +143,8 @@
      * Nullify references to prevent circular references and memory leaks.
      */
     destroy:function() {
-        if (this.layer.transitionEffect) {
+        if (OpenLayers.Util.indexOf(this.layer.supportedTransitions, 
+                this.layer.transitionEffect) != -1) {
             this.layer.events.unregister("loadend", this, this.resetBackBuffer);
             this.events.unregister('loadend', this, this.resetBackBuffer);            
         } else {
@@ -208,7 +209,7 @@
         // tile is outside its layer's maxExtent.
         var drawTile = (withinMaxExtent || this.layer.displayOutsideMaxExtent);
 
-        if (this.layer.transitionEffect != null) {
+        if (OpenLayers.Util.indexOf(this.layer.supportedTransitions, this.layer.transitionEffect) != -1) {
             if (drawTile) {
                 //we use a clone of this tile to create a double buffer for visual
                 //continuity.  The backBufferTile is used to create transition



More information about the Commits mailing list