[Mapbender-commits] r3500 - in branches/print_dev: http http/classes http/javascripts http/php lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 29 08:32:05 EST 2009


Author: mschulz
Date: 2009-01-29 08:32:04 -0500 (Thu, 29 Jan 2009)
New Revision: 3500

Removed:
   branches/print_dev/http/javascripts/mod_closePolygon.js
   branches/print_dev/http/javascripts/mod_closePolygonExt.js
   branches/print_dev/http/javascripts/mod_getArea.php
   branches/print_dev/http/javascripts/mod_rubber.js
   branches/print_dev/http/javascripts/mod_rubberExt.js
   branches/print_dev/http/javascripts/wfs.js
   branches/print_dev/http/php/mod_changeEPSG.php
   branches/print_dev/http/php/mod_help.php
   branches/print_dev/http/php/system.php
   branches/print_dev/http/tools/
Modified:
   branches/print_dev/http/classes/class_administration.php
   branches/print_dev/http/classes/class_gui.php
   branches/print_dev/http/classes/class_map.php
   branches/print_dev/http/classes/class_wmc.php
   branches/print_dev/http/classes/class_wmcToXml.php
   branches/print_dev/http/classes/class_wms.php
   branches/print_dev/http/javascripts/geometry.js
   branches/print_dev/http/javascripts/map.php
   branches/print_dev/http/javascripts/map_obj.js
   branches/print_dev/http/javascripts/mod_changeEPSG.php
   branches/print_dev/http/javascripts/mod_digitize_tab.php
   branches/print_dev/http/javascripts/mod_dragMapSize.php
   branches/print_dev/http/javascripts/mod_legend.php
   branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php
   branches/print_dev/http/php/mod_editElements.php
   branches/print_dev/lib/basic.js
   branches/print_dev/lib/div.js
Log:
merged from trunk

Modified: branches/print_dev/http/classes/class_administration.php
===================================================================
--- branches/print_dev/http/classes/class_administration.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/classes/class_administration.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -770,6 +770,16 @@
 		return $ownguis;
 	}
 	
+	function getRootLayerByWms($wms_id){
+		$sql = "SELECT layer_id from layer WHERE fkey_wms_id = $1 AND layer_pos = '0' LIMIT 1";
+		$v = array($wms_id);
+		$t = array('i');
+		$res = db_prep_query($sql,$v,$t);
+		$layer_id_array = array();
+		$row = db_fetch_array($res);
+		return $row['layer_id'];
+	}	
+
 	function getLayerByWms($wms_id){
 		$sql = "SELECT layer_id from layer WHERE fkey_wms_id = $1 AND layer_pos NOT IN ('0') GROUP BY layer_id, layer_title ORDER BY layer_title";
 		$v = array($wms_id);

Modified: branches/print_dev/http/classes/class_gui.php
===================================================================
--- branches/print_dev/http/classes/class_gui.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/classes/class_gui.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -138,6 +138,10 @@
 		array_push($v, array($guiList));
 		array_push($t, array('s'));
 
+    array_push($sql, "DELETE FROM gui_wfs_conf WHERE fkey_gui_id = $1");
+		array_push($v, array($guiList));
+		array_push($t, array('s'));
+
 		array_push($sql, "DELETE FROM gui_wms WHERE fkey_gui_id = $1");
 		array_push($v, array($guiList));
 		array_push($t, array('s'));
@@ -234,7 +238,12 @@
 			array_push($sql, "INSERT INTO gui_wfs (fkey_gui_id, fkey_wfs_id) SELECT $1, fkey_wfs_id FROM gui_wfs WHERE fkey_gui_id = $2;");
 			array_push($v, array($newGuiName, $guiList));
 			array_push($t, array("s", "s"));
+			
+			array_push($sql, "INSERT INTO gui_wfs_conf (fkey_gui_id, fkey_wfs_conf_id) SELECT $1, fkey_wfs_conf_id FROM gui_wfs_conf WHERE fkey_gui_id = $2;");
+			array_push($v, array($newGuiName, $guiList));
+			array_push($t, array("s", "i"));
 
+
 			array_push($sql, "INSERT INTO gui_wms (fkey_gui_id, fkey_wms_id, gui_wms_position, gui_wms_mapformat, gui_wms_featureinfoformat, gui_wms_exceptionformat, gui_wms_epsg, gui_wms_visible) SELECT $1, fkey_wms_id, gui_wms_position, gui_wms_mapformat, gui_wms_featureinfoformat, gui_wms_exceptionformat, gui_wms_epsg, gui_wms_visible FROM gui_wms WHERE fkey_gui_id = $2;");
 			array_push($v, array($newGuiName, $guiList));
 			array_push($t, array("s", "s"));

Modified: branches/print_dev/http/classes/class_map.php
===================================================================
--- branches/print_dev/http/classes/class_map.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/classes/class_map.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -11,6 +11,7 @@
 	private $frameName;
 	private $elementName = "maps";
 	private $extent;
+	private $zoomFullExtentArray = array();
 	private $isOverview = false;
 	private $wmsArray = array();
 	
@@ -45,7 +46,7 @@
 	public function getWidth () {
 		return $this->width;
 	}
-	
+
 	/**
 	 * @param $value Integer
 	 */
@@ -83,6 +84,14 @@
 		return $this->frameName;	
 	}
 	
+	public function addZoomFullExtent ($aMapbenderBbox) {
+		$e = new mb_exception("adding new box: " . $aMapbenderBbox);
+		array_push($this->zoomFullExtentArray, $aMapbenderBbox);
+	}
+	
+	public function getZoomFullExtentArray () {
+		return $this->zoomFullExtentArray;
+	}
 	/**
 	 * @param $value String
 	 */
@@ -97,39 +106,8 @@
 	public function getExtent () {
 		return $this->extent;	
 	}
-
-	/**
-	 * 
-	 * @return Mapbender_bbox extent information
-	 */
-	public function getExtentInfo () {
-		return array($this->extent->min->x, $this->extent->min->y, $this->extent->max->x, $this->extent->max->y);	
-	}	
 	
 	/**
-	 * converts the extent of the map so that the maximum	extent will be displayed
-	 *
-	 */
-	public function calculateExtent($aMapbenderBbox) {
-		$relation_px_x = $this->getWidth() / $this->getHeight();
-		$relation_px_y = $this->getHeight() / $this->getWidth();
-		$extentx = ($aMapbenderBbox->max->x - $aMapbenderBbox->min->x);
-		$extenty = ($aMapbenderBbox->max->y - $aMapbenderBbox->min->y);
-		$centerx = $aMapbenderBbox->min->x + $extentx/2;
-		$centery = $aMapbenderBbox->min->y + $extenty/2;
-		$relation_bbox_x = $extentx / $extenty;     
-		if($relation_bbox_x <= $relation_px_x){                
-			$aMapbenderBbox->min->x = $centerx - $relation_px_x * $extenty / 2;
-			$aMapbenderBbox->max->x = $centerx + $relation_px_x * $extenty / 2;
-		}
-		if($relation_bbox_x > $relation_px_x){                
-			$aMapbenderBbox->min->y = $centery - $relation_px_y * $extentx / 2;
-			$aMapbenderBbox->max->y = $centery + $relation_px_y * $extentx / 2;
-		}
-		$this->setExtent($aMapbenderBbox);
-	}
-		
-	/**
 	 * 
 	 * @return String EPSG code of the map.
 	 */
@@ -137,6 +115,16 @@
 		return $this->extent->epsg;	
 	}
 	
