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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed May 30 11:54:09 EDT 2007


Author: astrid_emde
Date: 2007-05-30 11:54:09 -0400 (Wed, 30 May 2007)
New Revision: 1395

Modified:
   trunk/mapbender/http/print/mod_printPDF_pdf.php
Log:
generate temporary image only when measure is available and used

Modified: trunk/mapbender/http/print/mod_printPDF_pdf.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF_pdf.php	2007-05-30 14:36:29 UTC (rev 1394)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php	2007-05-30 15:54:09 UTC (rev 1395)
@@ -289,7 +289,36 @@
 	unlink($filename);
 }
 
+/** ******************************************************************
+* user drawn elements
+*/
 
+$theMeasureConfigArray = array(
+   "do_fill" => FALSE,
+     "fill_color" => array(
+     "r" => 128 / 255,
+     "g" => 128 / 255,
+     "b" => 128 / 255
+   ),
+   "do_stroke" => TRUE,
+     "stroke_color" => array(
+     "r" => 254 / 255,
+     "g" => 1 / 255,
+     "b" => 1 / 255
+   ),
+   "line_style" => array(
+       "width" => 2,
+       "cap" => 'butt',
+       "join" => 'miter',
+       "dash" => array(10, 6)
+       )
+   );
+
+if ($_POST['measured_x_values']!=''){
+	addMeasuredItem(&$pdf, $_POST['measured_x_values'], $_POST['measured_y_values'], $theMeasureConfigArray);
+	hideElementsOutsideMapframe(&$pdf);
+}
+
 # dashed line
 $pdf->setLineStyle($linewidth_dashed, '','', array(2,2));
 $pdf->line($mapOffset_left - $linewidth_dashed, $mapOffset_bottom - $linewidth_dashed, $mapOffset_left - $linewidth_dashed, $mapOffset_bottom  + $map_height + $linewidth_dashed);
@@ -449,33 +478,8 @@
 
 
 
-/** ******************************************************************
-* user drawn elements
-*/
 
-$theMeasureConfigArray = array(
-   "do_fill" => FALSE,
-     "fill_color" => array(
-     "r" => "0.01",
-     "g" => "0.01",
-     "b" => "0.95"
-   ),
-   "do_stroke" => TRUE,
-     "stroke_color" => array(
-     "r" => 254 / 255,
-     "g" => 1 / 255,
-     "b" => 1 / 255
-   ),
-   "line_style" => array(
-       "width" => 2,
-       "cap" => 'butt',
-       "join" => 'miter',
-       "dash" => array(10, 6)
-       )
-   );
 
-addMeasuredItem(&$pdf, $_POST['measured_x_values'], $_POST['measured_y_values'], $theMeasureConfigArray);
-hideElementsOutsideMapframe(&$pdf);
 
 if ($overview==true){
 	// analyse request, draw rectancle
@@ -635,7 +639,7 @@
 	$pdf->ezText("<b><u>".$legendText."</u></b>", 13);
 
 	
-	//Seitenr�nder (top, bottom, left, right)
+	//Seitenraender (top, bottom, left, right)
 	if($size == "A4" && $format == "portrait"){
 	  $pdf->ezSetMargins(70,35,80,30);
 	} else {
@@ -764,16 +768,20 @@
    if($_POST['measured_x_values'] != ""
       && $_POST['measured_y_values'] != ""
         && is_file($legendFilenameUserPolygon)) {
-     // lade Bild:
-       $myY = $pdf->ezText("<b>Eingezeichnetes Element</b>", 11);
+     // load image
+       $myY = $pdf->ezText("<b>temporary Object</b>", 11);
        $pdf->ezSetDy(-15);
-       $pdf->ezImage($legendFilenameUserPolygon, 5, 15, 'none', 'left');
+       $pdf->ezImage($legendFilenameUserPolygon, 5, 17, 'none', 'left');
        if($unlink == true){
        		unlink($legendFilenameUserPolygon);
        }
        $pdf->ezSetY($myY - 7);
-       $pdf->ezText("Element", 11, array("left" => 25));
-             // lösche Bild:
+       
+        $pdf->ezText("Element", 11, array("left" => 25));
+             // deletes image
+	    
+	    $pdf->ezSetDy(-15);             
+                    
    } 
 	
 $pdf->ezText($legendFooter, 11);



More information about the Mapbender_commits mailing list