[Mapbender-commits] r7119 - in trunk/mapbender/http: plugins widgets

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 12 05:34:31 EST 2010


Author: christoph
Date: 2010-11-12 02:34:31 -0800 (Fri, 12 Nov 2010)
New Revision: 7119

Modified:
   trunk/mapbender/http/plugins/mb_measure_widget.js
   trunk/mapbender/http/widgets/w_measure.js
Log:
some minor changes in new measure

Modified: trunk/mapbender/http/plugins/mb_measure_widget.js
===================================================================
--- trunk/mapbender/http/plugins/mb_measure_widget.js	2010-11-11 16:04:25 UTC (rev 7118)
+++ trunk/mapbender/http/plugins/mb_measure_widget.js	2010-11-12 10:34:31 UTC (rev 7119)
@@ -109,7 +109,7 @@
 	};
 
 	var updateDistance = function (evt, dist) {
-		if (!dist) {
+		if (typeof dist !== "number") {
 			return;
 		}
 		var lastDistanceUnit = "m";

Modified: trunk/mapbender/http/widgets/w_measure.js
===================================================================
--- trunk/mapbender/http/widgets/w_measure.js	2010-11-11 16:04:25 UTC (rev 7118)
+++ trunk/mapbender/http/widgets/w_measure.js	2010-11-12 10:34:31 UTC (rev 7119)
@@ -276,10 +276,9 @@
 			&& !this._polygonIsInvalid;
 		var lastPointSnapped = this._isLastPointSnapped(mousePos);
 
-
 		var pos = {
 			mousePos: mousePos,
-			pos: this._firstPointSnapped ?
+			pos: firstPointSnapped ?
 				this._measurePoints[0].pos : lastPointSnapped ?
 					this._measurePoints[this._measurePoints.length - 1].pos :
 					this._map.convertPixelToReal(mousePos)
@@ -295,10 +294,11 @@
 			previousPoint,
 			pos.pos
 		);
-			console.log(previousPoint);
-			console.log(pos.pos);
-		this._trigger("onmeasuredistance", null, this._currentDistance);
 
+		if (this._measurePoints.length > 0) {
+			this._trigger("onmeasuredistance", null, this._currentDistance);
+		}
+
 		if (this._isPolygon(this._measurePoints, pos) && !this._polygonIsInvalid) {
 			this._currentArea = this._calculateArea(pos);
 			this._trigger("onmeasurearea", null, this._currentArea);



More information about the Mapbender_commits mailing list