+	public function getWms ($index) {
+		if (is_numeric($index)) {
+			$i = intval($index, 10); 
+			if ($i < count($this->wmsArray) && count($this->wmsArray) > 0 && $i >= 0) {
+				return $this->wmsArray[$i];
+			}
+		}
+		return null;
+	}
+	
 	/**
 	 * 
 	 * @return 
@@ -308,6 +296,7 @@
 				$newLayer->gui_layer_status = $currentLayer->gui_layer_status;
 				$newLayer->gui_layer_style = $currentLayer->gui_layer_style;
 				$newLayer->gui_layer_selectable = $currentLayer->gui_layer_selectable;
+
 				if ($this->isOverview) {
 					preg_match_all("/LAYERS\=([^&]*)/", $jsMapObject->mapURL[0], $resultMatrix);
 					$layerList = $resultMatrix[1][0];

Modified: branches/print_dev/http/classes/class_wmc.php
===================================================================
--- branches/print_dev/http/classes/class_wmc.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/classes/class_wmc.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -86,7 +86,7 @@
 	var $monitoringIsOn = false;
 	var $saveWmcAsFile = false;
 	var $extensionNamespace = "mapbender";
-	var $extensionNamespaceUrl = "http://www.mapbender.org";
+	var $extensionNamespaceUrl = "http://www.mapbender.org/context";
 		
 	// set in constructor
 	var $wmc_id;
@@ -360,26 +360,17 @@
 			for ($i = 0; $i < count($ovWmsArray); $i++) {
 				for ($j = 0; $j < count($wmsArray); $j++) {
 					if ($ovWmsArray[$i]->equals($wmsArray[$j])) {
-						$overviewWmsIndex = $j;						
+						$overviewWmsIndex = $j;	
+						$wmsIndexOverview = $i;					
 						break;
 					}
 				}
 			}
 		}
 
-
-
 		// for all wms...
 		for ($i = 0; $i < count($wmsArray); $i++) {
-			// ..use settings from ov if available
-			if ($overviewWmsIndex !== null && $this->overviewMap !== null && 
-				$overviewWmsIndex == $i && count($ovWmsArray) > $i) {
-				array_push($wmcJsArray, $ovWmsArray[$i]->createJsObjFromWMS_());
-			}
-			else {
-				// ..otherwise use data from mapframe1
-				array_push($wmcJsArray, $wmsArray[$i]->createJsObjFromWMS_());
-			}			
+			array_push($wmcJsArray, $wmsArray[$i]->createJsObjFromWMS_());
 		}
 
 		// delete existing map objects...
@@ -393,16 +384,16 @@
 		// .. and add main map ..
 		$wmcJsArray = array_merge($wmcJsArray, $this->mainMap->toJavaScript(null));
 
-		// set visibility of main map WMS (may be different from overview)
+		// set visibility of ov map WMS (may be different from main)
 		if ($this->overviewMap !== null) {
-			for ($i = 0; $i < count($wmsArray[$overviewWmsIndex]->objLayer); $i++) {
-				$visStr = "mb_mapObj[1].wms[" .$overviewWmsIndex . "].handleLayer(" . 
-					"'" . $wmsArray[$overviewWmsIndex]->objLayer[$i]->layer_name . "', " . 
+			for ($i = 0; $i < count($ovWmsArray[$wmsIndexOverview]->objLayer); $i++) {
+				$visStr = "mb_mapObj[0].wms[" .$wmsIndexOverview . "].handleLayer(" . 
+					"'" . $ovWmsArray[$wmsIndexOverview]->objLayer[$i]->layer_name . "', " . 
 					"'visible', " . 
-					($wmsArray[$overviewWmsIndex]->objLayer[$i]->gui_layer_visible ? 1 : 0) . ");";
+					($ovWmsArray[$wmsIndexOverview]->objLayer[$i]->gui_layer_visible ? 1 : 0) . ");";
 				array_push($wmcJsArray, $visStr);
 			}
-			array_push($wmcJsArray, "mb_mapObj[1].restateLayers(" . $wmsArray[$overviewWmsIndex]->wms_id . ");");
+			array_push($wmcJsArray, "mb_mapObj[0].restateLayers(" . $ovWmsArray[$wmsIndexOverview]->wms_id . ");");
 		}
 		
 
@@ -650,7 +641,19 @@
 					$this->setMapData();
 				}
 				if ($generalExtension) {
-					$this->generalExtensionArray[$tag] = $value;
+					if ($value !== "") {
+						if (isset($this->generalExtensionArray[$tag])) {
+							if (!is_array($this->generalExtensionArray[$tag])) {
+								$firstValue = $this->generalExtensionArray[$tag];
+								$this->generalExtensionArray[$tag] = array();
+								array_push($this->generalExtensionArray[$tag], $firstValue);
+							}	
+							array_push($this->generalExtensionArray[$tag], $value);
+						}
+						else {
+							$this->generalExtensionArray[$tag] = $value;									
+						}
+					}
 				}
 				if ($tag == "EXTENSION" && $type == "open") {
 					$generalExtension = true;
@@ -691,12 +694,12 @@
 						// we have all necessary information to CREATE
 						// a layer object and append it to the WMS object
 						//
-						if ($currentLayer["extension"]["ISOVERVIEWLAYER"] == "1") {
+						if (isset($currentLayer["extension"]["OVERVIEWHIDDEN"])) {
 							array_push($layerlistArray["overview"], $currentLayer);		
 						}
-						else {
-							array_push($layerlistArray["main"], $currentLayer);											
-						}
+						$modifiedLayer = $currentLayer;
+						unset($modifiedLayer["extension"]["OVERVIEWHIDDEN"]);
+						array_push($layerlistArray["main"], $modifiedLayer);											
 				 		$layer = false;
 					}
 					if ($formatlist) {
@@ -856,6 +859,21 @@
 			$this->setLayerData($layerlistCompleteArray[$i]);
 		}
 
+		// set zoom full extent for root layer of first WMS
+		$firstWms = $this->mainMap->getWms(0);
+		$firstWms->objLayer[0]->layer_epsg = array();
+		$boxList = $this->mainMap->getZoomFullExtentArray();
+		for ($i = 0; $i < count($boxList); $i++) {
+			$currentBox = $boxList[$i];
+			array_push($firstWms->objLayer[0]->layer_epsg, array(
+				"epsg" => $currentBox->epsg,
+				"minx" => $currentBox->min->x,
+				"miny" => $currentBox->min->y,
+				"maxx" => $currentBox->max->x,
+				"maxy" => $currentBox->max->y
+			));
+		}
+		new mb_exception("NEW LAYER EPSG: " . serialize($this->mainMap->getWms(0)->objLayer[0]->layer_epsg));
 		return true;
 	}
 
@@ -893,7 +911,7 @@
 		$currentMap = $this->mainMap;
 		$currentMapIsOverview = false;
 
-		if ($currentLayer["extension"]["ISOVERVIEWLAYER"] == "1") {
+		if (isset($currentLayer["extension"]["OVERVIEWHIDDEN"])) {
 			$currentMap = $this->overviewMap;
 			$currentMapIsOverview = true;
 		}
@@ -1066,6 +1084,42 @@
 			$bbox = new Mapbender_bbox($this->generalExtensionArray["OV_MINX"], $this->generalExtensionArray["OV_MINY"], $this->generalExtensionArray["OV_MAXX"], $this->generalExtensionArray["OV_MAXY"], $this->generalExtensionArray["OV_SRS"]);
 			$this->overviewMap->setExtent($bbox);
 		}
+		if ($this->generalExtensionArray["EPSG"] && 
+			$this->generalExtensionArray["MINX"] && 		
+			$this->generalExtensionArray["MINY"] && 		
+			$this->generalExtensionArray["MAXX"] && 		
+			$this->generalExtensionArray["MAXY"]) {
+
+			$mainEpsgArray = array();
+			$mainMinXArray = array();
+			$mainMinYArray = array();
+			$mainMaxXArray = array();
+			$mainMaxYArray = array();
+			if (!is_array($this->generalExtensionArray["EPSG"])) {
+				$mainEpsgArray[0] = $this->generalExtensionArray["EPSG"];
+				$mainMinXArray[0] = $this->generalExtensionArray["MINX"];
+				$mainMinYArray[0] = $this->generalExtensionArray["MINY"];
+				$mainMaxXArray[0] = $this->generalExtensionArray["MAXX"];
+				$mainMaxYArray[0] = $this->generalExtensionArray["MAXY"];
+			}
+			else {
+				$mainEpsgArray = $this->generalExtensionArray["EPSG"];
+				$mainMinXArray = $this->generalExtensionArray["MINX"];
+				$mainMinYArray = $this->generalExtensionArray["MINY"];
+				$mainMaxXArray = $this->generalExtensionArray["MAXX"];
+				$mainMaxYArray = $this->generalExtensionArray["MAXY"];
+			}
+
+			for ($i=0; $i < count($mainEpsgArray); $i++) {
+				$box = new Mapbender_bbox(
+					floatval($mainMinXArray[$i]), floatval($mainMinYArray[$i]), 
+					floatval($mainMaxXArray[$i]), floatval($mainMaxYArray[$i]),
+					$mainEpsgArray[$i]
+				);				
+				$this->mainMap->addZoomFullExtent($box);
+			}
+		}			
+
 		if ($this->generalExtensionArray["MAIN_FRAMENAME"]) {
 			$this->mainMap->setFrameName($this->generalExtensionArray["MAIN_FRAMENAME"]);
 		}

Modified: branches/print_dev/http/classes/class_wmcToXml.php
===================================================================
--- branches/print_dev/http/classes/class_wmcToXml.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/classes/class_wmcToXml.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -56,12 +56,6 @@
 	
 	private function toXml () {
 
-		// add main map and overview (if exists) to $mapArray
-		$mapArray = array($this->wmc->mainMap);
-		if ($this->wmc->overviewMap !== null) {
-			array_push($mapArray, $this->wmc->overviewMap);
-		}
-
 		// generate XML
 		$this->doc = new DOMDocument("1.0", CHARSET);
 		$this->doc->preserveWhiteSpace = false;
@@ -70,10 +64,9 @@
 		$e_view_context = $this->doc->createElementNS("http://www.opengis.net/context", "ViewContext");
 		$e_view_context->setAttribute("version", "1.1.0");
 		$e_view_context->setAttribute("id", $this->wmc->wmc_id);
-		$e_view_context->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+		$e_view_context->setAttribute("xsi:schemaLocation", "http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd");
+		$e_view_context->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
 		$e_view_context->setAttribute("xmlns:" . $this->wmc->extensionNamespace, $this->wmc->extensionNamespaceUrl);
-		$e_view_context->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
-		$e_view_context->setAttribute("xsi:SchemaLocation", "http://schemas.opengis.net/context/1.0.0/context.xsd");
 		
 		// General
 		$e_general = $this->createGeneralNode();	
@@ -83,22 +76,46 @@
 		
 		// Layerlist
 		$e_layer_list = $this->doc->createElement("LayerList");
-		while (count($mapArray) > 0) {
+
+		// store overview layers
+		$overviewLayerArray = array();
+		if ($this->wmc->overviewMap !== null) {
+			$currentOverviewWmsArray = $this->wmc->overviewMap->getWmsArray();
+			for ($k = 0; $k < count($currentOverviewWmsArray); $k++) {
+				$currentOverviewWms = $currentOverviewWmsArray[$k];
+
+				for ($l = 0; $l < count($currentOverviewWms->objLayer); $l++) {
+					$currentOverviewLayer = $currentOverviewWms->objLayer[$l];
+					array_push($overviewLayerArray, $currentOverviewLayer);
+				}
+			}
+		}
+
+		$currentWmsArray = $this->wmc->mainMap->getWmsArray();
+		$currentMap = $this->wmc->mainMap;
+		for ($i = 0; $i < count($currentWmsArray); $i++) {
+			$currentWms = $currentWmsArray[$i];
 			
-			$currentMap = array_pop($mapArray);
-			$currentWmsArray = $currentMap->getWmsArray();
-	
-			for ($i = 0; $i < count($currentWmsArray); $i++) {
-				$currentWms = $currentWmsArray[$i];
+			for ($j = 0; $j < count($currentWms->objLayer); $j++) {
+				$currentLayer = $currentWms->objLayer[$j];
 				
-				for ($j = 0; $j < count($currentWms->objLayer); $j++) {
-					$currentLayer = $currentWms->objLayer[$j];
 					
+				$layerNode = null;
+				$found = false;
+				for ($k = 0; $k < count($overviewLayerArray); $k++) {
+					$currentOverviewLayer = $overviewLayerArray[$k];
+					if ($currentLayer->layer_uid == $currentOverviewLayer->layer_uid) {
+						$layerNode = $this->createLayerNode($currentMap, $currentWms, $currentLayer, $currentOverviewLayer);
+						$found = true;
+						break;
+					}					
+				}
+				if (!$found) {
 					$layerNode = $this->createLayerNode($currentMap, $currentWms, $currentLayer);
-					if ($layerNode !== null) {
-						$e_layer_list->appendChild($layerNode);
-					}
 				}
+				if ($layerNode !== null) {
+					$e_layer_list->appendChild($layerNode);
+				}
 			}
 		}
 		$e_view_context->appendChild($e_layer_list);
@@ -121,6 +138,15 @@
 			$extensionData["ov_height"] = $this->wmc->overviewMap->getHeight();
 		}
 		
+		// store epsg and bbox of root layer of 0th WMS
+		$firstWms = $this->wmc->mainMap->getWms(0);
+		if ($firstWms !== null) {
+			for ($i = 0; $i < count($firstWms->objLayer[0]->layer_epsg); $i++) {
+				$currentLayerEpsg = $firstWms->objLayer[0]->layer_epsg[$i];
+				$extensionData["mainMapBox" . $i] = $currentLayerEpsg;
+			}
+		}
+		
 		if ($this->wmc->mainMap !== null) {
 			$extensionData["main_framename"] = $this->wmc->mainMap->getFrameName();
 		}
@@ -146,21 +172,19 @@
 		$e_bbox->setAttribute("maxy", $mainExtent->max->y);
 		$e_general->appendChild($e_bbox);
 				
-		// Name
-		$e_name = $this->doc->createElement("Name", $this->wmc->wmc_name);
-		$e_general->appendChild($e_name);
-				
 		// Title
 		$e_title = $this->doc->createElement("Title", $this->wmc->wmc_title);
 		$e_general->appendChild($e_title);
 				
 		// Keywords
-		$e_keyword_list = $this->doc->createElement("KeywordList");
-		for ($i=0; $i < count($this->wmc->wmc_keyword); $i++) {
-			$e_keyword = $this->doc->createElement("Keyword", $this->wmc->wmc_keyword[$i]);
-			$e_keyword_list->appendChild($e_keyword);
+		if (count($this->wmc->wmc_keyword) > 0) {
+			$e_keyword_list = $this->doc->createElement("KeywordList");
+			for ($i=0; $i < count($this->wmc->wmc_keyword); $i++) {
+				$e_keyword = $this->doc->createElement("Keyword", $this->wmc->wmc_keyword[$i]);
+				$e_keyword_list->appendChild($e_keyword);
+			}
+			$e_general->appendChild($e_keyword_list);
 		}
-		$e_general->appendChild($e_keyword_list);
 				
 		// Abstract
 		if ($this->wmc->wmc_abstract) {
@@ -210,7 +234,7 @@
 			$e_extensionGeneral = $this->doc->createElement("Extension");
 			
 			foreach ($extensionData as $keyExtensionData => $valueExtensionData) {
-				$e_currentExtensionTag = $this->doc->createElement($this->wmc->extensionNamespace.":".$keyExtensionData, $valueExtensionData);
+				$e_currentExtensionTag = $this->addExtension($keyExtensionData, $valueExtensionData);
 				$e_extensionGeneral->appendChild($e_currentExtensionTag);
 			}
 			$e_general->appendChild($e_extensionGeneral);
@@ -218,7 +242,22 @@
 		return $e_general;
 	}
 	
-	private function createLayerNode ($currentMap, $currentWms, $currentLayer) {
+	private function createLayerNode () {
+		if (func_num_args() == 3) {
+			$currentMap = func_get_arg(0);
+			$currentWms = func_get_arg(1);
+			$currentLayer = func_get_arg(2);
+			$currentOverviewLayer = null;
+		}
+		else if (func_num_args() == 4) {
+			$currentMap = func_get_arg(0);
+			$currentWms = func_get_arg(1);
+			$currentLayer = func_get_arg(2);
+			$currentOverviewLayer = func_get_arg(3);		
+		}
+		else {
+			return null;
+		}
 		if ($currentLayer->layer_parent != '') {
 
 			// Layer
@@ -254,12 +293,6 @@
 				$e_layer->appendChild($e_layer_abstract);
 			}
 
-			// SRS		
-			$srsNode = $this->createSrsNode($currentMap, $currentWms);
-			if ($srsNode !== null) {
-				$e_layer->appendChild($srsNode);
-			}
-	
 			// Data URL
 			if ($currentLayer->layer_dataurl_href){
 				$e_layer_data_url = $this->doc->createElement("DataURL");
@@ -286,6 +319,12 @@
 				$e_layer->appendChild($e_layer_metadata_url);
 			}
 
+			// SRS		
+			$srsNode = $this->createSrsNode($currentMap, $currentWms);
+			if ($srsNode !== null) {
+				$e_layer->appendChild($srsNode);
+			}
+	
 			// Layer format
 			$formatListNode = $this->createLayerFormatListNode($currentWms);
 			if ($formatListNode !== null) {
@@ -299,11 +338,10 @@
 			}
 
 			// Extension
-			$extensionNode = $this->createLayerExtensionNode($currentMap, $currentWms, $currentLayer);
+			$extensionNode = $this->createLayerExtensionNode($currentMap, $currentWms, $currentLayer, $currentOverviewLayer);
 			if ($extensionNode !== null) {
 				$e_layer->appendChild($extensionNode);
 			}
-
 			return $e_layer;
 		}
 		return null;	
@@ -353,7 +391,7 @@
 		return $e_layer_format;
 	}
 
-	private function createLayerExtensionNode ($currentMap, $currentWms, $currentLayer) {
+	private function createLayerExtensionNode ($currentMap, $currentWms, $currentLayer, $currentOverviewLayer) {
 		$layerExtensionData = array();
 		$layerExtensionData["wms_name"] = $currentWms->objLayer[0]->layer_name;
 		$layerExtensionData["minscale"] = $currentLayer->layer_minscale;
@@ -371,14 +409,14 @@
 		$layerExtensionData["gui_status"] = $currentLayer->gui_layer_status;
 		$layerExtensionData["layer_epsg"] = $currentLayer->layer_epsg;
 		
-		if ($currentMap->isOverview()) {
-			$layerExtensionData["isOverviewLayer"] = 1;
+		if ($currentOverviewLayer != null) {
+			$layerExtensionData["overviewData"] = array("overviewHidden" => ($currentOverviewLayer->gui_layer_visible ? 0 : 1));
 		}
 		if ($currentLayer->gui_layer_wfs_featuretype) {
 			$layerExtensionData["wfsFeatureType"] = $currentLayer->gui_layer_wfs_featuretype;
 		}
 
-		if (count($layerExtensionData) > 0) {
+		if (1 == 0 && count($layerExtensionData) > 0) {
 			$e_extension = $this->doc->createElement("Extension");
 			
 			foreach ($layerExtensionData as $keyExtensionData => $valueExtensionData) {
@@ -395,6 +433,7 @@
 			if (is_numeric($key)) {
 				$key = "data" . $key;
 			}
+//			$e_currentExtensionTag = $this->doc->createElementNS($this->wmc->extensionNamespaceUrl, $this->wmc->extensionNamespace.":".$key);
 			$e_currentExtensionTag = $this->doc->createElement($this->wmc->extensionNamespace.":".$key);
 			foreach ($value as $childKey => $childValue) {
 				$newNode = $this->addExtension($childKey, $childValue);
@@ -402,6 +441,7 @@
 			}
 		}
 		else {
+//			$e_currentExtensionTag = $this->doc->createElementNS($this->wmc->extensionNamespaceUrl, $this->wmc->extensionNamespace.":".$key, $value);
 			$e_currentExtensionTag = $this->doc->createElement($this->wmc->extensionNamespace.":".$key, $value);
 		}
 		return $e_currentExtensionTag;
@@ -443,7 +483,7 @@
 				$e_layer_style->appendChild($e_layer_style_title);
 				
 				
-				$e_layer_style_legendurl = $this->doc->createElement("LegendUrl");
+				$e_layer_style_legendurl = $this->doc->createElement("LegendURL");
 
 				//TODO: determine correct layer style entries
 				$layerStyle_legendUrl_width = ""; // To Do: add proper data

Modified: branches/print_dev/http/classes/class_wms.php
===================================================================
--- branches/print_dev/http/classes/class_wms.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/classes/class_wms.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -861,7 +861,12 @@
 		$newLayer->gui_layer_status = $currentLayer["extension"]["GUI_STATUS"];
 		$newLayer->gui_layer_style = ""; // TODO: Add correct data
 		$newLayer->gui_layer_selectable = $currentLayer["extension"]["GUI_SELECTABLE"];
-		$newLayer->gui_layer_visible = $currentLayer["visible"];
+		if (isset($currentLayer["extension"]["OVERVIEWHIDDEN"])) {
+			$newLayer->gui_layer_visible = ($currentLayer["extension"]["OVERVIEWHIDDEN"] === "1") ? false : true;
+		}
+		else {
+			$newLayer->gui_layer_visible = $currentLayer["visible"];
+		}
 		$newLayer->gui_layer_queryable = $currentLayer["extension"]["GUI_QUERYABLE"];
 		$newLayer->gui_layer_querylayer = $currentLayer["extension"]["QUERYLAYER"];
 		$newLayer->gui_layer_minscale = $currentLayer["extension"]["GUI_MINSCALE"];
@@ -1896,7 +1901,7 @@
 			$res_style = db_prep_query($sql,$v,$t);
 			$count_layer_style = 0;
 			while($row2 = db_fetch_array($res_style)){
-				$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["name"]=$row2["name"];
+				$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["name"] = $row2["name"] ? $row2["name"] : "default";
 				$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["title"]=$row2["title"];
 				if($wmsowsproxy != ""){
 					if($row2["legendurl"]!=''){

Modified: branches/print_dev/http/javascripts/geometry.js
===================================================================
--- branches/print_dev/http/javascripts/geometry.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/geometry.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1627,15 +1627,21 @@
 	 * 
 	 * @type DivTag
 	 */
