Ver Mensaje Individual
  #11 (permalink)  
Antiguo 12/05/2013, 05:30
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 8 meses
Puntos: 10
Respuesta: Refrescar la pantalla cada cierto tiempo automaticamente.

Continuación:
Código Javascript:
Ver original
  1. function handleNoGeolocation(errorFlag) {
  2.  
  3.                             if (errorFlag == true) {
  4.  
  5.                               alert("Geolocation service failed.");
  6.  
  7.                               initialLocation = Jaen;
  8.  
  9.                             } else {
  10.  
  11.                               alert("Posición no encontrada.");
  12.  
  13.                               initialLocation = Jaen;
  14.  
  15.                             }
  16.  
  17.                               map.setCenter(initialLocation);
  18.  
  19.                               infowindow.setContent(contentString);
  20.  
  21.                               infowindow.setPosition(initialLocation);
  22.  
  23.                               infowindow.open(map);
  24.  
  25.                           }
  26.  
  27.                                
  28.  
  29.                                
  30.  
  31. var address0 = '<?php echo utf8_encode($row_Recordset1['localidad']); ?><?php echo utf8_encode($row_Recordset1['calle']); ?>';
  32.  
  33.  
  34.  
  35.                 geocoder.geocode( { 'address': address0}, function(results, status) {
  36.  
  37.                     if (status == google.maps.GeocoderStatus.OK)
  38.  
  39.                
  40.                     {
  41.                        
  42.                        
  43. var ContenidoMarcadorAviso0 = '<div class="marcador"><h2><?php echo $row_Recordset1['name'];?></h2><h3><?php echo utf8_encode($row_Recordset1['calle']);?></h3></div><h3><b></b><hr><b>Marca: </b><?php echo $row_Recordset1['marcas']; ?><br /> <b>Modelo: </b><?php echo $row_Recordset1['modelo']; ?><br /> <b>Aparato: </b><?php echo $row_Recordset1['aparatos']; ?></h3>';
  44.  
  45.                         var infoventanaaviso0 = new google.maps.InfoWindow({
  46.  
  47.                             content: ContenidoMarcadorAviso0
  48.  
  49.                         });
  50.  
  51.  
  52.  
  53.                         marcadorAviso0 = new google.maps.Marker({
  54.  
  55.                             position: results[0].geometry.location,
  56.  
  57.                             map: map,
  58.  
  59.                             title:'Aviso'
  60.  
  61.                         });
  62.  
  63.                         google.maps.event.addListener(marcadorAviso0, 'click', function() {
  64.  
  65.                             infoventanaaviso0.open(map,marcadorAviso0);
  66.  
  67.                         });
  68.  
  69.                     }
  70.  
  71.                     else
  72.  
  73.                     {
  74.  
  75.                         alert('Geocode was not successful for the following reason: ' + status);
  76.  
  77.                     }
  78.  
  79.                 });                                  
  80.  
  81.                
  82.  
  83.        
  84.  
  85.             directionsDisplay.setMap(map);
  86.  
  87.             directionsDisplay.setPanel(document.getElementById("directionsPanel"));
  88.  
  89.             }
  90.  
  91.       function calcRoute() {
  92.  
  93.                                                
  94.  
  95.         var start = initialLocation;
  96.  
  97. var end = "<?php echo utf8_encode($row_Recordset1['localidad']); ?><?php echo utf8_encode($row_Recordset1['calle']); ?>";                
  98.  
  99.                                 var request = {
  100.  
  101.                     origin:start,
  102.  
  103.                     destination:end,
  104.  
  105.                     travelMode: google.maps.DirectionsTravelMode.DRIVING
  106.  
  107.                 };
  108.  
  109.                
  110.  
  111.                 directionsService.route(request, function(response, status) {
  112.  
  113.                     if (status == google.maps.DirectionsStatus.OK) {
  114.  
  115.                         directionsDisplay.setDirections(response);
  116.  
  117.                         $('#itinerario').show();
  118.  
  119.                     }
  120.  
  121.                 });      
  122.  
  123.             }
  124.  
  125.     </script>
  126. </head>
  127. <body onload="initialize();">
  128.  
  129. <div data-role="page" data-theme="b" id="gmap-3">            
  130.  
  131.         <div data-role="content" >
  132.  
  133.             <div class="ui-bar-b ui-corner-all ui-shadow" style="padding:1em;">
  134.  
  135.             <div id="map_canvas" style="height:300px;"></div>
  136.  
  137.            
  138.  
  139.             <div>
  140.  
  141.             <a href="#" onclick="calcRoute();" data-role="button">Calcular Ruta</a>
  142.  
  143.                            
  144.  
  145.             </div><br />
  146.  
  147.        
  148.  
  149.             <div id="itinerario" style="display:none">            
  150.  
  151.                 <center>
  152.  
  153.                     ITINERARIO                    <div id="directionsPanel"></div>
  154.  
  155.                 </center>
  156.  
  157.             </div>
  158.  
  159.            
  160.  
  161.             <div id="results" style="padding:1.4em">
  162.  
  163.             </div>
  164.  
  165.         </div>
  166.  
  167.     </div>
  168.  
  169.     <div data-role="footer" data-position="fixed" data-fullscreen="false">
  170.  
  171.         <div data-role="navbar">
  172.  
  173.             <ul>
  174.  
  175.                 <li><a href="#" onclick="window.close();"  data-icon="delete" data-theme="f" data-ajax="false">Cerrar ventana</a></li>                    
  176.  
  177.             </ul>
  178.  
  179.         </div>
  180.  
  181.     </div>        
  182.  
  183.        
  184.  
  185. </div>    
  186.  
  187.  
  188.  
  189. </body>
  190.  
  191. </html>
  192. <?php
  193. mysql_free_result($Recordset1);
  194. ?>