[Mapbender-commits] r8165 - branches/2.7/http/widgets

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 23 07:47:00 EDT 2011


Author: verenadiewald
Date: 2011-09-23 04:47:00 -0700 (Fri, 23 Sep 2011)
New Revision: 8165

Modified:
   branches/2.7/http/widgets/w_measure.js
Log:
id for measure canvas (conflict with printbox), correctly calculated angle

Modified: branches/2.7/http/widgets/w_measure.js
===================================================================
--- branches/2.7/http/widgets/w_measure.js	2011-09-23 06:38:40 UTC (rev 8164)
+++ branches/2.7/http/widgets/w_measure.js	2011-09-23 11:47:00 UTC (rev 8165)
@@ -183,9 +183,10 @@
 		if (a !== null && b !== null && c !== null) {
                         function angleAt(a,b,c){
                             var vectorAB = [b.x- a.x,b.y-a.y];
-                            var vectorAC = [c.x- a.x,c.y-a.y];
-                            var cosalpha = scalarProduct(vectorAB,vectorAC)/
-                                (vectorlen(vectorAB)*vectorlen(vectorAC));
+                            //var vectorBC = [c.x- b.x,c.y-b.y];
+                            var vectorBC = [b.x- c.x,b.y-c.y];
+                            var cosalpha = scalarProduct(vectorAB,vectorBC)/
+                                (vectorlen(vectorAB)*vectorlen(vectorBC));
 
                             var acosalpha = Math.acos(cosalpha);
                             return (acosalpha/Math.PI)*180;
@@ -511,9 +512,9 @@
 		this._map.events.afterMapRequest.register($.proxy(this._redraw, this));
 		this._srs = this._map.getSrs();
 
-		this._$canvas = $("<div />").css({
-			"z-index": 100,
-			"position": "relative"
+		this._$canvas = $("<div id='measure_canvas' />").css({
+			"z-index": 1000,
+			"position": "absolute"
 		}).appendTo(this.element);
 		this._canvas = Raphael(this._$canvas.get(0), this._map.getWidth(), this._map.getHeight());
 		mb_registerPanSubElement($(this._canvas.canvas).parent().get(0));



More information about the Mapbender_commits mailing list