[Mapbender-commits] r8475 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 28 11:33:20 PDT 2012


Author: marc
Date: 2012-08-28 11:33:20 -0700 (Tue, 28 Aug 2012)
New Revision: 8475

Modified:
   trunk/mapbender/lib/printbox.js
Log:
#876

Modified: trunk/mapbender/lib/printbox.js
===================================================================
--- trunk/mapbender/lib/printbox.js	2012-08-28 18:19:00 UTC (rev 8474)
+++ trunk/mapbender/lib/printbox.js	2012-08-28 18:33:20 UTC (rev 8475)
@@ -41,7 +41,7 @@
 	// The pointArray is moved by the center vector.
 	// default: place box in the center of the map
 	//var center = options.center || new Point(map.width/2,map.height/2);
-        var center = options.center || new Point(map.getWidth()/2,map.getHeight()/2);
+	var center = options.center || new Point(map.getWidth()/2,map.getHeight()/2);
 
 	// the center in real world coordinates
 	var centerMap = null;
@@ -90,7 +90,7 @@
 
 			angle = Math.ceil(getAngle(vectorA, vectorCurrent));
 
-			$(document).mousemove(function (e) {
+			$("#" + target).mousemove(function (e) {
 				var currentPos = map.getMousePos(e);
 				var vectorCurrent = currentPos.minus(newCenter);
 				var currentAngle = Math.ceil(getAngle(vectorA, vectorCurrent));
@@ -103,8 +103,8 @@
 				return false;
 			}).mouseup(function (e) {
 				angle = 0;
-				$(document).unbind("mousemove");
-				$(document).unbind("mouseup");
+				$("#" + target).unbind("mousemove");
+				$("#" + target).unbind("mouseup");
 				afterChangeAngle({
 					angle: totalAngle,
 					coordinates: that.getStartCoordinates()
@@ -129,7 +129,7 @@
 
 			var diff;
 
-			$(document).mousemove(function (e) {
+			$("#" + target).mousemove(function (e) {
 				diff = (map.getMousePos(e)).minus(mouseMoveStart);
 
 				$container.css({
@@ -139,8 +139,8 @@
 				return false;
 
 			}).mouseup(function (e) {
-				$(document).unbind("mousemove");
-				$(document).unbind("mouseup");
+				$("#" + target).unbind("mousemove");
+				$("#" + target).unbind("mouseup");
 				recalculateMapPositions();
 				that.rotate(totalAngle);
 				that.paintBox();
@@ -158,7 +158,7 @@
 
 			resizeRatio = 1;
 			mouseMoveStart = map.getMousePos(e);
-			$(document).mousemove(function (e) {
+			$("#" + target).mousemove(function (e) {
 				var newRadius = vectorA.dist(map.getMousePos(e));
 				var resizeRatio = newRadius / radius;
 				if (resizeRatio < 0.98 || resizeRatio > 1.02) {
@@ -173,9 +173,9 @@
 				}
 				return false;
 			});
-			$(document).mouseup(function (e) {
-				$(document).unbind("mousemove");
-				$(document).unbind("mouseup");
+			$("#" + target).mouseup(function (e) {
+				$("#" + target).unbind("mousemove");
+				$("#" + target).unbind("mouseup");
 
 				recalculateMapPositions();
 				recalculatePixPositions();



More information about the Mapbender_commits mailing list