Ir al contenido


Foto

PHP MYSQL GEOLOCALIZACION DINAMICA


  • Por favor identifícate para responder
1 respuesta en este tema

#1 animo123

animo123

    Newbie

  • Miembros
  • Pip
  • 2 mensajes

Escrito 22 noviembre 2013 - 01:54

Hola este es mi codigo pero solo hace un marcador en en el mapa
<?php
include("conex.php");
conectar();

?>

<?php
$resultado_query=mysql_query("select * from tplace");
$campos=mysql_fetch_array($resultado_query);
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Marker Animations</title>
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googlea...true"></script>
    <script>
// The following example creates a marker in Stockholm, Sweden
// using a DROP animation. Clicking on the marker will toggle
// the animation between a BOUNCE animation and no animation.

var stockholm = new google.maps.LatLng(<?php echo $campos["latitud"]; ?>,<?php echo $campos["longitud"]; ?>);
var parliament = new google.maps.LatLng(<?php echo $campos["latitud"]; ?>,<?php echo $campos["longitud"]; ?>);
var marker;
var map;

function initialize() {
  var mapOptions = {
    zoom: 13,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    center: stockholm
  };

  map = new google.maps.Map(document.getElementById('map-canvas'),
          mapOptions);
//declaracion del marcador
  marker = new google.maps.Marker({
    icon:'ima/AQUI2.png',
//referencia al mapa y luego de = 
    map:map,
//movimiento del icono verdadero o falso
//  draggable:false,
    animation: google.maps.Animation.DROP,
    position: parliament,
  });
  google.maps.event.addListener(marker, 'click', toggleBounce);
}

function toggleBounce() {

  if (marker.getAnimation() != null) {
    marker.setAnimation(null);
  } else {
    marker.setAnimation(google.maps.Animation.BOUNCE);
  }
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
  <table width="26%" height="680" border="1" align="right">
  <tr>
    <td><p align="center"><img src="ima/COTA.png" alt="COTA" width="287" height="272" longdesc="ima/COTA.png"></p>
    <form id="form1" name="form1" method="post" action="">
      <label>
        <div align="center">
          <input type="submit" name="hola" id="hola" value="Enviar" />
        </div>
      </label>
    </form>
    <p>&nbsp;</p>    </td>
  </tr>
</table>
  <div id="map-canvas"></div>
  </body>
</html>

  • 0

#2 animo123

animo123

    Newbie

  • Miembros
  • Pip
  • 2 mensajes

Escrito 22 noviembre 2013 - 01:58

Lo que quiero es que me marque todos los puntos que tengo en la base de datos pero al escribir un while no corre se daña ayuda por fa el anterior solo corre con un solo punto en el mapa y son muchos los que tengo en la base de datos
  • 0




IP.Board spam blocked by CleanTalk.