-	this.canvasDivTag = new DivTag(aTagName, aMapframe, aStyle);
+	var mapframe = aMapframe;
+	var mapObjInd = getMapObjIndexByName(mapframe);
 
+	if (mb_mapObj[mapObjInd].getDomElement().frameName) {
+		this.canvasDivTag = new DivTag(aTagName, mapName, aStyle);
+	}
+	else {
+		this.canvasDivTag = new DivTag(aTagName, "", aStyle, mb_mapObj[mapObjInd].getDomElement());
+	}
+
 	var that = this;
 
 	var diameter = 8;
 	var minWidth = 8;
 	var lineWidth = aLineWidth || 2;
-	var mapframe = aMapframe;
-	var mapObjInd = getMapObjIndexByName(mapframe);
 	var mapframeWidth = mb_mapObj[mapObjInd].width;
 	var mapframeHeight = mb_mapObj[mapObjInd].height;
 	eventResizeMap.register(function () {
@@ -1643,7 +1649,7 @@
 		mapframeHeight = mb_mapObj[mapObjInd].height;
 	});
 	var style = aStyle;
-	var canvas = new jsGraphics(aTagName, mb_mapObj[mapObjInd].getDomElement().frameName?window.frames[mapframe]:window);
+	var canvas = new jsGraphics(aTagName, mb_mapObj[mapObjInd].getDomElement().frameName ? window.frames[mapframe] : window);
 	canvas.setStroke(lineWidth);
 	mb_registerPanSubElement(aTagName);
 }
@@ -1773,7 +1779,7 @@
 		}
 		for (var i=0; i<targets.length; i++){
 			if (typeof(canvas[i]) == 'undefined') {
-				canvas[i] = new Canvas(targets[i], tagname, style, lineWidth);
+				canvas[i] = new Canvas(targets[i], tagname + i, style, lineWidth);
 			}
 			canvas[i].paint(gA);
 		}

