Bonjour,

Je ne suis pas sur d'être au bon endroit ...
Je vous explique mon problème, je dois afficher plusieurs markers sur un map de google map avec des coordonnées provenant d'une bdd mysql.

Dans mon code seul le dernier point s'affiche :

Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='fr'>
	<head>
		<link rel='stylesheet' type='text/css' href='/Styles/Cartes.css'>
		<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
		<script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true'></script>
		<script type='text/javascript' src='carte.js'></script>
	</head>
	<body>
	<h1>Logicar</h1>
	<?php include('connexionBdd.php');
        // Afficher nom du lieu, latitude et longitude
        $req1 = $bdd->prepare("SELECT nom_lieu, latitude_gps, longitude_gps FROM carte ;");
        $req1->execute();
        while ($donnees = $req1->fetch()) {
            $afficheReq1 = array(
                ' ' . $donnees['nom_lieu'] . ' ' . $donnees['latitude_gps'] . ' ' . $donnees['longitude_gps'] . '');
            foreach ($afficheReq1 as $element) {
			$nom_lieu = $donnees['nom_lieu'] ;
			$lat = $donnees['latitude_gps'] ;
			$longi = $donnees['longitude_gps'] ;
 
            } 
        }
		?>
		<script>
			window.onload = function() {
				InitTab(8);
				var maCarte = new Carte(10, 48, 2, 'ROADMAP');
				maCarte.addMarker('<b>marqueur 1/1</b>', '<?php echo $nom_lieu ; ?>', 'http://labs.google.com/ridefinder/images/mm_20_green.png', <?php echo $lat ; ?>, <?php echo $longi ?>, 1, 1, true);
				}
		</script>
 
 
		<div id='map' class='map' style='width:80%; height:75%' >
		</div>