[Mapbender-commits] r1462 - trunk/mapbender/http/print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 25 08:28:51 EDT 2007


Author: astrid_emde
Date: 2007-06-25 08:28:51 -0400 (Mon, 25 Jun 2007)
New Revision: 1462

Modified:
   trunk/mapbender/http/print/mod_printPDF.php
Log:
mapbender print with A1 and A0


Modified: trunk/mapbender/http/print/mod_printPDF.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF.php	2007-06-25 12:28:08 UTC (rev 1461)
+++ trunk/mapbender/http/print/mod_printPDF.php	2007-06-25 12:28:51 UTC (rev 1462)
@@ -1,407 +1,425 @@
-<?php
-# $Id: mod_printPDF.php
-# http://www.mapbender.org/index.php/mod_printPDF.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.
-session_start();
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<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>Print PDF</title>
-</head>
-<style type="text/css">
-<!-- 
-select{
-   width:150px;
-} 
-input{
-	width:150px;
-}
-.mycheck{
-	width:15px;
-}
-div{
-	font-family : Arial, Helvetica, sans-serif;
-	font-size: 12px;
-}
--->
-</style>
-<?php
-
-
-require_once(dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
-echo "<script type='text/javascript'>";
-echo "var target = '".$_REQUEST["target"]."';";
-echo "var comment = '".$label_comment."';";
-echo "var comment_length = ".$comment_length.";";
-echo "var label_button = '".$label_button."';";
-echo "var type = '".$type."';";
-echo "</script>";
-?>
-<script type="text/javascript">
-<!--
-
-
-var size;
-var format;
-var map_width;
-var map_height;
-
-if(type=='window'){
-	var pt = window.opener;
-}
-else if(type == 'iframe'){
-	var pt = parent;
-}
-
-function mod_legend_print(){
-	var mod_legend_target = target;
-	var ind = pt.getMapObjIndexByName(mod_legend_target);
-	var layers;
-
-	document.forms[0].layers.value = "";
-	document.forms[0].wms_id.value = "";
-	document.forms[0].wms_title.value = "";
-	document.forms[0].legendurl.value = "";
-	
-
-	
-	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible != 0){
-			layers = pt.mb_checkScale(mod_legend_target,ind,i);
-			var layer = layers[0].split(",");
-			var title = layers[2].split(",");
-			var temp_legendurl = layers[3].split(",");
-			var layerparent= layers[4].split(",");
-	
-			if( pt.mb_mapObj[ind].layers[i] != "" && pt.mb_mapObj[ind].layers[i]){
-	
-			   if(i>0 && document.forms[0].wms_id.value!=''){
-			    document.forms[0].layers.value += "___";
-			    document.forms[0].wms_id.value += "___";
-			    document.forms[0].wms_title.value += "___";
-			    document.forms[0].legendurl.value += "___";
-				}
-				
-				//document.forms[0].layers.value += pt.mb_mapObj[ind].wms[i].objLayer[ii].layer_title; //pt.mb_mapObj[ind].layers[i]	;
-				
-				document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;   
-				document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
-				
-				//---------- legendurl ----------
-				tmp_name = "";
-				for(var j=0; j<layer.length; j++){
-				 if(layerparent[j] == 0){
-					if(j>0){
-						document.forms[0].layers.value += ",";
-					}
-	
-					var l = pt.mb_getchildsbyname(ind,i,layer[j]);
-	
-				 	if (l) {
-				 		document.forms[0].layers.value += title[j];
-	
-				 		if(j>0){
-							document.forms[0].legendurl.value += ",";
-						}
-						for (var k=0; k<l["name"].length; k++){
-					 		if (tmp_name != l["title"][k]) {
-					 		    document.forms[0].layers.value += "*"
-					 			if(k>0){
-					 				 document.forms[0].legendurl.value += "*";
-					 			}else{
-					 				 document.forms[0].legendurl.value += '1*';
-					 			}
-	
-								if (l["legendurl"][k] != '' || !l["legendurl"][k]==true){
-									document.forms[0].layers.value += l["name"][k];
-					  				document.forms[0].legendurl.value += l["legendurl"][k];
-								}else{
-									document.forms[0].layers.value += '0';
-									document.forms[0].legendurl.value += '0';
-								}
-								tmp_name = l["title"][k];
-					 		}	// if
-						 } // for var k=0
-	
-					} // if (l) 
-					else{
-						//prompt (!temp_legendurl[j] ,temp_legendurl[j] + !temp_legendurl[j]);
-	
-							document.forms[0].layers.value += title[j];
-							if(j>0){
-								document.forms[0].legendurl.value += ",";
-							}
-							if (temp_legendurl[j]!= '' || !temp_legendurl[j] == 'true'){
-								document.forms[0].legendurl.value += temp_legendurl[j];
-							}else{
-								document.forms[0].legendurl.value +='0';
-							}
-						
-					}// else (l) 
-				   }//check parent==0
-				}//for var j=0
-				
-				//-------------------
-	
-				//document.forms[0].legendurl.value += layers[3];
-		
-			} else{
-				 if(i>0 && document.forms[0].wms_id.value!=''){
-			    document.forms[0].layers.value += "___";
-			    document.forms[0].wms_id.value += "___";
-			    document.forms[0].wms_title.value += "___";
-			    document.forms[0].legendurl.value += "___";
-				}
-				
-				document.forms[0].layers.value += "0";
-			    document.forms[0].wms_id.value += "0";
-			    document.forms[0].wms_title.value += "0";
-			    document.forms[0].legendurl.value += "0";
-			}
-		}//if
-	}//for
-}
-
-function validate(){
-	size = document.form1.size.options[document.form1.size.selectedIndex].value;
-	format = document.form1.format.options[document.form1.format.selectedIndex].value;
-	if(size != "" && format != ""){
-		var ind = pt.getMapObjIndexByName(target);
-		var coord = pt.mb_mapObj[ind].extent.split(",");
-		var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
-		var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
-		if(size == "A4" && format == "portrait"){
-			map_width = <?php echo $a4p_map_width; ?>; 
-			map_height = <?php echo $a4p_map_height; ?>; 
-		}
-		if(size == "A4" && format == "landscape"){
-			map_width = <?php echo $a4l_map_width; ?>;
-			map_height = <?php echo $a4l_map_height; ?>; 
-		}
-		if(size == "A3" && format == "portrait"){
-			map_width = <?php echo $a3p_map_width; ?>;
-			map_height = <?php echo $a3p_map_height; ?>;
-		}
-		if(size == "A3" && format == "landscape"){
-			map_width = <?php echo $a3l_map_width; ?>;
-			map_height = <?php echo $a3l_map_height; ?>;
-		}  
-		if(size == "A2" && format == "portrait"){
-			map_width = <?php echo $a2p_map_width; ?>;
-			map_height = <?php echo $a2p_map_height; ?>;
-		}
-		if(size == "A2" && format == "landscape"){
-			map_width = <?php echo $a2l_map_width; ?>;
-			map_height = <?php echo $a2l_map_height; ?>;
-		}     
-		var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
-		pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
-
-		pt.mb_mapObj[ind].width = Math.round(map_width);
-		pt.mb_mapObj[ind].height = Math.round(map_height);
-		pt.document.getElementById(target).style.width = Math.round(map_width);
-		pt.document.getElementById(target).style.height = Math.round(map_height);
-		pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
-		pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
-
-		//pt.setMapRequest(target);		
-		pt.mb_repaintScale(target, null, null, pt.mb_getScale(target));
-      	document.form1.map_url.value = '';
-		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-			if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
-				if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
-					if(document.form1.map_url.value != ""){
-						document.form1.map_url.value += "___";
-					}         
-					document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
-				}
-			}
-		}
-		
-		//overview_url
-		var ind_overview = pt.getMapObjIndexByName('overview');
-
-		//alert ("länge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
-		if(pt.mb_mapObj[ind_overview].mapURL != false ){
-			document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
-		}
-	}
-}
-function refreshParams(){
-	var ind = pt.getMapObjIndexByName(target);
-	var f = document.form1;
-	f.map_url.value = "";
-	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
-			if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
-				if(f.map_url.value != ""){
-					f.map_url.value += "___";
-				}      
-				f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
-			}
-		}
-	}
-	f.map_scale.value = pt.mb_getScale(target);
-	f.epsg.value = pt.mb_mapObj[ind].epsg;
-	mod_legend_print();
-}
-function printMap(){
-	if(size != "" && (format == "portrait" || format == "landscape")){
-		refreshParams();
-		if(document.form1.c1.value != comment){
-			document.form1.comment1.value = document.form1.c1.value;
-		}
-		if(document.form1.c2.value != comment){
-			document.form1.comment2.value = document.form1.c2.value;
-		}
-		if(document.form1.mylegendcheckbox.checked == 0){
-			document.form1.mylegend.value = 'false';
-		}else{
-			document.form1.mylegend.value = 'true';
-		}
-		
-		// write the measured coordinates
-		
-		if (pt.mod_measure_RX != undefined && pt.mod_measure_RY != undefined) {
-			var tmp_x = '';
-			var tmp_y = '';
-			for(i = 0; i<pt.mod_measure_RX.length; i++) {
-				if(tmp_x != '') {
-					tmp_x += ','
-				}
-				tmp_x += pt.mod_measure_RX[i];
-			}
-			for(i = 0; i<pt.mod_measure_RY.length; i++) {
-				if(tmp_y != '') {
-					tmp_y += ','
-				}
-				tmp_y += pt.mod_measure_RY[i];
-			}
-			document.forms['form1'].elements['measured_x_values'].value = tmp_x;
-			document.forms['form1'].elements['measured_y_values'].value = tmp_y;
-		}
-		
-		document.form1.submit();
-	}
-	else{
-		alert("Das Format ist noch nicht ausgewählt.");
-	}
-}
-function valCom(obj){
-	if(obj.value.length > comment_length){
-		obj.value = obj.value.substr(0,comment_length);
-	}
-}
-// -->
-</script>
-<body>
-<form name='form1' method='POST' action='../print/mod_printPDF_pdf.php?<?php echo SID; ?>' target="_blank">
-<table border='0'>
-<tr>
-	<td>
-	<select name='size' onchange='validate()'>
-<?php
-	if($a4 == true && $a3 == true){
-		echo "<option value=''>".$label_format."</option>";
-	}
-	if($a4 == true){
-		echo "<option value='A4'>".$label_format_a4."</option>";
-	}
-	if($a3 == true){
-		echo "<option value='A3'>".$label_format_a3."</option>";
-	}
-	if($a2 == true){
-		echo "<option value='A2'>".$label_format_a2."</option>";
-	}
-?>
-	</select>
-	</td>   
-</tr>
-<tr>
-	<td>
-	<select name='format' onchange='validate()'>
-	<option value=''><?php echo $label_orientation; ?></option>
-	<option value='portrait'><?php echo $label_portrait; ?></option>
-	<option value='landscape'><?php echo $label_landscape; ?></option>
-	</select>
-	</td>
-</tr>
-<?php
-if($highquality == true){
-	echo "<tr>";
-		echo "<td>";
-		echo "<select name='quality'>";
-		echo "<option value='1'>".$label_72dpi."</option>";
-		echo "<option value='2'>".$label_288dpi."</option>";
-		echo "</select>";
-		echo "</td>";
-	echo "</tr>";
-}
-?>
-<tr>
-	<td>
-		<input type='text' name='c1' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
-	</td>
-</tr>
-<tr>
-	<td>
-		<input type='text' name='c2' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
-	</td>
-</tr>
-<?php
-echo "<tr>";
-echo "<td>";
-if($legend == true){
-	echo "<div>";
-}else{
-	echo "<div style='visibility:hidden;'>";
-}
-echo "<input type='checkbox' class='mycheck' name='mylegendcheckbox' value='false'>".$label_legend."</div>";
-echo "</td>";
-echo "</tr>";
-
-?>
-<table>  
-<input type='hidden' name='map_url' value=''>
-<input type='hidden' name='overview_url' value=''>
-<input type='hidden' name='wms_title' value=''>
-<input type='hidden' name='wms_id' value=''>
-<input type='hidden' name='layers' value=''>
-<input type='hidden' name='legendurl' value=''>
-<input type='hidden' name='map_scale' value=''>
-<input type='hidden' name='epsg' value=''>
-<input type='button' name='print' value="<?php echo $label_button; ?>" onclick='printMap()'>
-<input type='hidden' name='conf' value='<?php echo $_REQUEST["conf"]; ?>'>
-<input type='hidden' name='comment1' value=''>
-<input type='hidden' name='comment2' value=''>
-<input type='hidden' name='mylegend' value='true'>
-<input type='hidden' name='measured_x_values' value=''>
-<input type='hidden' name='measured_y_values' value=''>
-
-</form>
-</body>
-</html>
+<?php
+# $Id: mod_printPDF.php
+# http://www.mapbender.org/index.php/mod_printPDF.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.
+session_start();
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<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>Print PDF</title>
+</head>
+<style type="text/css">
+<!-- 
+select{
+   width:150px;
+} 
+input{
+	width:150px;
+}
+.mycheck{
+	width:15px;
+}
+div{
+	font-family : Arial, Helvetica, sans-serif;
+	font-size: 12px;
+}
+-->
+</style>
+<?php
+
+
+require_once(dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
+echo "<script type='text/javascript'>";
+echo "var target = '".$_REQUEST["target"]."';";
+echo "var comment = '".$label_comment."';";
+echo "var comment_length = ".$comment_length.";";
+echo "var label_button = '".$label_button."';";
+echo "var type = '".$type."';";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+
+
+var size;
+var format;
+var map_width;
+var map_height;
+
+if(type=='window'){
+	var pt = window.opener;
+}
+else if(type == 'iframe'){
+	var pt = parent;
+}
+
+function mod_legend_print(){
+	var mod_legend_target = target;
+	var ind = pt.getMapObjIndexByName(mod_legend_target);
+	var layers;
+
+	document.forms[0].layers.value = "";
+	document.forms[0].wms_id.value = "";
+	document.forms[0].wms_title.value = "";
+	document.forms[0].legendurl.value = "";
+	
+
+	
+	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible != 0){
+			layers = pt.mb_checkScale(mod_legend_target,ind,i);
+			var layer = layers[0].split(",");
+			var title = layers[2].split(",");
+			var temp_legendurl = layers[3].split(",");
+			var layerparent= layers[4].split(",");
+	
+			if( pt.mb_mapObj[ind].layers[i] != "" && pt.mb_mapObj[ind].layers[i]){
+	
+			   if(i>0 && document.forms[0].wms_id.value!=''){
+			    document.forms[0].layers.value += "___";
+			    document.forms[0].wms_id.value += "___";
+			    document.forms[0].wms_title.value += "___";
+			    document.forms[0].legendurl.value += "___";
+				}
+				
+				//document.forms[0].layers.value += pt.mb_mapObj[ind].wms[i].objLayer[ii].layer_title; //pt.mb_mapObj[ind].layers[i]	;
+				
+				document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;   
+				document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
+				
+				//---------- legendurl ----------
+				tmp_name = "";
+				for(var j=0; j<layer.length; j++){
+				 if(layerparent[j] == 0){
+					if(j>0){
+						document.forms[0].layers.value += ",";
+					}
+	
+					var l = pt.mb_getchildsbyname(ind,i,layer[j]);
+	
+				 	if (l) {
+				 		document.forms[0].layers.value += title[j];
+	
+				 		if(j>0){
+							document.forms[0].legendurl.value += ",";
+						}
+						for (var k=0; k<l["name"].length; k++){
+					 		if (tmp_name != l["title"][k]) {
+					 		    document.forms[0].layers.value += "*"
+					 			if(k>0){
+					 				 document.forms[0].legendurl.value += "*";
+					 			}else{
+					 				 document.forms[0].legendurl.value += '1*';
+					 			}
+	
+								if (l["legendurl"][k] != '' || !l["legendurl"][k]==true){
+									document.forms[0].layers.value += l["name"][k];
+					  				document.forms[0].legendurl.value += l["legendurl"][k];
+								}else{
+									document.forms[0].layers.value += '0';
+									document.forms[0].legendurl.value += '0';
+								}
+								tmp_name = l["title"][k];
+					 		}	// if
+						 } // for var k=0
+	
+					} // if (l) 
+					else{
+						//prompt (!temp_legendurl[j] ,temp_legendurl[j] + !temp_legendurl[j]);
+	
+							document.forms[0].layers.value += title[j];
+							if(j>0){
+								document.forms[0].legendurl.value += ",";
+							}
+							if (temp_legendurl[j]!= '' || !temp_legendurl[j] == 'true'){
+								document.forms[0].legendurl.value += temp_legendurl[j];
+							}else{
+								document.forms[0].legendurl.value +='0';
+							}
+						
+					}// else (l) 
+				   }//check parent==0
+				}//for var j=0
+				
+				//-------------------
+	
+				//document.forms[0].legendurl.value += layers[3];
+		
+			} else{
+				 if(i>0 && document.forms[0].wms_id.value!=''){
+			    document.forms[0].layers.value += "___";
+			    document.forms[0].wms_id.value += "___";
+			    document.forms[0].wms_title.value += "___";
+			    document.forms[0].legendurl.value += "___";
+				}
+				
+				document.forms[0].layers.value += "0";
+			    document.forms[0].wms_id.value += "0";
+			    document.forms[0].wms_title.value += "0";
+			    document.forms[0].legendurl.value += "0";
+			}
+		}//if
+	}//for
+}
+
+function validate(){
+	size = document.form1.size.options[document.form1.size.selectedIndex].value;
+	format = document.form1.format.options[document.form1.format.selectedIndex].value;
+	if(size != "" && format != ""){
+		var ind = pt.getMapObjIndexByName(target);
+		var coord = pt.mb_mapObj[ind].extent.split(",");
+		var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
+		var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
+		if(size == "A4" && format == "portrait"){
+			map_width = <?php echo $a4p_map_width; ?>; 
+			map_height = <?php echo $a4p_map_height; ?>; 
+		}
+		if(size == "A4" && format == "landscape"){
+			map_width = <?php echo $a4l_map_width; ?>;
+			map_height = <?php echo $a4l_map_height; ?>; 
+		}
+		if(size == "A3" && format == "portrait"){
+			map_width = <?php echo $a3p_map_width; ?>;
+			map_height = <?php echo $a3p_map_height; ?>;
+		}
+		if(size == "A3" && format == "landscape"){
+			map_width = <?php echo $a3l_map_width; ?>;
+			map_height = <?php echo $a3l_map_height; ?>;
+		}  
+		if(size == "A2" && format == "portrait"){
+			map_width = <?php echo $a2p_map_width; ?>;
+			map_height = <?php echo $a2p_map_height; ?>;
+		}
+		if(size == "A2" && format == "landscape"){
+			map_width = <?php echo $a2l_map_width; ?>;
+			map_height = <?php echo $a2l_map_height; ?>;
+		}
+		if(size == "A1" && format == "portrait"){
+			map_width = <?php echo $a1p_map_width; ?>;
+			map_height = <?php echo $a1p_map_height; ?>;
+		}
+		if(size == "A1" && format == "landscape"){
+			map_width = <?php echo $a1l_map_width; ?>;
+			map_height = <?php echo $a1l_map_height; ?>;
+		}
+		if(size == "A0" && format == "portrait"){
+			map_width = <?php echo $a0p_map_width; ?>;
+			map_height = <?php echo $a0p_map_height; ?>;
+		}
+		if(size == "A0" && format == "landscape"){
+			map_width = <?php echo $a0l_map_width; ?>;
+			map_height = <?php echo $a0l_map_height; ?>;
+		}     
+		var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
+		pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+
+		pt.mb_mapObj[ind].width = Math.round(map_width);
+		pt.mb_mapObj[ind].height = Math.round(map_height);
+		pt.document.getElementById(target).style.width = Math.round(map_width);
+		pt.document.getElementById(target).style.height = Math.round(map_height);
+		pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
+		pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
+
+		//pt.setMapRequest(target);		
+		pt.mb_repaintScale(target, null, null, pt.mb_getScale(target));
+      	document.form1.map_url.value = '';
+		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+			if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+				if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
+					if(document.form1.map_url.value != ""){
+						document.form1.map_url.value += "___";
+					}         
+					document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+				}
+			}
+		}
+		
+		//overview_url
+		var ind_overview = pt.getMapObjIndexByName('overview');
+
+		//alert ("länge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
+		if(pt.mb_mapObj[ind_overview].mapURL != false ){
+			document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
+		}
+	}
+}
+function refreshParams(){
+	var ind = pt.getMapObjIndexByName(target);
+	var f = document.form1;
+	f.map_url.value = "";
+	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+			if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
+				if(f.map_url.value != ""){
+					f.map_url.value += "___";
+				}      
+				f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+			}
+		}
+	}
+	f.map_scale.value = pt.mb_getScale(target);
+	f.epsg.value = pt.mb_mapObj[ind].epsg;
+	mod_legend_print();
+}
+function printMap(){
+	if(size != "" && (format == "portrait" || format == "landscape")){
+		refreshParams();
+		if(document.form1.c1.value != comment){
+			document.form1.comment1.value = document.form1.c1.value;
+		}
+		if(document.form1.c2.value != comment){
+			document.form1.comment2.value = document.form1.c2.value;
+		}
+		if(document.form1.mylegendcheckbox.checked == 0){
+			document.form1.mylegend.value = 'false';
+		}else{
+			document.form1.mylegend.value = 'true';
+		}
+		
+		// write the measured coordinates
+		
+		if (pt.mod_measure_RX != undefined && pt.mod_measure_RY != undefined) {
+			var tmp_x = '';
+			var tmp_y = '';
+			for(i = 0; i<pt.mod_measure_RX.length; i++) {
+				if(tmp_x != '') {
+					tmp_x += ','
+				}
+				tmp_x += pt.mod_measure_RX[i];
+			}
+			for(i = 0; i<pt.mod_measure_RY.length; i++) {
+				if(tmp_y != '') {
+					tmp_y += ','
+				}
+				tmp_y += pt.mod_measure_RY[i];
+			}
+			document.forms['form1'].elements['measured_x_values'].value = tmp_x;
+			document.forms['form1'].elements['measured_y_values'].value = tmp_y;
+		}
+		
+		document.form1.submit();
+	}
+	else{
+		alert("Das Format ist noch nicht ausgewählt.");
+	}
+}
+function valCom(obj){
+	if(obj.value.length > comment_length){
+		obj.value = obj.value.substr(0,comment_length);
+	}
+}
+// -->
+</script>
+<body>
+<form name='form1' method='POST' action='../print/mod_printPDF_pdf.php?<?php echo SID; ?>' target="_blank">
+<table border='0'>
+<tr>
+	<td>
+	<select name='size' onchange='validate()'>
+<?php
+	if($a4 == true && $a3 == true){
+		echo "<option value=''>".$label_format."</option>";
+	}
+	if($a4 == true){
+		echo "<option value='A4'>".$label_format_a4."</option>";
+	}
+	if($a3 == true){
+		echo "<option value='A3'>".$label_format_a3."</option>";
+	}
+	if($a2 == true){
+		echo "<option value='A2'>".$label_format_a2."</option>";
+	}
+	if($a1 == true){
+		echo "<option value='A1'>".$label_format_a1."</option>";
+	}
+	if($a1 == true){
+		echo "<option value='A0'>".$label_format_a0."</option>";
+	}
+?>
+	</select>
+	</td>   
+</tr>
+<tr>
+	<td>
+	<select name='format' onchange='validate()'>
+	<option value=''><?php echo $label_orientation; ?></option>
+	<option value='portrait'><?php echo $label_portrait; ?></option>
+	<option value='landscape'><?php echo $label_landscape; ?></option>
+	</select>
+	</td>
+</tr>
+<?php
+if($highquality == true){
+	echo "<tr>";
+		echo "<td>";
+		echo "<select name='quality'>";
+		echo "<option value='1'>".$label_72dpi."</option>";
+		echo "<option value='2'>".$label_288dpi."</option>";
+		echo "</select>";
+		echo "</td>";
+	echo "</tr>";
+}
+?>
+<tr>
+	<td>
+		<input type='text' name='c1' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
+	</td>
+</tr>
+<tr>
+	<td>
+		<input type='text' name='c2' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
+	</td>
+</tr>
+<?php
+if($legend == true){
+	echo "<tr>";
+		echo "<td>";
+		echo "<div><input type='checkbox' class='mycheck' name='mylegendcheckbox' value='false'>".$label_legend."</div>";
+		echo "</td>";
+	echo "</tr>";
+}
+?>
+<table>  
+<input type='hidden' name='map_url' value=''>
+<input type='hidden' name='overview_url' value=''>
+<input type='hidden' name='wms_title' value=''>
+<input type='hidden' name='wms_id' value=''>
+<input type='hidden' name='layers' value=''>
+<input type='hidden' name='legendurl' value=''>
+<input type='hidden' name='map_scale' value=''>
+<input type='hidden' name='epsg' value=''>
+<input type='button' name='print' value="<?php echo $label_button; ?>" onclick='printMap()'>
+<input type='hidden' name='conf' value='<?php echo $_REQUEST["conf"]; ?>'>
+<input type='hidden' name='comment1' value=''>
+<input type='hidden' name='comment2' value=''>
+<input type='hidden' name='mylegend' value='true'>
+<input type='hidden' name='measured_x_values' value=''>
+<input type='hidden' name='measured_y_values' value=''>
+
+</form>
+</body>
+</html>



More information about the Mapbender_commits mailing list