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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 30 05:09:08 EST 2009


Author: verenadiewald
Date: 2009-11-30 05:09:06 -0500 (Mon, 30 Nov 2009)
New Revision: 5049

Modified:
   trunk/mapbender/http/print/mod_printPDF.php
   trunk/mapbender/http/print/mod_printPDF_pdf.php
Log:
http://trac.osgeo.org/mapbender/ticket/565

Modified: trunk/mapbender/http/print/mod_printPDF.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF.php	2009-11-30 10:08:21 UTC (rev 5048)
+++ trunk/mapbender/http/print/mod_printPDF.php	2009-11-30 10:09:06 UTC (rev 5049)
@@ -283,6 +283,23 @@
 		f.map_scale.value = pt.mb_getScale(target);
 		f.epsg.value = pt.mb_mapObj[ind].epsg;
 		
+		// mypermanentImage (permanent highlight from geometry.js)
+		if(map_el.ownerDocument.images['mapSymbol']){
+			var permanentImage_x = map_el.ownerDocument.getElementById('mapSymbol').style.left;
+			var permanentImage_y = map_el.ownerDocument.getElementById('mapSymbol').style.top;
+			var objImage = map_el.ownerDocument.images['mapSymbol'];
+			var permanentHighlightImage = objImage.src;
+			//change img src from absolute path to relative
+			var permanentHighlightImage = "../"+objImage.src.substr(objImage.src.search(/img.+/));
+			var permanentImage_width = objImage.width;
+			var permanentImage_height = objImage.height; 
+			if(permanentImage_x && permanentImage_y){
+				var x_pos = permanentImage_x.slice(0,-2);
+				var y_pos = permanentImage_y.slice(0,-2);
+				document.forms[0].mypermanentImage.value = permanentHighlightImage + '___' +x_pos+'___'+y_pos+'___'+permanentImage_width+'___'+permanentImage_height;
+			}
+		}
+		
 		mod_legend_print();
 	}
 	function printMap(){
@@ -404,6 +421,7 @@
 <input type="hidden" name="legendurl" />
 <input type="hidden" name="map_scale" />
 <input type="hidden" name="epsg" />
+<input type="hidden" name="mypermanentImage" value="" />
 <input type="hidden" name="conf" value="<?php echo $_REQUEST["conf"]; ?>" />
 <input type="hidden" name="comment1" />
 <input type="hidden" name="comment2" />

Modified: trunk/mapbender/http/print/mod_printPDF_pdf.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF_pdf.php	2009-11-30 10:08:21 UTC (rev 5048)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php	2009-11-30 10:09:06 UTC (rev 5049)
@@ -166,6 +166,25 @@
 }
 $coord = mb_split(",",$map_extent);
 
+# mypermanentImage (highlight symbol from geometry.js)
+if ($_REQUEST["mypermanentImage"]){
+	$array_permanentImage = explode("___", $_REQUEST["mypermanentImage"]);
+	
+	if(count($array_permanentImage)>0){
+		$permanentImage = $array_permanentImage[0] ;
+		if($permanentImage=='false'){
+			$permanentImage=''; 
+		}
+		$permanentImage_x = $array_permanentImage[1] ;
+		$permanentImage_y = $array_permanentImage[2] ;
+		$permanentImage_width = $array_permanentImage[3] ;
+		$permanentImage_height = $array_permanentImage[4] ;
+		
+		$pdf->addPngFromFile($permanentImage, $permanentImage_x + $mapOffset_left , $mapOffset_bottom + $map_height -  $permanentImage_y - $permanentImage_height, $permanentImage_width , $permanentImage_height);
+	   
+	}
+}
+
 if($overview === true){
 	// analyse overview url and draw rectangle with position
 	$o_url = new stripRequest($overview_url);



More information about the Mapbender_commits mailing list