Modified: branches/print_dev/http/javascripts/map.php
===================================================================
--- branches/print_dev/http/javascripts/map.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/map.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -76,7 +76,7 @@
 $extPath = dirname(__FILE__) . "/../extensions/";
 $extFileArray = array(  "jquery-1.2.6.min.js", 
 						"jqjson.js", 
-						"jquery.mousewheel.min.js",
+						"jquery.mousewheel.min.js",
 						"jquery.form.js");
 
 for ($i = 0; $i < count($extFileArray); $i++) {
@@ -108,6 +108,7 @@
 	$currentFile = $libPath . $libFileArray[$i];
 	if (file_exists($currentFile)) {
 		require_once($currentFile);
+		echo "\n";
 	}
 	else {
 		$e = new mb_exception("Library not found: " . $currentFile);
@@ -130,6 +131,7 @@
 			$currentFile = dirname(__FILE__) . "/../javascripts/" . trim($moduleArray[$i]);
 			if (file_exists($currentFile)) {
 				require_once($currentFile);
+				echo "\n";
 			}
 			else {
 				$e = new mb_exception("Javascript module not found: " . $currentFile);

Modified: branches/print_dev/http/javascripts/map_obj.js
===================================================================
--- branches/print_dev/http/javascripts/map_obj.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/map_obj.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -96,6 +96,7 @@
 	this.width = width;
 	this.height = height;
 	this.frameName = frameName;
+	this.type = (frameName !== "") ? "IFRAME" : "DIV";
 	this.elementName = elementName;
 	this.layers = [];
 	this.styles = [];

Modified: branches/print_dev/http/javascripts/mod_changeEPSG.php
===================================================================
--- branches/print_dev/http/javascripts/mod_changeEPSG.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_changeEPSG.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,5 +1,5 @@
 <?php
-# $Id: mod_changeEPSG.php 3397 2009-01-02 15:24:40Z christoph $
+# $Id:mod_changeEPSG.php 3397 2009-01-02 15:24:40Z christoph $
 # http://www.mapbender.org/index.php/mod_changeEPSG.php
 # Copyright (C) 2002 CCGIS 
 #
@@ -7,7 +7,7 @@
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2, or (at your option)
 # any later version.
-#
+# 
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

Deleted: branches/print_dev/http/javascripts/mod_closePolygon.js
===================================================================
--- branches/print_dev/http/javascripts/mod_closePolygon.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_closePolygon.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,11 +0,0 @@
-var mod_closePolygon_img = new Image();
-mod_closePolygon_img.src = "../img/button_gray/closePolygon_off.gif";
-register_measureSubFunctions("mod_closePolygon()");
-function mod_closePolygon(){
-	var str =  "<div style='position:absolute;top:25px' onmouseup='parent.mod_closePolygon_go()' ";
-	str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_disableTimeout()'><img src='"+mod_closePolygon_img.src+"'></div>";
-	return str;
-}
-function mod_closePolygon_go(){
-	mod_measure_close();
-}
\ No newline at end of file

Deleted: branches/print_dev/http/javascripts/mod_closePolygonExt.js
===================================================================
--- branches/print_dev/http/javascripts/mod_closePolygonExt.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_closePolygonExt.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,17 +0,0 @@
-var mod_closePolygonExt_img = new Image();
-mod_closePolygonExt_img.src = "../img/button_gray/closePolygon_off.gif";
-try {register_setExtRequestSubFunctions("mod_closePolygonExt()");}
-catch(e) {
-	try {parent.register_setExtRequestSubFunctions("mod_closePolygonExt()");}
-	catch(e) {
-		alert("exception (mod_closePolygonExt.js): register_setExtRequestSubFunctions not found");
-	}
-}
-function mod_closePolygonExt(){
-	var str =  "<div style='position:absolute;top:25px' onmouseup='parent.mod_wfs_spatialRequest_close()' ";
-	str += "onmouseover='parent.mod_wfs_spatialRequest_timeout()' onmouseout='parent.mod_wfs_spatialRequest_disableTimeout()'><img src='"+mod_closePolygonExt_img.src+"'></div>";
-	return str;
-}
-function mod_closePolygonExt_go(){
-	mod_setExtRequest_close();
-}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/print_dev/http/javascripts/mod_digitize_tab.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_digitize_tab.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -69,6 +69,26 @@
 var buttonDig_x = [];
 var buttonDig_y = [];	
 
+var mapWindow;
+var mapDomElement;
+var mapType = "";
+
+parent.eventInit.register(function () {
+	var mapIndex = parent.getMapObjIndexByName(mod_digitize_target);
+	mapDomElement = parent.mb_mapObj[mapIndex].getDomElement();
+	mapType = mapDomElement.tagName.toUpperCase();
+	if (mapType == "DIV") {
+		mapWindow = parent.window;
+	}
+	else if (mapType == "IFRAME") {
+		mapWindow = mapDomElement.window;
+	}
+	else {
+		new parent.Mb_warning("Could not set CSS for map in digitizing module.");
+	}
+});
+
+
 <?php
 echo "var mod_digitize_target = '".$e_target."';";
 $digitizeConfFilenameAndPath = dirname(__FILE__) . "/../../conf/" . $digitize_conf_filename;
@@ -110,6 +130,25 @@
 try {if(mod_digitize_elName){}}catch(e) {mod_digitize_elName = "digitize";}
 try {if(nonTransactionalEditable){}}catch(e) {nonTransactionalEditable = false;}
 
+function getMousePosition(e) {
+	parent.mb_getMousePos(e, mod_digitize_target);
+	var currentPos = null;
+	if (mapType == "DIV") {
+		currentPos = new parent.Point(
+			parent.clickX - parseInt(mapDomElement.style.left), 
+			parent.clickY - parseInt(mapDomElement.style.top)
+		);
+	}
+	else {
+		currentPos = new parent.Point(
+			parent.clickX, 
+			parent.clickY
+		);
+	}
+	return currentPos;
+}
+
+
 function initializeDigitize () {
 	d = new parent.GeometryArray();
 	GeometryArray = parent.GeometryArray;
@@ -150,24 +189,24 @@
 function mod_digitize_go(e){
 	// ie workaround
 	if (e == undefined) {
-		e = parent.frames[mod_digitize_target].event;
+		e = mapWindow.event;
 	}
 	if (e) {
 		// track mouse position
-		parent.mb_getMousePos(e, mod_digitize_target);
-		var currentPos = new parent.Point(parent.clickX, parent.clickY);
+		var currentPos = getMousePosition(e);
+		
 		s.check(currentPos);
 	}
 	else {
 //		s.clean();
 	}
 
-	var el = parent.frames[mod_digitize_target].document;
+	var el = mapWindow.document;
 	el.onmousedown = mod_digitize_start;
 }
 
 function mod_digitize_timeout(){
-	var el = parent.frames[mod_digitize_target].document;
+	var el = mapWindow.document;
 	el.onmousedown = null;
 	el.onmouseup = null;
 	el.onmousemove = null;
@@ -189,8 +228,8 @@
 		s.clean();
 	}
 	else {
-		parent.mb_getMousePos(e,mod_digitize_target);
-		realWorldPos = parent.mapToReal(mod_digitize_target,new parent.Point(parent.clickX,parent.clickY));
+		var currentPos = getMousePosition(e);
+		realWorldPos = parent.mapToReal(mod_digitize_target,currentPos);
 	}
 	
 	if (d.get(-1).geomType == parent.geomType.polygon && d.getGeometry(-1,-1).count() > 1 && d.getGeometry(-1,-1).get(0).equals(realWorldPos)) {
@@ -270,13 +309,13 @@
 	if(mod_digitizeEvent == button_move){
 		mod_digitize_timeout();
 		basepointObject.style.cursor = 'move';
-		basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].selectBasepoint;
+		basepointObject.onmousedown = parent.frames[mod_digitize_elName].selectBasepoint;
 	}
 
 	if(mod_digitizeEvent == button_delete){
 		mod_digitize_timeout();
 		basepointObject.style.cursor = 'crosshair';
-		basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].deleteBasepoint;
+		basepointObject.onmousedown = parent.frames[mod_digitize_elName].deleteBasepoint;
 	}
 }
 
@@ -302,8 +341,9 @@
 	var k = basepointRingIndex;
 	var l = basepointPointIndex;
 	
-	parent.mb_getMousePos(e, mod_digitize_target);
-	var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX, parent.clickY);
+	var currentPos = getMousePosition(e);
+
+	var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,currentPos.x, currentPos.y);
 	var p = new parent.Point(pos[0], pos[1]);
 	if (k == undefined) {
 		d.getGeometry(i,j).addPointAtIndex(p, l);
@@ -356,8 +396,7 @@
 
 function dragBasepoint(e){
 	if(basepointDragActive){
-		parent.mb_getMousePos(e, mod_digitize_target);
-		var currentPos = new parent.Point(parent.clickX, parent.clickY);
+		var currentPos = getMousePosition(e);
 		var res = s.check(currentPos);
 
 	}
@@ -380,8 +419,8 @@
 	var l = basepointPointIndex;
 	basepointDragActive = false;
 	
-	parent.mb_getMousePos(e, mod_digitize_target);
-	var basepointDragEnd = new parent.Point(parent.clickX, parent.clickY);
+	var currentPos = getMousePosition(e);
+	var basepointDragEnd = currentPos;
 	basepointObject.onmousedown = null;
 	var p = parent.makeClickPos2RealWorldPos(mod_digitize_target, basepointDragEnd.x, basepointDragEnd.y);
 
@@ -452,18 +491,25 @@
 	registerDigitizePreFunctions("drawDashedLine()");
 	registerDigitizeSubFunctions("updateListOfGeometries()");
 	registerDigitizeSubFunctions("drawDashedLine()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initializeDigitize()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].setStyleForTargetFrame()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].checkDigitizeTag()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseSnapping()");
-	parent.mb_registerL10nFunctions("window.frames['"+ mod_digitize_elName + "'].getMessages()");
-//	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].appendGeometryArrayFromKML()");
-	if (!nonTransactionalEditable) {
-		parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseHighlight()");
-	}
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseMeasure()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].getMessages()");
-	parent.mb_registerSubFunctions("window.frames['" + mod_digitize_elName + "'].updateExtent()");
+	parent.eventInit.register(function () {
+		initializeDigitize();
+		setStyleForTargetFrame();
+		checkDigitizeTag();
+		initialiseSnapping();
+//		appendGeometryArrayFromKML();
+		if (!nonTransactionalEditable) {
+			initialiseHighlight();
+		}
+		initialiseMeasure();
+		getMessages();
+	});
+	parent.eventLocalize.register(function() {
+		getMessages();
+	});
+
+	parent.eventAfterMapRequest.register(function () {
+		updateExtent();
+	});
 	try {if(spatialRequestResultToDigitize){}}catch(e) {spatialRequestResultToDigitize = 1;}
 	if(spatialRequestResultToDigitize==1){
 		parent.mb_registerWfsReadSubFunctions(function(geom){parent.tab_open(mod_digitize_elName);parent.window.frames[mod_digitize_elName].appendGeometryArray(geom);});
@@ -472,32 +518,46 @@
 }
 
 function checkDigitizeTag(){
-	var digitizeTagName = "digitize";
-	var digitizeTagStyle = {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeTransactionalZIndex, "font-size":"10px"};
-	 
-	digitizeDivTag = new parent.DivTag(digitizeTagName, mod_digitize_target, digitizeTagStyle);
+	var digitizeTagName = "digitizeDiv";
+	var digitizeTagStyle;
+	
+
+	if (mapType == "DIV") {
+		
+		digitizeTagStyle = {"z-index":digitizeTransactionalZIndex, "font-size":"10px"};
+		digitizeDivTag = new parent.DivTag(digitizeTagName, "", digitizeTagStyle, mapDomElement);
+	}	 
+	else {
+		digitizeTagStyle = {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeTransactionalZIndex, "font-size":"10px"};
+		digitizeDivTag = new parent.DivTag(digitizeTagName, mod_digitize_target, digitizeTagStyle);
+	}
 	parent.mb_registerPanSubElement(digitizeTagName);
 	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].drawDashedLine()");
 }
 
 
 function setStyleForTargetFrame(){
-	var cssLink = parent.window.frames[mod_digitize_target].document.createElement("link");
+	var cssLink = mapWindow.document.createElement("link");
+	var cssHead = mapWindow.document.getElementsByTagName("head")[0]; 
 	cssLink.setAttribute("href", cssUrl); 
 	cssLink.setAttribute("type", "text/css"); 
 	cssLink.setAttribute("rel", "stylesheet"); 
-	var cssTmp = parent.window.frames[mod_digitize_target].document.getElementsByTagName("head")[0];
-	cssTmp.appendChild(cssLink);
+	cssHead.appendChild(cssLink);
 }
 
 function initialiseSnapping(){
 	s = new parent.Snapping(mod_digitize_target, snappingTolerance, snappingColor, snappingHighlightZIndex);
 }
 function initialiseHighlight(){
-	nonTransactionalHighlight = new parent.Highlight(new Array(mod_digitize_target), "nonTransactional", {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeNonTransactionalZIndex}, nonTransactionalLineWidth);
+	nonTransactionalHighlight = new parent.Highlight([mod_digitize_target], "nonTransactional", {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeNonTransactionalZIndex}, nonTransactionalLineWidth);
 }
 function initialiseMeasure(){
-	measureDivTag = new parent.DivTag(measureTagName, measureTagTarget, measureTagStyle);
+	if (mapType == "DIV") {
+		measureDivTag = new parent.DivTag(measureTagName, "", measureTagStyle);
+	}
+	else {
+		measureDivTag = new parent.DivTag(measureTagName, measureTagTarget, measureTagStyle);
+	}
 	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].updateMeasureTag()");
 }
 // --- registered functions (end) -----------------------------------------------------------------------------------------
