[Mapbender-commits] r4053 - branches/google_dev/http/print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jun 19 10:52:11 EDT 2009


Author: christoph
Date: 2009-06-19 10:52:11 -0400 (Fri, 19 Jun 2009)
New Revision: 4053

Modified:
   branches/google_dev/http/print/mod_printPDF.php
   branches/google_dev/http/print/mod_printPDF_pdf.php
Log:


Modified: branches/google_dev/http/print/mod_printPDF.php
===================================================================
--- branches/google_dev/http/print/mod_printPDF.php	2009-06-19 14:50:45 UTC (rev 4052)
+++ branches/google_dev/http/print/mod_printPDF.php	2009-06-19 14:52:11 UTC (rev 4053)
@@ -185,7 +185,7 @@
 			}
 			var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
 			var prevscale= pt.mb_getScale(target);
-			pt.mb_mapObj[ind].extent = new Extent(
+			pt.mb_mapObj[ind].extent = new pt.Extent(
 				parseFloat(coord[0]), 
 				parseFloat(pos[1]), 
 				parseFloat(pos[0]), 
@@ -311,6 +311,21 @@
 				document.forms['form1'].elements['measured_y_values'].value = tmp_y;
 			}
 
+			// google maps
+			try {
+				var map = pt.getMapObjByName(target);
+				if (typeof map.google !== "undefined") {
+					document.forms['form1'].elements['google_zoom'].value = map.google.map.get_zoom();
+					document.forms['form1'].elements['google_type'].value = map.google.map.get_mapTypeId();
+					document.forms['form1'].elements['google_key'].value = map.google.key;
+					document.forms['form1'].elements['google_center_lat'].value = map.google.map.get_center().lat();
+					document.forms['form1'].elements['google_center_lng'].value = map.google.map.get_center().lng();
+				}
+			}
+			catch (e) {
+				
+			}
+
 			document.form1.submit();
 		}
 		else{
@@ -400,6 +415,11 @@
 <input type="hidden" name="mylegend" value="true" >
 <input type="hidden" name="measured_x_values" />
 <input type="hidden" name="measured_y_values" />
+<input type="hidden" name="google_center_lat" />
+<input type="hidden" name="google_center_lng" />
+<input type="hidden" name="google_zoom" />
+<input type="hidden" name="google_key" />
+<input type="hidden" name="google_type" />
 
 <p>
 	<input type="button" id="print" name="print" value="<?php echo $label_button; ?>" onclick="printMap();" />

Modified: branches/google_dev/http/print/mod_printPDF_pdf.php
===================================================================
--- branches/google_dev/http/print/mod_printPDF_pdf.php	2009-06-19 14:50:45 UTC (rev 4052)
+++ branches/google_dev/http/print/mod_printPDF_pdf.php	2009-06-19 14:52:11 UTC (rev 4053)
@@ -319,6 +319,25 @@
 	$header_width = $a4l_header_width;
 }
 session_write_close();
+
+if ($_REQUEST["google_key"] && $_REQUEST["google_center_lat"] && $_REQUEST["google_center_lng"] &&
+	$_REQUEST["google_zoom"] && $_REQUEST["google_type"]) {
+	$google_map_width = $map_width;
+	$google_map_height = $map_height;
+	if ($factor > 1) {
+		$google_map_width *= 4;
+		$google_map_height *= 4;
+	}
+	$googleUrl = "http://maps.google.com/staticmap?center=" . 
+		$_REQUEST["google_center_lat"] . "," . 
+		$_REQUEST["google_center_lng"] . "&" . 
+		"zoom=" . $_REQUEST["google_zoom"] . "&" . 
+		"size=" . $google_map_width . "x" . $google_map_height . "&" . 
+		"maptype=" . $_REQUEST["google_type"] . "&" . 
+		"key=" . $_REQUEST["google_key"];
+//	array_splice($array_urls, 0, 0, $googleUrl);
+	$array_urls[]= $googleUrl;
+}
 $i = new weldMaps2PNG(implode("___",$array_urls),$filename);
 
 $pdf->addPngFromFile($filename, $mapOffset_left, $mapOffset_bottom, $map_width, $map_height);



More information about the Mapbender_commits mailing list