Foros del Web » Programando para Internet » PHP »

imprimir ruta de google maps

Estas en el tema de imprimir ruta de google maps en el foro de PHP en Foros del Web. Buenas! Estoy realizando mi trabajo de tesis. El sistema que estoy realizando utiliza al api de google maps para marcar las rutas de un recorrido. ...
  #1 (permalink)  
Antiguo 07/04/2011, 09:07
 
Fecha de Ingreso: abril-2011
Mensajes: 14
Antigüedad: 13 años
Puntos: 2
Pregunta imprimir ruta de google maps

Buenas! Estoy realizando mi trabajo de tesis. El sistema que estoy realizando utiliza al api de google maps para marcar las rutas de un recorrido. Y asi poder calcular el combustible a utilizar.
Calculo todo sin problema.
Lo que no estoy sabiendo es como puedo imprimir el mapa que se calculó si se realizó un cambio en forma manual en el mapa.
Sería como el link “imprimir” que se encuentra en la cabecera del mapa en http://maps.google.es/ lo que estoy necesitando.
O si pudiera guardar de alguna forma en mi mysql
Este seria mi código

<?php

$location = "{location: '(-25.285176773048878, -57.621145924072266)'},{location: '(-25.2847499309663, -57.587972362976075)'} ";
?>
<html>
<head>
<title>google mapss</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="images/titulo.png"/>
<script src="js/jquery-1.3.1.min.js" type="text/javascript"></script>
<script src="js/jquery.functions.js" type="text/javascript"></script>

<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=es"></script>
<script type="text/javascript">

var rendererOptions = {
draggable: true
};
var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);;
var directionsService = new google.maps.DirectionsService();
var map;


var asuncion = new google.maps.LatLng<?php include"posicion_empresa.txt"; ?>;

function initialize() {

var myOptions = {
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: asuncion
};
map = new google.maps.Map(document.getElementById("map_canva s"), myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById ("directionsPanel"));

google.maps.event.addListener(directionsDisplay, 'directions_changed', function() {
computeTotalDistance(directionsDisplay.directions) ;
});



calcRoute();
//flightPath.setMap(map);
}

function calcRoute() {

var request = {
origin: "(-25.26445379695485, -57.552996357421875)",
destination: "(-25.26445379695485, -57.552996357421875)",
waypoints:[<?php echo $location; ?>],
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
}

function computeTotalDistance(result) {
var total = 0;
var myroute = result.routes[0];
for (i = 0; i < myroute.legs.length; i++)
{
total += myroute.legs[i].distance.value;
}
total = total / 1000.
//document.getElementById("total").innerHTML = total + " km";
//document.getElementById('km').value = total;

}

function cerrarVentana(){
var ventana = window.self;
ventana.opener = window.self;
ventana.close();
}
</script>


</head>
<body onLoad="initialize()">



<div id="map_canvas" style="float:right;width:70%; height:100%"></div>
<div id="directionsPanel" style="float:left;width:30%;height:100%;overflow:a uto">

<p> <span id="total"></span></p>
</div>
</div>



</body>
</html>
  #2 (permalink)  
Antiguo 07/04/2011, 09:30
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Tema movido desde PHP a Javascript
  #3 (permalink)  
Antiguo 07/04/2011, 11:06
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 11 meses
Puntos: 1517
Respuesta: imprimir ruta de google maps

Usa http://code.google.com/apis/maps/doc...on/staticmaps/ para eso
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos

Etiquetas: google, maps
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:57.