Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/04/2011, 07:44
Avatar de anacona16
anacona16
 
Fecha de Ingreso: marzo-2010
Ubicación: Bogota DC
Mensajes: 610
Antigüedad: 14 años, 1 mes
Puntos: 52
Respuesta: ¿Cómo guardar una ubicación de Google Maps?

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4.     <title>test</title>
  5.     <style>
  6.     *{ margin: 0; padding: 0; }
  7.     html, body, #map{
  8.         width: 100%;
  9.         height: 100%;
  10.     }
  11.     </style>
  12.     <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&amp;language=es"></script>
  13.     <script type="text/javascript">
  14.     window.onload = function(){
  15.         var options = {
  16.             zoom: 9
  17.             , center: new google.maps.LatLng(18.2, -66.5)
  18.             , mapTypeId: google.maps.MapTypeId.ROADMAP
  19.         };
  20.     *
  21.         var map = new google.maps.Map(document.getElementById('map'), options);
  22.  
  23.         google.maps.event.addListener(map, 'click', function(e){
  24.             alert(e.latLng);
  25. document.getElementById('datos').value = e.latLng;
  26.         });
  27.     };
  28.     </script>
  29. </head>
  30.     <div id="map"></div>
  31. <input name="map" type="text" id="datos" />
  32. </body>
  33. </html>

Como te dice abimaelrc es la forma correcta solo debes agregar el input y el evento que agrega la informacion, pruba con el codigo que he completado, el parte de abajo despues del mapa esta el input con las coordenadas.
__________________
Aprendiendo!!!