[fusion-commits] r2720 - trunk/layers/MapGuide

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue May 28 20:53:11 PDT 2013


Author: jng
Date: 2013-05-28 20:53:11 -0700 (Tue, 28 May 2013)
New Revision: 2720

Modified:
   trunk/layers/MapGuide/MapGuideViewerApi.js
Log:
Fix errant line digitizer in MapGuideViewerApi.js. The mgApiCheckLine function (the cause of the problem) is not required. Setting the maxVertices property on the matching OpenLayers.Control.DrawFeature control achieves the same effect.

Modified: trunk/layers/MapGuide/MapGuideViewerApi.js
===================================================================
--- trunk/layers/MapGuide/MapGuideViewerApi.js	2013-05-28 08:19:13 UTC (rev 2719)
+++ trunk/layers/MapGuide/MapGuideViewerApi.js	2013-05-29 03:53:11 UTC (rev 2720)
@@ -248,6 +248,7 @@
       line: new OpenLayers.Control.DrawFeature(mgApiDigitizingLayer,
                   OpenLayers.Handler.Path, {
                     handlerOptions: {
+                      maxVertices: 2,
                       freehandToggle: null, 
                       freehand: false, 
                       persist: true,
@@ -255,9 +256,6 @@
                       layerOptions: {
                         styleMap: mgApiStyleMap
                       }
-                    },
-                    callbacks: {
-                      'point': mgApiCheckLine
                     }
                   }),
       linestr: new OpenLayers.Control.DrawFeature(mgApiDigitizingLayer,
@@ -305,16 +303,6 @@
 
 }
 
-//this callback method for the 'line' control to limit the number of points 
-//in the linestring to 2 - there is an extra point in the feature that gets
-//removed when the feature is finalized
-function mgApiCheckLine(point, geom) {
-  if (geom.components.length == 3) {
-    this.handler.dblclick();
-    //this.handler.finalize();
-  }
-}
-
 /* locate the Fusion window */
 function GetFusionWindow() {
     var curWindow = window;



More information about the fusion-commits mailing list