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

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Oct 17 23:31:31 PDT 2013


Author: jng
Date: 2013-10-17 23:31:31 -0700 (Thu, 17 Oct 2013)
New Revision: 2798

Modified:
   trunk/widgets/QuickPlot/PlotAsPDF.php
Log:
#584: Fix legend output for non-96 DPI plots. Due to http://trac.osgeo.org/mapguide/ticket/71, the legend element will always have to be at 96 DPI for the moment and thus our offsets and legend image requests should always be based around this assumption.

Modified: trunk/widgets/QuickPlot/PlotAsPDF.php
===================================================================
--- trunk/widgets/QuickPlot/PlotAsPDF.php	2013-10-18 05:41:37 UTC (rev 2797)
+++ trunk/widgets/QuickPlot/PlotAsPDF.php	2013-10-18 06:31:31 UTC (rev 2798)
@@ -31,6 +31,7 @@
     } else {
         $legendPathString = $pathString;
     }
+    $legendDpi = 96; //Legend is fixed at 96 dpi because (http://trac.osgeo.org/mapguide/ticket/71)
     $legendWidth = 0; //Width of legend in inches
 
     // POST params
@@ -98,7 +99,7 @@
     }
     
     if ($showLegend) {
-        $legendWidth = PxToIn(250, $printDpi);
+        $legendWidth = PxToIn(250, $legendDpi);
     }
     
     // Create new PDF document, the default "PDF_UNIT" value is "mm"
@@ -164,7 +165,7 @@
     // Construct the querystring which can be used to generate the legend
     if ($showLegend) {
         if (strcmp($legendType, "original") == 0) {
-            $legend_query_string = "OPERATION=GETMAPLEGENDIMAGE&VERSION=1.0.0&FORMAT=PNG&SESSION=".$_POST["sessionId"]."&MAPNAME=".$_POST["mapName"]."&WIDTH=".InToPx($legendWidth, $printDpi)."&HEIGHT=".InToPx($printSize->height, $printDpi);
+            $legend_query_string = "OPERATION=GETMAPLEGENDIMAGE&VERSION=1.0.0&FORMAT=PNG&SESSION=".$_POST["sessionId"]."&MAPNAME=".$_POST["mapName"]."&WIDTH=".InToPx($legendWidth, $legendDpi)."&HEIGHT=".InToPx($printSize->height, $legendDpi);
         } else {
             $legend_query_string = "session_id=".$_POST['sessionId']."&map_name=".$_POST['mapName']."&width=".InToPx($legendWidth, $printDpi)."&height=".InToPx($printSize->height, $printDpi);
         }



More information about the fusion-commits mailing list