@@ -658,7 +718,7 @@
 				obj.id == button_split || obj.id == button_merge ||
 				obj.id == button_difference){
 					
-		var el = parent.frames[mod_digitize_target].document;
+		var el = mapWindow.document;
 		el.onmousemove = mod_digitize_go;
 
 		mod_digitizeEvent = obj.id;

Modified: branches/print_dev/http/javascripts/mod_dragMapSize.php
===================================================================
--- branches/print_dev/http/javascripts/mod_dragMapSize.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_dragMapSize.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -20,18 +20,26 @@
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 echo "var mod_dragMapSize_target = '".$e_target[0]."';";
 ?>
-var mod_dagMapSize_offset  = 15;
-var mod_dagMapSize_active  = false;
+var mod_dragMapSize_offset  = 15;
+var mod_dragMapSize_active  = false;
+
 eventInit.register(function () {
 	mod_dragMapSize_init();
 });
+
 eventAfterMapRequest.register(function () {
 	mod_dragMapSize_arrange()
 });
 
 function mod_dragMapSize_arrange(){
-	var left = parseInt(document.getElementById(mod_dragMapSize_target).style.left) + parseInt(document.getElementById(mod_dragMapSize_target).style.width) + mod_dagMapSize_offset - (parseInt(document.getElementById('dragMapSize').style.width)/2);
-	var top = parseInt(document.getElementById(mod_dragMapSize_target).style.top) + parseInt(document.getElementById(mod_dragMapSize_target).style.height) + mod_dagMapSize_offset - (parseInt(document.getElementById('dragMapSize').style.height)/2);
+	var left = parseInt(document.getElementById(mod_dragMapSize_target).style.left) + 
+				parseInt(document.getElementById(mod_dragMapSize_target).style.width) + 
+				mod_dragMapSize_offset - 
+				(parseInt(document.getElementById('dragMapSize').style.width)/2);
+	var top = parseInt(document.getElementById(mod_dragMapSize_target).style.top) + 
+				parseInt(document.getElementById(mod_dragMapSize_target).style.height) + 
+				mod_dragMapSize_offset - 
+				(parseInt(document.getElementById('dragMapSize').style.height)/2);
 	mb_arrangeElement('','dragMapSize' , left, top);
 }
 
@@ -42,7 +50,7 @@
 }
 
 function mod_dragMapSize_down(e){
-	if(mod_dagMapSize_active == false){
+	if(mod_dragMapSize_active == false){
 		document.onmouseup = mod_dragMapSize_up;
 		document.onmousemove = mod_dragMapSize_drag;
 		
@@ -51,7 +59,7 @@
 		mb_start_y = clickY;
 		mb_end_x = clickX;
 		mb_end_y = clickY;
-		mod_dagMapSize_active = true;
+		mod_dragMapSize_active = true;
 
 		//create a div that catches all mouse interactions
 		var dragElement = document.getElementById("dragMapSize");
@@ -78,7 +86,7 @@
 	var mouseCatcher = document.getElementById("dragMapSize_helper");
 	mouseCatcher.parentNode.removeChild(mouseCatcher);
 	
-	mod_dagMapSize_active = false;
+	mod_dragMapSize_active = false;
 	mb_getMousePos(e);
 	mb_end_x = clickX;
 	mb_end_y = clickY;
@@ -107,7 +115,7 @@
 }
 
 function mod_dragMapSize_drag(e){
-	if(mod_dagMapSize_active){
+	if(mod_dragMapSize_active){
 	  	if (!e)
     		e = window.event;	
 		mb_getMousePos(e);

Deleted: branches/print_dev/http/javascripts/mod_getArea.php
===================================================================
--- branches/print_dev/http/javascripts/mod_getArea.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_getArea.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,71 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_getArea.php
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-echo "var mod_getArea_target = '".$e_target[0]."';";
-?>
-var mod_getArea_img = new Image();
-mod_getArea_img.src = "../img/button_gray/getArea_off.gif";
-register_measureSubFunctions("mod_getArea()");
-
-function mod_getArea(){
-	var str =  "<div style='position:absolute;top:50px' onmouseup='parent.mod_getArea_go()' ";
-	str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_disableTimeout()'><img src='"+mod_getArea_img.src+"'></div>";
-	return str;
-}
-function mod_getArea_go(){
-	if(mod_measure_RX[mod_measure_RX.length -1] == mod_measure_RX[0] && mod_measure_RY[mod_measure_RY.length -1] == mod_measure_RY[0]){
-		var ind = getMapObjIndexByName(mod_getArea_target);
-		var url = "../php/mod_evalArea.php?x=";
-		for(var i=0; i<mod_measure_RX.length;i++){
-			if(i>0){ url += ",";}
-			url += mod_measure_RX[i];
-		}
-		url += "&y=";
-		for(var i=0; i<mod_measure_RY.length;i++){
-			if(i>0){ url += ",";}
-			url += mod_measure_RY[i];
-		}
-		var srs = mb_mapObj[ind].epsg.split(":");
-		url += "&srs="+ escape(srs[1]);
-		url += "&length=" + mod_measure_TotalDist[mod_measure_TotalDist.length-1];
-		url += "&distance="  + mod_measure_TotalDist[mod_measure_TotalDist.length-2];
-		if(!mod_measure_win || mod_measure_win == null || mod_measure_win.closed == true){
-			mod_measure_win = window.open(url,"mod_measure_win","width=200,height=150,resizable=yes");
-		}
-		else{
-			mod_measure_win.document.location.href = url;
-		}
-		mod_measure_win.focus();
-	}
-	else{
-		if(!mod_measure_win || mod_measure_win == null || mod_measure_win.closed == true){
-			mod_measure_win = window.open("","mod_measure_win","width=200,height=150,resizable=yes");
-			mod_measure_win.document.open("text/html");
-			mod_measure_win.document.write("<span style = 'font-family : Arial, Helvetica, sans-serif;font-size : 12px;font-weight : bold;';>Strecke: " +mod_measure_TotalDist[mod_measure_TotalDist.length-1]+" m</span>");
-			mod_measure_win.document.close();        
-		}
-		else{
-			mod_measure_win.document.open("text/html");
-			mod_measure_win.document.write("<span style = 'font-family : Arial, Helvetica, sans-serif;font-size : 12px;font-weight : bold;';>Strecke: " +mod_measure_TotalDist[mod_measure_TotalDist.length-1]+" m</span>");
-			mod_measure_win.document.close();
-		}
-		mod_measure_win.focus();      
-	}
-}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_legend.php
===================================================================
--- branches/print_dev/http/javascripts/mod_legend.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_legend.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+ 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Deleted: branches/print_dev/http/javascripts/mod_rubber.js
===================================================================
--- branches/print_dev/http/javascripts/mod_rubber.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_rubber.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,14 +0,0 @@
-//$Id$
-//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_rubber.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
-var mod_rubber_img = new Image();
-mod_rubber_img.src = "../img/button_gray/rubber_off.gif";
-mod_rubber_img.title = "gemessene Strecke l&ouml;schen";
-register_measureSubFunctions("mod_rubber()");
-
-function mod_rubber(){
-   var str =  "<div onmouseup='parent.mod_rubber_go()' onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_rubber_img.src+"' title='"+mod_rubber_img.title+"'></div>";
-   return str;
-}
-function mod_rubber_go(){
-   mod_measure_delete();
-}
\ No newline at end of file

Deleted: branches/print_dev/http/javascripts/mod_rubberExt.js
===================================================================
--- branches/print_dev/http/javascripts/mod_rubberExt.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_rubberExt.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,8 +0,0 @@
-var mod_rubberExt_img = new Image();
-mod_rubberExt_img.src = "../img/button_gray/rubber_off.gif";
-register_setExtRequestSubFunctions("mod_rubberExt()");
-
-function mod_rubberExt(){
-	var str =  "<div onmouseup='parent.mod_wfs_spatialRequest_delete()' onmouseover='parent.mod_wfs_spatialRequest_timeout()' onmouseout=\"parent.mod_wfs_spatialRequest_digitize_go('polygon')\"><img src='"+mod_rubberExt_img.src+"'></div>";
-	return str;
-}

Modified: branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -163,7 +163,8 @@
 }
 
 function wfsEnable(obj) {
-   	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	var el = getMapDoc();
+
    	el.onmouseover = null;
    	el.onmousedown = null;
    	el.onmouseup = null;
@@ -188,7 +189,13 @@
 		for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
 			measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
 		}
-		writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
+		var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+		if (mb_mapObj[ind].type == "IFRAME") {
+			writeTag(mod_wfs_spatialRequest_target ,"measure_sub",measureSub);
+		}
+		else {
+			writeTag("" ,"measure_sub",measureSub);
+		}
 	}
 	else if (obj.id == button_rectangle){
 		if (activeButton == null) {
@@ -217,13 +224,30 @@
 	}
 }
 
+function getMapDoc () {
+	var mapIndex = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	var mapDomElement = mb_mapObj[mapIndex].getDomElement();
+	var mapType = mapDomElement.tagName.toUpperCase();
+	if (mapType == "IFRAME") {
+		return mapDomElement.window.document;
+	}
+	return window.document;
+}
+
 function wfsDisable(obj) {
-	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	var el = getMapDoc();
 	el.onmousedown = null;
 	el.ondblclick = null;
 	el.onmousemove = null;
-	writeTag(mod_wfs_spatialRequest_target,"measure_display","");
-	writeTag(mod_wfs_spatialRequest_target,"measure_sub","");
+	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	if (mb_mapObj[ind].type == "IFRAME") {
+		writeTag(mod_wfs_spatialRequest_target,"measure_display","");
+		writeTag(mod_wfs_spatialRequest_target,"measure_sub","");
+	}
+	else {
+		writeTag("", "measure_display", "");
+		writeTag("", "measure_sub", "");
+	}
 	activeButton = null;
 }
 
@@ -233,7 +257,7 @@
 // -------------------- rectangle -----------------------------------------------------------------
 
 function mod_selAreaExt_click(){
-   var el = window.frames[mod_wfs_spatialRequest_target].document;
+	var el = getMapDoc();
    el.onmouseover = mod_selAreaExt_init;
    el.onmousedown = mod_box_start;
    el.onmouseup = mod_selAreaExt_get;
@@ -274,22 +298,48 @@
 	}
 	s = new Snapping(mod_wfs_spatialRequest_target);
 
-	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	var el = getMapDoc();
 	el.onmousedown = mod_wfs_spatialRequest_start;
 	el.onmousemove = mod_wfs_spatialRequest_run;
 	var measureSub = "";
 	for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
 		measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
 	}
-	writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
+	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	if (mb_mapObj[ind].type == "IFRAME") {
+		writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
+	}
+	else {
+		writeTag("", "measure_sub", measureSub);
+	}
 }
 
 // ---------------------------------------------------------------------------------------------
 
+function mod_wfs_getMousePosition(e) {
+	mb_getMousePos(e, mod_wfs_spatialRequest_target);
+	var currentPos = null;
+	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	if (mb_mapObj[ind].type == "DIV") {
+		var mapDomElement = mb_mapObj[ind].getDomElement();
+		currentPos = new parent.Point(
+			parent.clickX - parseInt(mapDomElement.style.left), 
+			parent.clickY - parseInt(mapDomElement.style.top)
+		);
+	}
+	else {
+		currentPos = new parent.Point(
+			parent.clickX, 
+			parent.clickY
+		);
+	}
+	return currentPos;
+}
+
+
 function mod_wfs_spatialRequest_run(e) {
 	if (mod_wfs_spatialRequest_geometry.count() >= 3) {
-		mb_getMousePos(e,mod_wfs_spatialRequest_target);
-		var pos = new Point(clickX,clickY);
+		var pos = mod_wfs_getMousePosition(e);
 		s.check(pos);
 	}
 }
@@ -301,8 +351,8 @@
 		s.clean();
 	}
 	else {
-		mb_getMousePos(e,mod_wfs_spatialRequest_target);
-		realWorldPos = mapToReal(mod_wfs_spatialRequest_target,new Point(clickX,clickY));
+		var pt = mod_wfs_getMousePosition(e);
+		realWorldPos = mapToReal(mod_wfs_spatialRequest_target, pt);
 	}
 
 	mod_wfs_spatialRequest_geometry.addPoint(realWorldPos);
