Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/05/2008, 05:41
Stranyer
 
Fecha de Ingreso: junio-2006
Mensajes: 45
Antigüedad: 17 años, 10 meses
Puntos: 0
[Google Maps] Imprimir

Bueno, no se si se entendio en el titulo.

Pero estoy haciendo este proyecto, en el cual, se "dibuja" polilineas arriba de google maps.

Hasta ahora todo salio bien, el tema es que ahora quiero imprimir SOLO google maps, con las polilineas.

Lo primero que se me habia ocurrido es hacer pagina sin nada, solo con el google maps, y un paint() dentro.
El tema es que tiene que tener diseño, asique lo que necesitaria es que al oprimir un boton "imprimir" habra un popup con el google maps modificado, y lo imprima automaticamente con el paint().


Alguna idea?, les dejo lo que tengo hasta ahora:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
	<title>Municipio Marcos Paz</title>
	<style type="text/css">
	v\:* {
	  behavior:url(#default#VML);
	}
	.style1 {color: #000000}
	
    </style>
	
	
	
	<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAuVHxGrDlznED8qKoMbWkkBQCUqGkHgUftWaUsFex1_EygNt-0hTyJs1xA-0WGwK-tDESbOculg8apw" type="text/javascript"></script>
	<script type="text/javascript"> 
	//<![CDATA[ 
	function createMarker(point,name,type,html) { 
		var marker = new GMarker(point); 
		marker.name = name;
		marker.type = type;
		marker.html = html;
		return marker; 
	}
	function renderLine(){ 
		map.removeOverlay(startmarker); 
		map.removeOverlay(endmarker); 
		map.removeOverlay(editline);
		if (mypolyline.length){
			editline = new GPolyline(mypolyline,"#0000FF", 2, 1)
			map.addOverlay(editline);
			startmarker=new GMarker(mypolyline[0]); 
			startmarker.type="start"; 
			map.addOverlay(startmarker); 
			endmarker=new GMarker(mypolyline[mypolyline.length-1]); 
			endmarker.type="end"; 
			map.addOverlay(endmarker); 
		}
	} 
	
	function onLoad(){
		if (GBrowserIsCompatible()) { 
			// Display the map, with some controls and set the initial location 
			map = new GMap(document.getElementById("div_map")); 
			map.addControl(new GLargeMapControl()); 
			map.addControl(new GMapTypeControl()); 
			map.setCenter(new GLatLng(-34.78322222222222,-58.83550974150703), 16);
			map.setMapType(G_SATELLITE_MAP)

			mypolyline = [];
			startmarker = false;
			endmarker = false;
			editline = false;
			
			
			
			GEvent.addListener(map, "click", function(overlay, point) { 
				if (point){ 	// background clicked
					mypolyline.push(point); 
					renderLine(); 
				} else if (overlay) {   // marker clicked
					if (overlay.type=="start"){
						mypolyline.shift();
					} else if (overlay.type == "end"){ 
						mypolyline.pop(); 
					} else {	// not a start or end marker
						overlay.openInfoWindowHtml("I am "+overlay.name+"<br/>"+overlay.html);
					}
					renderLine(); 
				} 
			}); 
		} else { 
			alert("El navegador que esta utilizando no es compatible con esta pagina, pruebe con Mozilla Firefox"); 
		} 
	}
	
	//]]>
	</script>

</head>

<center>



	<body onload="onLoad()">
	 <p><span class="style1"></span><img src="RC.png" width="600" height="100" /></p>
		  <div id="div_map" style="width: 800px; height: 800px"></div>
		<div id="message">
		 
		
		</div>
  </body>
</center>
	
	
</html>

Desde ya, muchas gracias.