[fusion-commits] r2710 - trunk/widgets/QuickPlot

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue May 21 21:30:10 PDT 2013


Author: jng
Date: 2013-05-21 21:30:09 -0700 (Tue, 21 May 2013)
New Revision: 2710

Modified:
   trunk/widgets/QuickPlot/MapCapturer.js
Log:
Fix MapCapturer breakage as a result of OL 2.12 upgrade:
 - Remove OpenLayers.Layer.Vector.drawFeature() rewrite as whatever parameters were passed to the re-written function were discarded. Also removing the function has no observable side-effects.
 - Rename dragging() and rotating() to isDragging() and isRotating() to prevent naming conflicts.

Modified: trunk/widgets/QuickPlot/MapCapturer.js
===================================================================
--- trunk/widgets/QuickPlot/MapCapturer.js	2013-05-20 05:18:21 UTC (rev 2709)
+++ trunk/widgets/QuickPlot/MapCapturer.js	2013-05-22 04:30:09 UTC (rev 2710)
@@ -184,14 +184,6 @@
         // Add the features into the layer
         this.layer.addFeatures([this.captureBox, this.rotateHandle, this.rotateHandleStart, this.rotateHandleEnd, this.snappingLine]);
 
-        // Overwrite layer's drawFeatures method to consider the map capturer's enable / disable
-        this.layer.drawFeature = (function(f, item, style)
-                {
-                    if (this.enabled)
-                    {
-                        f.apply(this.layer, Array.prototype.slice.call(arguments, 1));
-                    }
-                }).bind(this, this.layer.drawFeature);
         this.handlers = 
         {
             drag: new OpenLayers.Handler.Drag(
@@ -295,10 +287,10 @@
     },
     
     /**
-     * Method: dragging
+     * Method: isDragging
      * Check if it's currently in dragging to move mode
      */
-    dragging: function() 
+    isDragging: function() 
     {
         if (this.feature && this.captureBox)
         {
@@ -309,10 +301,10 @@
     },
     
     /**
-     * Method: dragging
-     * Check if it's currently in dragging to rotate mode
+     * Method: isRotating
+     * Check if it's currently in rotatiing mode
      */
-    rotating: function() 
+    isRotating: function() 
     {
         return this.feature && this.rotateHandleEnd && this.feature.id == this.rotateHandleEnd.id;
     },
@@ -336,11 +328,11 @@
      */
     setCursor: function() 
     {
-        if (this.dragging())
+        if (this.isDragging())
         {
             this.wMap.setCursor(this.cursorMove);
         }
-        else if (this.rotating())
+        else if (this.isRotating())
         {
             this.wMap.setCursor(this.cursorRotate);
         }
@@ -352,11 +344,11 @@
      */
     mouseMove: function(evt) 
     {
-        if (this.dragging()) 
+        if (this.isDragging()) 
         {
             this.moveFeature(evt);
         }
-        else if (this.rotating()) 
+        else if (this.isRotating()) 
         {
             this.rotateFeature(evt);
         }
@@ -601,7 +593,9 @@
         {
             if (this.validateResolution())
             {
-                this.layer.features.each(function(item){item.layer.drawFeature(item);});
+                this.layer.features.each(function(item){
+                    item.layer.drawFeature(item);
+                });
                 if(this.wMap.message){
                    this.wMap.message.hide();
                 }



More information about the fusion-commits mailing list