Foros del Web » Programando para Internet » PHP »

google maps con php

Estas en el tema de google maps con php en el foro de PHP en Foros del Web. Hooa, estoy intetando implementar el google maps en mi web, pero estoy teniendo problemas al intentar poner una xinxeta en el sitio k kiero. este ...
  #1 (permalink)  
Antiguo 25/05/2008, 12:22
 
Fecha de Ingreso: marzo-2007
Mensajes: 274
Antigüedad: 17 años, 1 mes
Puntos: 2
google maps con php

Hooa, estoy intetando implementar el google maps en mi web, pero estoy teniendo problemas al intentar poner una xinxeta en el sitio k kiero.

este es el codigo que uso

Cita:
<script type="text/javascript">
//<![CDATA[

var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(51.512161, -0.14110), 11, G_NORMAL_MAP);

// Creates a marker whose info window displays the given number
function createMarker(point, number)
{
var marker = new GMarker(point);
// Show this markers index in the info window when it is clicked
var html = number;
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
return marker;
};

<?php

$link = mysql_connect("localhost", "fx", "x") or die("Could not connect: " . mysql_error());
mysql_select_db("x",$link) or die ("Can\'t use dbmapserver : " . mysql_error());

$result = mysql_query("SELECT * FROM wholocations",$link);

while($row = mysql_fetch_array($result))
{
echo "var point = new GLatLng(" . $row['lat'] . "," . $row['lon'] . ");\n";
echo"var marker = new GMarker(new GPoint(49.138597,-1.318359));";
//echo "var marker = createMarker(point, '" . addslashes($row['description']) . "');\n";
echo "map.addOverlay(marker);map.centerAndZoom(new GPoint(49.138597,-1.318359), 11);";
echo "\n";
}

mysql_close($link);
?>

//]]>
</script>
Alguna idea del error?
__________________
gifts4kids.es
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 09:29.