Ver Mensaje Individual
  #7 (permalink)  
Antiguo 27/03/2008, 09:17
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: PHP y JAVASCRIPT

Puedes probar algo así:
Código PHP:
<script type="text/javascript">
    //<![CDATA[
function load() {
        if (GBrowserIsCompatible()) {
                var map = new GMap2(document.getElementById("map"));
                map.setCenter(new GLatLng(11111,22222),11);

                var opciones_poligono = {geodesic:true};
                var puntos = [];
                <?php
                      
foreach( $points as $point ) {
                              echo 
"puntos.push( new GLatLng($point[0], $point[1]) );\n";
                      }
                
?>

                var polyline = new GPolyline(puntos);
                map.addOverlay(polyline);
        }
}

window.onload=load
    //]]>
    </script>
Tu variable $puntos tiene que ser un arreglo donde cada elemento sea un arreglo de dos elementos para x y y:
Código PHP:
$puntos = array();
$puntos[0] = array( val_xval_y ); 
Saludos.