@@ -338,7 +388,13 @@
 			}
 		}
 	}
-	writeTag(mod_wfs_spatialRequest_target,"measuring",str_mPoints);
+	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	if (mb_mapObj[ind].type == "IFRAME") {
+		writeTag(mod_wfs_spatialRequest_target,"measuring",str_mPoints);
+	}
+	else {
+		writeTag("", "measuring", str_mPoints);
+	}
 }
 function evaluateDashesExt(p1,p0,count){
 	var str_dashedLine = "";
@@ -374,19 +430,26 @@
 }
 
 function mod_wfs_spatialRequest_delete(){
-	writeTag(mod_wfs_spatialRequest_target,"measuring","");
-	writeTag(mod_wfs_spatialRequest_target,"measure_display","");
+	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	if (mb_mapObj[ind].type == "IFRAME") {
+		writeTag(mod_wfs_spatialRequest_target,"measuring","");
+		writeTag(mod_wfs_spatialRequest_target,"measure_display","");
+	}
+	else {
+		writeTag("","measuring","");
+		writeTag("","measure_display","");
+	}
 }
 
 function mod_wfs_spatialRequest_timeout(){
-	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	var el = getMapDoc();
 	el.onmousedown = null;
 	el.ondblclick = null;
 	el.onmousemove = null;
 }
 
 function mod_wfs_spatialRequest_disableTimeout(){
-	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	var el = getMapDoc();
 	el.onmousedown = mod_wfs_spatialRequest_start;
 }
 

Deleted: branches/print_dev/http/javascripts/wfs.js
===================================================================
--- branches/print_dev/http/javascripts/wfs.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/javascripts/wfs.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,496 +0,0 @@
-// ---------------------------------------------------------------------------------------------------------------
-// --- usemap (begin) --------------------------------------------------------------------------------------------
-
-function mod_usemap(wfs_name) {
-	if (wfs_name == "") {
-		usemap = "";
-	}
-	var ind = getMapObjIndexByName(mb_wfs_target);
-	var myImg = window.frames[mb_wfs_target].document.getElementById("um_img").style; 
-	myImg.width = mb_mapObj[ind].width;
-	myImg.height = mb_mapObj[ind].height;
-
-	for (var i = 0 ; i < mb_wfs_fetch.count() ; i ++) {
-		if (mb_wfs_fetch.get(i).wfs_conf == wfs_name || wfs_name == "") {
-		
-			if (mb_wfs_fetch.get(i).geomType == geomType.polygon) {
-				usemap += mod_usemap_polygon(i);
-			}
-			else if (mb_wfs_fetch.get(i).geomType == geomType.point) {
-				usemap += mod_usemap_circle(i);
-			}
-			else if (mb_wfs_fetch.get(i).geomType == geomType.line) {
-				usemap += mod_usemap_line(i);
-			}
-		}
-	}
-	writeUsemap(usemap);
-}
-
-function mod_usemap_circle(ind){
-	var str = "";
-	var coord = "";
-	
-	var title = "";
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
-		if (i>0) title += "&#10;";
-		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
-	}
-
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
-		var p = mb_wfs_fetch.getPoint(ind, i, 0);
-		var pos = realToMap(mb_wfs_target,p);
-		coord += pos.x + ", " + pos.y;
-		
-		str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
-		str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";
-		str += coord + ", " + mod_usemap_radius + "' href='#'>";
-	}
-	
-	return str;
-}
-
-function mod_usemap_line_calculate (aGeometry, j, orientation, cnt) {
-	var coord = "";
-
-	var p1 = realToMap(mb_wfs_targets[0],aGeometry.get(j));
-	var p2 = realToMap(mb_wfs_targets[0],aGeometry.get(j+orientation));
-
-	var vec = p2.minus(p1);
-	
-	if (vec.x != 0 || vec.y != 0) {
-		var n_vec;
-		if (vec.x != 0) {
-			if (vec.x > 0) n_vec = new Point((-vec.y)/vec.x, -1);
-			else n_vec = new Point(vec.y/vec.x, 1);
-		}
-		else {
-			if (vec.y > 0) n_vec = new Point(1,0);
-			else n_vec = new Point(-1,0);
-		}
-		n_vec = n_vec.times(mod_usemap_line_tolerance).dividedBy(n_vec.dist(new Point(0,0)))
-
-		lp = new Point(p1.x + n_vec.x, p1.y - n_vec.y);
-
-		if (cnt > 0) coord += ", ";
-
-		coord += parseInt(lp.x) + ", " + parseInt(lp.y);
-		coord += ", " + parseInt(lp.x+vec.x) + ", " + parseInt(lp.y+vec.y);
-	}
-	return coord;
-}
-
-function mod_usemap_line(ind){
-	var str = "";
-	var title = "";
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
-		if (i>0) title += "&#10;";
-		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
-	}
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
-		var coord = "";
-		var cnt = 0;
-
-		for (var j = 0 ; j < mb_wfs_fetch.getGeometry(ind,i).count() - 1  ; j ++) {
-			var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, 1, cnt);
-			if (result != "") {
-				coord += result;
-				cnt++;
-			}
-		}
-		
-		for (var j = (mb_wfs_fetch.getGeometry(ind,i).count() - 1) ; j > 0 ; j--) {
-			var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, -1, cnt);
-			if (result != "") {
-				coord += result;
-				cnt++;
-			}
-		}
-		
-		if (coord != "") {
-			str += "<AREA title='"+title+"'";
-			str += "onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
-			str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' ";
-			str += "shape='poly'  coords='";
-			str += coord + "' href='#'>";
-		}
-		else {
-			//display circle
-			var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));
-			coord += pos.x + ", " + pos.y;
-			
-			str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
-			str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";
-			str += coord + ", " + mod_usemap_radius + "' href='#'>";
-		}
-	}
-	
-	return str;
-}
-
-function mod_usemap_polygon(ind){
-	var str = "";
-	var coord = "";
-	var title = "";
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
-		if (i>0) title += "&#10;";
-		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
-	}
-
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
-		var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, 0));
-		coord += pos.x + ", " + pos.y;
-		
-		for (var j = 1 ; j < mb_wfs_fetch.getGeometry(ind,i).count() ; j ++) {
-			pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, j));
-			coord += ", " + pos.x + ", " + pos.y;
-		}
-		
-		str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
-		str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='poly'  coords='";
-		str += coord + "' href='#'>";
-	}
-	
-	return str;
-}
-
-function writeUsemap(str) {
-	writeTag(mb_wfs_targets[0], 'um', str);
-}
-// --- usemap (end) ----------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------------------
-
-
-var highlight_tag_id = "wfs_highlight_tag";
-var mb_wfs_fetched = [];
-
-
-var mb_wfs_target = "mapframe1";
-var mb_wfs_objwin = null;
-var mb_wfs_objwin_left = 800;
-var mb_wfs_objwin_top = 200;
-var mb_wfs_objwin_width = 200;
-var mb_wfs_objwin_height = 200;
-var mb_wfs_targets = new Array("mapframe1","overview");
-var mb_wfs_fillColor = "#ff0000";
-var usemap = "";
-var mod_usemap_radius = 10;
-var mod_usemap_line_tolerance = 5;
-var useCheckboxForHighlighting = false;
-
-var mb_wfs_fetch = new GeometryArray();
-
-var highlight;
-
-try {if(generalHighlightZIndex){}}catch(e) {generalHighlightZIndex = 90;}
-try {if(generalHighlightLineWidth){}}catch(e) {generalHighlightLineWidth = 2;}
-try {if(useUsemap){}}catch(e) {useUsemap = 0;}
-
-mb_registerInitFunctions('initHighlight()');
-
-function initHighlight() {
-	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
-	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, styleObj, generalHighlightLineWidth);
-}
-try {if(displayWfsResultList){}}catch(e) {displayWfsResultList = 0;};
-
-if (displayWfsResultList == 1) {
-	//mb_registerWfsReadSubFunctions(function(geom){mb_wfs_listMember(geom)});
-}
-
-
-if (parseInt(useUsemap) == 1) {
-	mb_registerSubFunctions('mod_usemap("")');
-}
-
-if (useCheckboxForHighlighting) {
-	eventInit.register(function() {
-		mb_registerSubFunctions('highlight.paint()');
-	});
-}
-
-/*
-if (useExtentIsSet()) {
-	mb_registerSubFunctions("mb_setwfsrequest_extent()");
-}
-function mb_setwfsrequest_extent() {
-
-	if (useExtentIsSet()) {
-		var ind = getMapObjIndexByName(mb_wfs_targets[0]);
-		var pos_a = makeClickPos2RealWorldPos(mb_wfs_targets[0],0,0);
-		var pos_b = makeClickPos2RealWorldPos(mb_wfs_targets[0],mb_mapObj[ind].width,mb_mapObj[ind].height);
-
-		var x = [];
-		var y = [];
-		x[0] = pos_a[0];
-		x[1] = pos_b[0];
-		y[0] = pos_a[1];
-		y[1] = pos_b[1];
-
-		mb_setwfsrequest(mb_wfs_targets[0],'rectangle',x,y);
-	}
-}
-*/
-
-function mb_wfs_listMember(geomArray){
-	mb_wfs_fetch.union(geomArray);
-	var wfs_conf = get_complete_wfs_conf();
-	var str = "<table>";
-	for(var i=0; i<mb_wfs_fetch.count(); i++){
-		var t = wfs_conf[mb_wfs_fetch.get(i).wfs_conf];
-		for(var j=0; j<t['element'].length; j++){
-			if(t['element'][j]['f_show'] > 0){
-				var k = mb_wfs_fetch.get(i).e.getElementIndexByName(t['element'][j]['element_name']);
-				//alert(k);
-				if(k != -1){
-					str += "<tr><td>";
-					if (useCheckboxForHighlighting) {
-						str += "<input type=checkbox id=highlightCheckbox" + i + " onChange='highlightGeometry(" + i + ")'></td><td>";
-					}
-					str += "<div";
-					if (!useCheckboxForHighlighting) {
-						str += " onmouseover='mb_wfs_perform(\"over\",mb_wfs_fetch.get("+i+"))' ";
-						str += " onmouseout='mb_wfs_perform(\"out\",mb_wfs_fetch.get("+i+"))' ";
-					}
-					str += " onclick='mb_wfs_perform(\"click\",mb_wfs_fetch.get("+i+"))' ";
-					str += ">" + mb_wfs_fetch.get(i).e.getValue(k)+ "</div></td></tr>";
-				}
-			}
-		}
-	}
-	str += "</table>";
-	mb_wfs_objwin.innerHTML = str;
-//	if (parseInt(useUsemap) == 1) mod_usemap(wfs_name);
-}
-
-function mb_wfs_reset(){
-	mb_wfs_fetch = new parent.GeometryArray();
-	usemap = "";
-
-	if(mb_wfs_objwin == null){
-		var iframe=document.createElement('div');
-		iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");
-		mb_wfs_objwin = document.body.appendChild(iframe);
-		mb_wfs_objwin.id = "mb_wfs_objwin";
-		mb_wfs_objwin.name = "mb_wfs_objwin";
-		mb_wfs_objwin.style.position = 'absolute';
-		mb_wfs_objwin.style.left = mb_wfs_objwin_left+"px";
-		mb_wfs_objwin.style.top = mb_wfs_objwin_top+"px";
-		mb_wfs_objwin.style.width = mb_wfs_objwin_width+"px";
-		mb_wfs_objwin.style.height = mb_wfs_objwin_height+"px";
-	}
-	for(var i=0; i<mb_wfsreq; i++){
-		if(document.getElementById("mb_wfs_win_"+mb_wfsreq)){
-			document.removeChild("mb_wfs_win_"+mb_wfsreq);
-		}
-	}
-	mb_wfsreq = 0;
-	return true;
-}
-
-function get_complete_wfs_conf() {
-	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
-	return wfs_conf;
-}
-
-function highlightGeometry(i) {
-	var id = "highlightCheckbox"+i;
-	if (document.getElementById(id).checked) {
-		highlight.add(mb_wfs_fetch.get(i), '#00ff00');
-		highlight.paint();
-	}
-	else {
-		highlight.del(mb_wfs_fetch.get(i), '#00ff00');
-		highlight.paint();
-	}
-}
-
-function mb_wfs_perform(type,m){
-
-	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
-	if(type=='over') {
-		highlight.add(m, '#ff0000');
-		highlight.paint();
-	}
-	else if (type == 'out') {
-		highlight.del(m, '#ff0000');
-		highlight.paint();
-	}
-	else
-		if (type == 'click') {
-			var tmp = m.getBBox();
-			if (m.geomType == geomType.point) {
-				var b = 1;
-			}
-			else {
-				var b = 0;
-			}
-			if (typeof(m.wfs_conf) != "undefined") {
-				b = parseFloat(wfs_conf[m.wfs_conf]['g_buffer']);
-			}
-			var buffer = new Point(b, b);
-			var bbox_ll = tmp[0].minus(buffer);
-			var bbox_ru = tmp[1].plus(buffer);
-			mb_calcExtent(mb_wfs_targets[0], bbox_ll, bbox_ru);
-			highlight.del(m, '#ff0000');
-			zoom(mb_wfs_targets[0], 'true', 1.0);
-			highlight.add(m, '#ff0000');
-			highlight.paint();
-		}
-}
-
-function get_wfs_str(myconf, d, m, type, fid) {
-
-	<!-- Getting the Namspace for the FeautureType -->
-	var featureTypeArray = myconf['featuretype_name'].split(':')
-	var featureNS = featureTypeArray[0];
-
-	var str = '<wfs:Transaction version="1.0.0" service="WFS" ';
-
-	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_featureNS = false;
-
-	for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
-
-		if (myconf['namespaces'][q]['name'] == "gml"){
-			 ns_gml = true;
-			 str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == "ogc") {
-			ns_ogc = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == "xsi") {
-			ns_xsi = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == "wfs") {
-			ns_wfs = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == featureNS) {
-			ns_featureNS = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" '
-			strForSchemaLocation = myconf['namespaces'][q]['location'];
-		}
-	}
-
-	if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
-	if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
-	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
-	if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
-	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
-
-	str += 'xsi:schemaLocation="http://www.opengis.net/wfs';
-	str += ' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
-	str += ' ' + strForSchemaLocation;
-	str += ' '+ myconf['wfs_describefeaturetype'];
-	//str += mb_getConjunctionCharacter(myconf['wfs_describefeaturetype']);
-	//str += 'typename=' + myconf['featuretype_name'];
-	str += '">';
-
-	//
-	// ---------------------------------------- SAVE -------------------------------------------------
-	//
-	if (type == "save") {
-		str += '<wfs:Insert><'+ myconf['featuretype_name']+'>';
-		for(var i=0; i<d.get(m).e.count(); i++){
-			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
-				var tmp = d.get(m).e.getName(i);
-				str += '<' + tmp  + '>' + d.get(m).e.getValue(i) + '</' + tmp  + '>';
-			}
-		}
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];
-			}
-		}
-		str += '<' + el_geom + '>';
-		if(d.get(m).geomType == geomType.point){
-			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
-			str += '</gml:coordinates>';
-			str += '</gml:Point>';
-		}
-		if(d.get(m).geomType == geomType.line){
-			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			}
-			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
-			str += '</gml:MultiLineString>';
-		}
-		if(d.get(m).geomType == geomType.polygon){
-			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			}
-			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
-		}
-		str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';
-	}
-	//
-	// --------------------------------------- UPDATE ------------------------------------------------
-	//
-	else if (type == "update") {
-		str += '<wfs:Update typeName="'+ myconf['featuretype_name']+'">';
-		for(var i=0; i<d.get(m).e.count(); i++){
-			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
-				str += '<wfs:Property>';
-				str += '<wfs:Name>'+d.get(m).e.getName(i)+'</wfs:Name>';
-				str += '<wfs:Value>'+d.get(m).e.getValue(i)+'</wfs:Value>';
-				str += '</wfs:Property>';
-			}
-		}
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];
-			}
-		}
-		str += '<wfs:Property><wfs:Name>' + el_geom + '</wfs:Name><wfs:Value>';
-		if(d.get(m).geomType == geomType.point){
-			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '"><gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
-			str += '</gml:coordinates></gml:Point>';
-		}
-		if(d.get(m).geomType == geomType.line){
-			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			}
-			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
-			str += '</gml:MultiLineString>';
-		}
-		if(d.get(m).geomType == geomType.polygon){
-			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			}
-			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
-		}
-		str += '</wfs:Value></wfs:Property>';
-		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
-		str += '</wfs:Update>';
-	}
-	//
-	// --------------------------------------- DELETE ------------------------------------------------
-	//
-	else if (type == "delete") {
-		str += '<wfs:Delete typeName="'+ myconf['featuretype_name']+'">';
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];
-			}
-		}
-		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
-		str += '</wfs:Delete>';
-	}
-
-	str += '</wfs:Transaction>';
-	return str;
-}
\ No newline at end of file

