[mapguide-commits] r6227 - trunk/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Nov 15 20:45:28 EST 2011


Author: sparkliu
Date: 2011-11-15 17:45:28 -0800 (Tue, 15 Nov 2011)
New Revision: 6227

Modified:
   trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js
Log:
Fix tiket 1849: Zoom before doing anything during digitizing will run into an endless loop

Use InvokeScript? to try to invoke a polygon digitize, but zoom in / out before doing anything. You'll find browser running into an endless loop, which rises CPU / Memory usage sharply.

This is because new version of wz_jsgraphics.js uses a incorrect code to drawPolyLine. It will cause endless loop when there is no points.

Modified: trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js	2011-11-15 12:33:56 UTC (rev 6226)
+++ trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js	2011-11-16 01:45:28 UTC (rev 6227)
@@ -674,10 +674,8 @@
 
 	this.drawPolyline = this.drawPolyLine = function(x, y)
 	{
-		for (var i=x.length - 1; i;)
-		{--i;
+		for (var i=0 ; i<x.length-1 ; i++ ) 
 			this.drawLine(x[i], y[i], x[i+1], y[i+1]);
-		}
 	};
 
 	this.fillRect = function(x, y, w, h)



More information about the mapguide-commits mailing list