[fusion-commits] r2807 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Nov 12 21:27:56 PST 2013


Author: jng
Date: 2013-11-12 21:27:56 -0800 (Tue, 12 Nov 2013)
New Revision: 2807

Modified:
   trunk/widgets/Select.js
   trunk/widgets/SelectPolygon.js
   trunk/widgets/SelectRadius.js
Log:
#605: Select widget should do nothing on click if we're currently digitizing. While fixing this defect, we discovered that the SelectRadius and SelectPolygon widgets did not set the digitization flag as they did not use our new Fusion viewer digitization APIs. While #606 is a desirable solution, the short term fix is to properly set/unset the digitization flag when these widgets activate/deactivate.

Modified: trunk/widgets/Select.js
===================================================================
--- trunk/widgets/Select.js	2013-11-08 03:29:43 UTC (rev 2806)
+++ trunk/widgets/Select.js	2013-11-13 05:27:56 UTC (rev 2807)
@@ -135,6 +135,11 @@
         *   moved, or an OpenLayers.Pixel for click without dragging on the map
         **/
     execute : function(position, extend) {
+        if (this.getMap().isDigitizing) {
+            //console.log("Currently digitizing. Doing nothing");
+            return;
+        }
+    
         //ctrl click is used to launch a URL defined on the feature. See ClickCTRL widget
         if (this.keyModifiers & OpenLayers.Handler.MOD_CTRL) {
           //return;

Modified: trunk/widgets/SelectPolygon.js
===================================================================
--- trunk/widgets/SelectPolygon.js	2013-11-08 03:29:43 UTC (rev 2806)
+++ trunk/widgets/SelectPolygon.js	2013-11-13 05:27:56 UTC (rev 2807)
@@ -95,7 +95,8 @@
         link.onclick = OpenLayers.Function.bind(this.deactivate, this);
         map.setCursor(this.asCursor);
         map.supressContextMenu(true);
-        this.getMap().triggerEvent(Fusion.Event.MAP_DIGITIZER_ACTIVATED);
+        map.isDigitizing = true;
+        map.triggerEvent(Fusion.Event.MAP_DIGITIZER_ACTIVATED);
     },
 
     /**
@@ -110,7 +111,8 @@
         map.message.clear();
         map.setCursor('auto');
         map.supressContextMenu(false);
-        this.getMap().triggerEvent(Fusion.Event.MAP_DIGITIZER_DEACTIVATED);
+        map.isDigitizing = false;
+        map.triggerEvent(Fusion.Event.MAP_DIGITIZER_DEACTIVATED);
     },
     
     /**

Modified: trunk/widgets/SelectRadius.js
===================================================================
--- trunk/widgets/SelectRadius.js	2013-11-08 03:29:43 UTC (rev 2806)
+++ trunk/widgets/SelectRadius.js	2013-11-13 05:27:56 UTC (rev 2807)
@@ -136,7 +136,8 @@
         link.onclick = OpenLayers.Function.bind(this.deactivate, this);
         map.supressContextMenu(true);
         this.triggerEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED, true);
-        this.getMap().triggerEvent(Fusion.Event.MAP_DIGITIZER_ACTIVATED);
+        map.isDigitizing = true;
+        map.triggerEvent(Fusion.Event.MAP_DIGITIZER_ACTIVATED);
     },
 
     /**
@@ -153,7 +154,8 @@
         map.supressContextMenu(false);
         /*icon button*/
         this.triggerEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED, false);
-        this.getMap().triggerEvent(Fusion.Event.MAP_DIGITIZER_DEACTIVATED);
+        map.isDigitizing = false;
+        map.triggerEvent(Fusion.Event.MAP_DIGITIZER_DEACTIVATED);
     },
     
     /**



More information about the fusion-commits mailing list