Deleted: branches/print_dev/http/php/mod_changeEPSG.php
===================================================================
--- branches/print_dev/http/php/mod_changeEPSG.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/php/mod_changeEPSG.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,211 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_changeEPSG.php
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require(dirname(__FILE__)."/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<meta name="author-mail" content="info at ccgis.de">
-<meta name="author" content="U. Rothstein">
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Change Spatial Reference System EPSG Code</title>
-<?php
-$e_id_css = 'changeEPSG';
-echo "<script type='text/javascript'>";
-include(dirname(__FILE__)."/../include/dyn_js.php");
-echo "</script>";
-
-$sql = "SELECT e_target FROM gui_element WHERE e_id = 'changeEPSG' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sql,$v,$t);
-
-echo "<script type='text/javascript'>";
-echo "var myTarget = '".db_result($res,0,"e_target")."';";
-echo "</script>";
-
-# transform coordinates
-if(isset($_REQUEST["srs"])){
-	require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
-	$arraymapObj = mb_split("###", $_REQUEST["srs"]);
-	echo "<script type='text/javascript'>";
-	echo "var newExtent = new Array();";
-	for($i=0; $i < count($arraymapObj); $i++){
-		$temp = mb_split(",",$arraymapObj[$i]);
-
-		// check if parameters are valid geometries to 
-		// avoid SQL injections
-
-		$oldEPSG = preg_replace("/EPSG:/","",$temp[1]);
-		$newEPSG = preg_replace("/EPSG:/","",$_REQUEST["newSRS"]);
-		 
-		if (is_numeric($temp[2]) && is_numeric($temp[3]) && is_numeric($temp[4]) && is_numeric($temp[5]) && is_numeric($oldEPSG) && is_numeric($newEPSG)) {
-		
-			if(SYS_DBTYPE=='pgsql'){
-				$con = db_connect($DBSERVER,$OWNER,$PW);
-				$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".$oldEPSG."),".$newEPSG.")) as minx";
-				$resMinx = db_query($sqlMinx);
-				$minx = db_result($resMinx,0,"minx");
-				
-				$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".$oldEPSG."),".$newEPSG.")) as miny";
-				$resMiny = db_query($sqlMiny);
-				$miny = db_result($resMiny,0,"miny");
-				
-				$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".$oldEPSG."),".$newEPSG.")) as maxx";
-				$resMaxx = db_query($sqlMaxx);
-				$maxx = db_result($resMaxx,0,"maxx");
-				
-				$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".$oldEPSG."),".$newEPSG.")) as maxy";
-				$resMaxy = db_query($sqlMaxy);
-				$maxy = db_result($resMaxy,0,"maxy");
-			}else{
-				$con_string = "host=$GEOS_DBSERVER port=$GEOS_PORT dbname=$GEOS_DB user=$GEOS_OWNER password=$GEOS_PW";
-				$con = pg_connect($con_string) or die ("Error while connecting database");
-				
-				$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".$oldEPSG."),".$newEPSG.")) as minx";
-				$resMinx = pg_query($con,$sqlMinx);
-				$minx = pg_fetch_result($resMinx,0,"minx");
-				
-				$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".$oldEPSG."),".$newEPSG.")) as miny";
-				$resMiny = pg_query($con,$sqlMiny);
-				$miny = pg_fetch_result($resMiny,0,"miny");
-				
-				$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".$oldEPSG."),".$newEPSG.")) as maxx";
-				$resMaxx = pg_query($con,$sqlMaxx);
-				$maxx = pg_fetch_result($resMaxx,0,"maxx");
-				
-				$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".$oldEPSG."),".$newEPSG.")) as maxy";
-				$resMaxy = pg_query($con,$sqlMaxy);
-				$maxy = pg_fetch_result($resMaxy,0,"maxy");
-			}
-			$extenty = $maxy - $miny;
-			$extentx = $maxx - $minx;
-			$relation_px_x = $temp[6] / $temp[7];
-			$relation_px_y = $temp[7] / $temp[6];
-			$relation_bbox_x = $extentx / $extenty;
-	
-			if($relation_bbox_x <= $relation_px_x){
-				$centerx = $minx + ($extentx/2);
-				$minx = $centerx - $relation_px_x * $extenty / 2;
-				$maxx = $centerx + $relation_px_x * $extenty / 2;
-			}
-			if($relation_bbox_x > $relation_px_x){
-				$centery = $miny + ($extenty/2);
-				$miny = $centery - $relation_px_y * $extentx / 2;
-				$maxy = $centery + $relation_px_y * $extentx / 2;
-			}
-			echo "newExtent[".$i."] = '".$temp[0].",".$_REQUEST["newSRS"].",".$minx.",".$miny.",".$maxx.",".$maxy."';";
-		}
-		else {
-			echo "var e = new parent.Mb_exception('mod_changeEPSG.php: invalid input parameter (p1 = (" . $temp[2] . "," . $temp[3] . "), p2 = (" . $temp[4] . "," . $temp[5] . "), old EPSG: " . $oldEPSG . ", new EPSG: " . $newEPSG . ", ).');";
-		}		
-	}
-	echo "</script>";
-}
-else{
-	echo "<script type='text/javascript'>var newExtent = false;</script>";
-}
-?>
-<script type='text/javascript'>
-<!--
-if(newExtent == false){
-	parent.mb_registerSubFunctions("window.frames['changeEPSG'].mod_changeEPSG_setBox()");
-}
-
-function mod_changeEPSG_init(){
-//frameName, EPSG, minx, miny, maxx, maxy, width, height
-	var exists = false;
-	if(newExtent){
-		for(var i=0; i<newExtent.length; i++){
-			var temp = newExtent[i].split(",");
-			if(temp[0] == myTarget){
-				for(var ii=0; ii<parent.mb_MapHistoryObj[temp[0]].length; ii++){
-					if(parent.mb_MapHistoryObj[temp[0]][ii].epsg == temp[1]){
-						exists = ii;
-						var goback = true;
-					}
-				}
-				var ind = parent.getMapObjIndexByName(temp[0]);
-				if(goback){
-					parent.mb_mapObj[ind].epsg = temp[1];
-					parent.mb_mapObj[ind].extent = parent.mb_MapHistoryObj[temp[0]][exists].extent;
-					parent.setMapRequest(temp[0]);
-				}
-				else{
-					parent.mb_mapObj[ind].epsg = temp[1];
-					parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
-					parent.setMapRequest(temp[0]);
-				}
-			}
-			if(temp[0] != myTarget){
-				var ind = parent.getMapObjIndexByName(temp[0]);
-				parent.mb_mapObj[ind].epsg = temp[1];
-				parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
-				parent.setMapRequest(temp[0]);
-			}
-		}
-	}
-}
-
-function mod_changeEPSG_setBox(){
-	var myEPSG = parent.mb_mapObj[0].epsg;
-	for(var i=0; i<document.forms[0].epsg.length; i++){
-		if(document.forms[0].epsg.options[i].value == myEPSG){
-			document.forms[0].epsg.selectedIndex = i;
-			isEPSG = true;
-		}
-	}
-}
-
-function mod_changeEPSG(){
-	str_srs = "";
-	for(var i=0; i<parent.mb_mapObj.length; i++){
-		if(i>0){str_srs += "###";}
-		str_srs += parent.mb_mapObj[i].frameName + "," + parent.mb_mapObj[i].epsg + "," + parent.mb_mapObj[i].extent + ","+parent.mb_mapObj[i].width+","+parent.mb_mapObj[i].height;
-	}
-	document.forms[0].srs.value = str_srs;
-	var ind = document.forms[0].epsg.selectedIndex;
-	document.forms[0].newSRS.value = document.forms[0].epsg.options[ind].value;
-	document.forms[0].submit();
-}
-// -->
-</script>
-</head>
-<body leftmargin="1" topmargin="1" onload="mod_changeEPSG_init()" bgcolor="red">
-<form action="<?php echo $self;  ?>" method='POST'>
-<select class='epsg' name='epsg' onchange='mod_changeEPSG()'>
-<option value="">undefined</option>
-<option value="EPSG:4326">EPSG:4326</option>
-<option value="EPSG:31466">EPSG:31466</option>
-<option value="EPSG:31467">EPSG:31467</option>
-<option value="EPSG:31468">EPSG:31468</option>
-<option value="EPSG:31469">EPSG:31469</option>
-</select>
-<input type="hidden" name="srs" value="">
-<input type="hidden" name="newSRS" value="">
-</form>
-</body>
-</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_editElements.php
===================================================================
--- branches/print_dev/http/php/mod_editElements.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/php/mod_editElements.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -51,7 +51,7 @@
    }
    .buttonbar{
    	position:absolute;
-   	top:40px;
+   	top:60px;
    	left:10px;
    }
    .guiList1_text{
@@ -90,7 +90,7 @@
    }
    .myForm{
    	position:absolute;
-   	top:70px;
+   	top:90px;
    	left:10px;
    }
    .textfield{
@@ -458,8 +458,8 @@
 		  $guiId = $$Id;
 	   }
 
