[fusion-commits] r2768 - trunk/widgets/QuickPlot

svn_fusion at osgeo.org svn_fusion at osgeo.org
Fri Aug 23 05:26:00 PDT 2013


Author: jng
Date: 2013-08-23 05:25:59 -0700 (Fri, 23 Aug 2013)
New Revision: 2768

Modified:
   trunk/widgets/QuickPlot/MapCapturer.js
   trunk/widgets/QuickPlot/PlotAsPDF.php
Log:
#592: Don't request a cropped down image if the legend is specified. Instead request image at its original size and simply draw the legend on top of the map image. This allows fidelity to be retained with respect to the original box/normalized_box and does not result in corners with nothing as a result of rotation.

Modified: trunk/widgets/QuickPlot/MapCapturer.js
===================================================================
--- trunk/widgets/QuickPlot/MapCapturer.js	2013-08-23 08:32:53 UTC (rev 2767)
+++ trunk/widgets/QuickPlot/MapCapturer.js	2013-08-23 12:25:59 UTC (rev 2768)
@@ -651,6 +651,9 @@
         
         var factor = this.scaleDenominator / (this.wMap.getMetersPerUnit() * 1000 * 2);
         
+        //TODO: If legend is enabled, should draw another box on the LHS of the box to indicate the region that would be cropped
+        //out by the legend
+        
         var pointList = [];
         pointList.push(new OpenLayers.Geometry.Point(origin.x - this.paperSize.w * factor, origin.y - this.paperSize.h * factor));
         pointList.push(new OpenLayers.Geometry.Point(origin.x + this.paperSize.w * factor, origin.y - this.paperSize.h * factor));

Modified: trunk/widgets/QuickPlot/PlotAsPDF.php
===================================================================
--- trunk/widgets/QuickPlot/PlotAsPDF.php	2013-08-23 08:32:53 UTC (rev 2767)
+++ trunk/widgets/QuickPlot/PlotAsPDF.php	2013-08-23 12:25:59 UTC (rev 2768)
@@ -158,7 +158,7 @@
     
     // Shave off width if we have a legend
     if ($showLegend) {
-        $printSize->width = $printSize->width - $legendWidth;
+        //$printSize->width = $printSize->width - $legendWidth;
     }
     
     // Construct the querysting which can be used to generate the Map image
@@ -196,14 +196,14 @@
     //var_dump($legendfilelocation);
     //die;
     
+    // Draw Map
+    $pdf->Image($filelocation, ($margin[2]), $margin[0], $printSize->width, $printSize->height, "PNG", "", "", false, $printDpi, "", false, false, 1, false, false, false);
+    
     // Draw legend if specified
     if ($showLegend) {
         $pdf->Image($legendfilelocation, $margin[2], $margin[0], $legendWidth, $printSize->height, "PNG", "", "", false, $printDpi, "", false, false, 1, false, false, false);
     }
     
-    // Draw Map first, so if the margin is not enough for the Text, the Text will be displayed about the image
-    $pdf->Image($filelocation, ($margin[2] + $legendWidth), $margin[0], $printSize->width, $printSize->height, "PNG", "", "", false, $printDpi, "", false, false, 1, false, false, false);
-    
     // Draw coordiates if specified
     $mExt = NULL;
     if ($showCoordinates) {
@@ -461,7 +461,7 @@
             $pdf->SetXY($lefttop[0] + $legendWidth, $lefttop[1], false);
             $pdf->Cell($lt_cellwidth, 0, $lefttop_cs, 1, 0, '', true, '', 0, false, 'T', 'M');
 
-            $pdf->SetXY($rightbuttom[0] + $legendWidth, $rightbuttom[1], false);
+            $pdf->SetXY($rightbuttom[0], $rightbuttom[1], false);
             $pdf->Cell($rb_cellwidth, 0, $rightbuttom_cs, 1, 0, '', true, '', 0, false, 'T', 'M');
         }
     }



More information about the fusion-commits mailing list