[Mapbender-commits] r4788 - in trunk/mapbender: conf http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 19 09:25:51 EDT 2009


Author: christoph
Date: 2009-10-19 09:25:49 -0400 (Mon, 19 Oct 2009)
New Revision: 4788

Modified:
   trunk/mapbender/conf/digitize_default.conf
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
http://trac.osgeo.org/mapbender/ticket/437

Modified: trunk/mapbender/conf/digitize_default.conf
===================================================================
--- trunk/mapbender/conf/digitize_default.conf	2009-10-19 13:00:47 UTC (rev 4787)
+++ trunk/mapbender/conf/digitize_default.conf	2009-10-19 13:25:49 UTC (rev 4788)
@@ -60,7 +60,7 @@
 var nonTransactionalColor = "#ff66cc"; 
 var nonTransactionalLineWidth = 2; 
 
-var addCloneGeometryButton = false;
+var addCloneGeometryButton = true;
 
 var wfsWindowWidth = 400;
 var wfsWindowHeight = 300;
@@ -69,3 +69,4 @@
 //var spatialRequestResultToDigitize = 1;
 
 var featuresMustHaveUniqueId = true;
+var openMetadataEditorAfterNewGeometryHasBeenCreated = true;

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-10-19 13:00:47 UTC (rev 4787)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-10-19 13:25:49 UTC (rev 4788)
@@ -87,6 +87,19 @@
 	else {
 		new parent.Mb_warning("Could not set CSS for map in digitizing module.");
 	}
+
+	eventCloseGeometry = new parent.Mapbender.Event();
+	if (openMetadataEditorAfterNewGeometryHasBeenCreated) {
+		eventCloseGeometry.register(function (obj) {
+			if (typeof obj !== "object") {
+				return;
+			}
+			if (typeof obj.index !== "number") {
+				return;
+			}
+			showWfs(obj.index);
+		});
+	}
 });
 
 
@@ -137,6 +150,13 @@
 	var featuresMustHaveUniqueId = false;
 }
 
+if (typeof openMetadataEditorAfterNewGeometryHasBeenCreated === "undefined") {
+	var openMetadataEditorAfterNewGeometryHasBeenCreated = false;
+}
+
+
+var eventCloseGeometry;
+
 function toggleTabs(tabId) {
 	if(!initialTab) {
 		return;
@@ -283,12 +303,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;
 	}
@@ -301,6 +329,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;
 		}
@@ -1276,7 +1308,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