[Mapbender-commits] r4790 - in branches/2.6: conf http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 19 09:34:13 EDT 2009


Author: christoph
Date: 2009-10-19 09:34:13 -0400 (Mon, 19 Oct 2009)
New Revision: 4790

Modified:
   branches/2.6/conf/digitize_default.conf
   branches/2.6/http/javascripts/mod_digitize_tab.php
Log:


Modified: branches/2.6/conf/digitize_default.conf
===================================================================
--- branches/2.6/conf/digitize_default.conf	2009-10-19 13:27:31 UTC (rev 4789)
+++ branches/2.6/conf/digitize_default.conf	2009-10-19 13:34:13 UTC (rev 4790)
@@ -63,4 +63,5 @@
 // deprecated! check wfs_default.conf to configure this behaviour
 //var spatialRequestResultToDigitize = 1;
 
-var featuresMustHaveUniqueId = true;
\ No newline at end of file
+var featuresMustHaveUniqueId = true;
+var openMetadataEditorAfterNewGeometryHasBeenCreated = true;
\ No newline at end of file

Modified: branches/2.6/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/2.6/http/javascripts/mod_digitize_tab.php	2009-10-19 13:27:31 UTC (rev 4789)
+++ branches/2.6/http/javascripts/mod_digitize_tab.php	2009-10-19 13:34:13 UTC (rev 4790)
@@ -86,6 +86,19 @@
 	else {
 		new parent.Mb_warning("Could not set CSS for map in digitizing module.");
 	}
+
+	eventCloseGeometry = new parent.MapbenderEvent();
+	if (openMetadataEditorAfterNewGeometryHasBeenCreated) {
+		eventCloseGeometry.register(function (obj) {
+			if (typeof obj !== "object") {
+				return;
+			}
+			if (typeof obj.index !== "number") {
+				return;
+			}
+			showWfs(obj.index);
+		});
+	}
 });
 
 
@@ -135,6 +148,13 @@
 	var featuresMustHaveUniqueId = false;
 }
 
+if (typeof openMetadataEditorAfterNewGeometryHasBeenCreated === "undefined") {
+	var openMetadataEditorAfterNewGeometryHasBeenCreated = false;
+}
+
+
+var eventCloseGeometry;
+
 function getMousePosition(e) {
 	var ind = parent.getMapObjIndexByName("<?php  echo $e_target;  ?>");
 	currentPos = parent.mb_mapObj[ind].getMousePosition(e);
@@ -228,12 +248,20 @@
 				
 		// close the polygon
 		d.close();
+		eventCloseGeometry.trigger({
+			index: d.count() - 1,
+			geometry: d.get(-1)
+		});
 		parent.mb_disableThisButton(button_polygon);
 		return true;
 	}
 	else if (d.get(-1).geomType == parent.geomType.line && d.getGeometry(-1,-1).count() > 1 && d.getGeometry(-1,-1).get(-1).equals(realWorldPos)) {
 		// close the line
 		d.close();
+		eventCloseGeometry.trigger({
+			index: d.count() - 1,
+			geometry: d.get(-1)
+		});
 		parent.mb_disableThisButton(button_line);
 		return true;
 	}
@@ -246,6 +274,10 @@
 		
 		if(d.get(-1).geomType == parent.geomType.point){
 			d.close();
+			eventCloseGeometry.trigger({
+				index: d.count() - 1,
+				geometry: d.get(-1)
+			});
 			parent.mb_disableThisButton(button_point);
 			return true;
 		}
@@ -1209,7 +1241,7 @@
 
 					// button clone this geometry
 					if (addCloneGeometryButton === true) {
-						listOfGeom += "<img src = '"+buttonDig_imgdir+buttonDig_clone_src+"' title='"+msgObj.buttonDig_clone_title+"' onclick='d.addCopy(d.get("+i+"));d.get(-1).e.delElement(\"fid\");executeDigitizeSubFunctions();'>";
+						listOfGeom += "<img src = '"+buttonDig_imgdir+buttonDig_clone_src+"' title='"+msgObj.buttonDig_clone_title+"' onclick='d.addCopy(d.get("+i+"));d.get(-1).e.delElement(\"fid\");eventCloseGeometry.trigger({index: d.count() - 1, geometry: d.get(-1)});executeDigitizeSubFunctions();'>";
 					}
 				}
 					



More information about the Mapbender_commits mailing list