[Mapbender-commits] r5297 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 7 11:19:08 EST 2010


Author: christoph
Date: 2010-01-07 11:19:02 -0500 (Thu, 07 Jan 2010)
New Revision: 5297

Modified:
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
refactoring

renabled snapping

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2010-01-07 13:48:08 UTC (rev 5296)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2010-01-07 16:19:02 UTC (rev 5297)
@@ -97,15 +97,9 @@
 	};
 	
 	this.back = function () {
-//		console.log("HistoryItems: %s", historyItemArray);
 		if (currentIndex > 0) {
 			currentIndex --;
 			historyItemArray[currentIndex].back();
-//			console.log("B-----");
-//			console.log(s);
-//			console.log("EXECUTING %s", historyItemArray[currentIndex].back);
-//			console.log("GeomArray (post): %s", d);
-//			console.log("Index: %s", currentIndex);
 			executeDigitizeSubFunctions();
 			return true;
 		}
@@ -113,15 +107,9 @@
 	};
 	
 	this.forward = function () {
-//		console.log("HistoryItems: %s", historyItemArray);
 		if (currentIndex < historyItemArray.length) {
 			historyItemArray[currentIndex].forward();
-//			console.log("F-----");
-//			console.log("EXECUTING %s", historyItemArray[currentIndex].forward);
-//			console.log("GeomArray (post): %s", d);
-//			console.log(s);
 			currentIndex ++;
-//			console.log("Index: %s", currentIndex);
 			executeDigitizeSubFunctions();
 			return true;
 		}
@@ -338,9 +326,9 @@
 
 function mod_digitize_timeout(){
 	var el = mapDomElement;
-	el.onmousedown = null;
-	el.onmouseup = null;
-	el.onmousemove = null;
+	$(el).unbind("mousedown")
+		.unbind("mouseup")
+		.unbind("mousemove");
 }
 
 var isLastLinePointSnapped = function (newPoint) {
@@ -540,10 +528,8 @@
 	})();
 
 		
-//		if (mod_digitizeEvent != button_move) {
-//			s.store(d);
-//		}
 
+
 	return true;
 }
 // --- polygon, line, point insertion (begin) ----------------------------------------------------------------------------------------------
@@ -600,7 +586,9 @@
 	if(mod_digitizeEvent == button_insert){
 		mod_digitize_timeout();
 		obj.style.cursor = 'crosshair';
-		obj.onclick = insertBasepoint;
+		$(obj).click(function (e){
+			insertBasepoint(e);
+		});
 
 		basepointObject = obj;
 		basepointMemberIndex = memberIndex;
@@ -996,13 +984,18 @@
 		executeDigitizePreFunctions();
 	}
 	else if (obj.id == button_point || obj.id == button_line || 
-				obj.id == button_polygon || obj.id == button_clear || 
-				obj.id == button_split || obj.id == button_merge ||
-				obj.id == button_difference){
+			obj.id == button_polygon || obj.id == button_clear || 
+			obj.id == button_split || obj.id == button_merge ||
+			obj.id == button_difference){
 					
+		s.store(d);
+
 		var el = mapDomElement;
-		el.onmousemove = mod_digitize_go;
-		el.onmousedown = mod_digitize_start;
+		$(el).mousemove(function (e) {
+			mod_digitize_go(e);
+		}).mousedown(function (e) {
+			mod_digitize_start(e);
+		});
 
 
 		mod_digitizeEvent = obj.id;



More information about the Mapbender_commits mailing list