dante20007
Messages postés61Date d'inscriptionmercredi 25 avril 2007StatutMembreDernière intervention27 avril 2009
-
22 mars 2008 à 18:34
cs_math11
Messages postés47Date d'inscriptionmardi 9 août 2005StatutMembreDernière intervention31 mai 2012
-
3 mai 2010 à 10:41
bonjour , je veux mettre une image dans chaque info bulle sous google map.
le nom de mon image est dans un champ de ma base de donnée,et je le recupere pour google map par un fichier xml, mais je n'arrive pas à l'afficher,en fait ca affiche son nom:
EX:
GDownloadUrl("phpsqlajax_genxml.php", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var type = markers[i].getAttribute("type");
var image = markers[i].getAttribute("image");
var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var marker = createMarker(point, name, address, type, image);
map.addOverlay(marker);
}
});
}
}
function createMarker(point, name, address, type, image) {
var marker = new GMarker(point, customIcons[type]);
var html = " " + name + "
" + address + "
" + type + "
" +image;
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html);
});
return marker;
// Opens a connection to a mySQL server
$connection=mysql_connect (localhost, $username, $password);
if (!$connection) {
die('Not connected : ' . mysql_error());
}
// Set the active mySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
$node = $doc->create_element("marker");
$newnode = $parnode->append_child($node);