-	   echo "&nbsp;&nbsp;(" . $guiDesc;
-	   echo	" <input type='button' class='' name='' value='edit' onclick='editDesc()'> ) \n";
+	   echo "&nbsp;&nbsp;<br /><span style='font-size:75%'>(" . $guiDesc;
+	   echo	" <input type='button' class='' name='' value='edit' onclick='editDesc()'> ) </span>\n";
 	   echo "</div>\n";
 	   echo "<div class='buttonbar'>\n";
 	   echo "<input type='button' class='' name='' value='save' onclick='thisSave()'> \n";
@@ -606,4 +606,4 @@
 }
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>

Deleted: branches/print_dev/http/php/mod_help.php
===================================================================
--- branches/print_dev/http/php/mod_help.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/php/mod_help.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,61 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_help
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-include(dirname(__FILE__)."/../include/dyn_php.php");
-
-if(!isset($mod_help_width)){
-	$mod_help_width = 1000;	
-}
-if(!isset($mod_help_height)){
-	$mod_help_height = 1000;	
-}
-?>
-<img src='../img/transparent.gif' style='cursor:help' width='<?php echo $mod_help_width ?>' height='<?php echo $mod_help_height ?>' usemap='#mod_help_imagemap' border='0'>
-	<map name='mod_help_imagemap'>
-	<?php
-	$gui_id = $_REQUEST["gui_id"];
-	$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = $1 AND e_url <> '' AND e_public = 1";
-	$v = array($gui_id);
-	$t = array('s');
-	$res = db_prep_query($sql, $v, $t);
-	$cnt = 0;
-	while($row = db_fetch_array($res)){ 
-		echo "<area onclick=\"mod_help_disable();";
-		if($row["e_id"] != 'help'){
-			echo "window.open('".$row["e_url"]."');";	
-		}
-		echo "\" ";
-		echo "id=\"helpArea_".$row['e_id']."\" ";
-		echo "shape=\"rect\" coords=\"".$row['e_left'].",".$row['e_top'].",";		
-		echo ($row['e_left']+$row['e_width']).",".($row['e_top']+$row['e_height'])."\" ";
-//		echo "href=\"".$row["e_url"]."\" ";		
-		echo "href=\"javascript:\" ";
-		if($row["e_id"] != 'help'){
-			echo "alt=\"HELP: ".$row["e_url"]."\" title=\"HELP: ".$row["e_url"]."\" ";
-			#echo "target=\"_blank\"";	
-		}
-		else{
-			echo "alt=\"HELP: ".$mod_help_text."\" title=\"HELP: ".$mod_help_text."\" ";
-		}
-		echo " nohref>";
-		$cnt++;
-	}
-	?>
-</map>
\ No newline at end of file

Deleted: branches/print_dev/http/php/system.php
===================================================================
--- branches/print_dev/http/php/system.php	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/http/php/system.php	2009-01-29 13:32:04 UTC (rev 3500)
@@ -1,37 +0,0 @@
-<?php
-# $Id:$
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-#
-# mapbender version
-#
-define("MB_VERSION_NUMBER", "2.5.0");
-define("MB_VERSION_APPENDIX", "RC2");
-define("MB_RELEASE_DATE", mktime(0,0,0,4,21,2008));//h, min,sec,month,day,year
-
-#
-# constants from map.js
-#
-define("MB_RESOLUTION", "28.35");
-define("MB_FEATURE_COUNT", "100");
-define("MB_SECURITY_PROXY", "http://wms1.ccgis.de/mapbender/tools/security_proxy.php?mb_ows_security_proxy=");
-#
-# available log levels 
-#
-define("LOG_LEVEL_LIST", "off,error,warning,notice,all");
-
-define("ZOOM_MOUSEWHEEL", "1.1");
\ No newline at end of file

Modified: branches/print_dev/lib/basic.js
===================================================================
--- branches/print_dev/lib/basic.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/lib/basic.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -81,28 +81,28 @@
 }
 
 function mb_getMousePos(e,fName){
-if(fName){
-     if(ie){
-        clickX = window.frames[fName].event.clientX;
-        clickY = window.frames[fName].event.clientY;
-     }
-     else{
-        clickX = e.pageX;
-        clickY = e.pageY;
-     }
-  }
-  else{
-       if(ie){
-        clickX = event.clientX;
-        clickY = event.clientY;
-     }
-     else{
-        clickX = e.pageX;
-        clickY = e.pageY;
-     }
-  }
-  var pos = [clickX,clickY];
-  return pos;
+	if(fName){
+		if(ie){
+			clickX = window.frames[fName].event.clientX;
+			clickY = window.frames[fName].event.clientY;
+		}
+		else{
+			clickX = e.pageX;
+			clickY = e.pageY;
+		}
+	}
+	else{
+		if(ie){
+			clickX = event.clientX;
+			clickY = event.clientY;
+		}
+		else{
+			clickX = e.pageX;
+			clickY = e.pageY;
+		}
+	}
+	var pos = [clickX,clickY];
+	return pos;
 }
 
 function mb_arrangeElement(frameName, elName, left, top) {
@@ -114,5 +114,4 @@
       document.getElementById(elName).style.top = top;
       document.getElementById(elName).style.left = left;   
    }
-}
-
+}
\ No newline at end of file

Modified: branches/print_dev/lib/div.js
===================================================================
--- branches/print_dev/lib/div.js	2009-01-29 11:13:02 UTC (rev 3499)
+++ branches/print_dev/lib/div.js	2009-01-29 13:32:04 UTC (rev 3500)
@@ -13,7 +13,7 @@
  * @param aStyle {Object} an object containing a set of name value pairs, like
  *                        {position:absolute,top:30,z-Index:30}
  */
-function DivTag (aTagName, aFrameName, aStyle) {
+function DivTag (aTagName, aFrameName, aStyle, appendToThisDomElement) {
 	/**
 	 * @ignore
 	 */
@@ -80,8 +80,14 @@
 	var create = function () {
 		if (!that.exists()) {
 			var divTag = rootNode.createElement("div");
-			var divTagAppended = rootNode.getElementsByTagName("body")[0].appendChild(divTag);
-			divTagAppended.id = tagName;
+			var divTagAppended;
+			if (targetDomElement !== null) {
+				divTagAppended = targetDomElement.appendChild(divTag);
+			}
+			else {
+				divTagAppended = rootNode.getElementsByTagName("body")[0].appendChild(divTag);
+			}
+			divTag.id = tagName;
 		}
 		else {
 			that.clean();
@@ -103,6 +109,7 @@
 	var tagName = aTagName;
 	var frameName = aFrameName;
 	var rootNode = determineRootNode();
+	var targetDomElement = appendToThisDomElement ? appendToThisDomElement : null;
 	var tagStyle = aStyle;
 
 	create();



More information about the Mapbender_commits mailing list