Bonjour,

j'ai un petit probleme avec google maps

Code : 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
37
38
39
40
41
42
43
44
function initialize()
{

// tableaux des points avec les noms a afficher dans la bulle
var TabPoints = ["38, rue St Dizier 54000 Nancy "," Place Stanislas 54000 Nancy","Rue Baron Louis 54000 Nancy","Rue Victor Poirel 54000 Nancy","3, rue Victor 54000 Nancy"];

var TabNoms=["HALL DU LIVRE - 38, rue St Dizier "," OFFICE DU TOURISME - Place Stanislas","MEDIATHEQUE – Rue Baron Louis","SALLE POIREL – Rue Victor Poirel","CINEMA KINEPOLIS - 3, rue Victor"];


if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(48.700,6.200),13);
geocoder = new GClientGeocoder();

function createMarker(point, number,texte)
{
var marker = new GMarker(point);
marker.value = number;
GEvent.addListener(marker,"click", function()
{
var myHtml = texte;
map.openInfoWindowHtml(point, myHtml);
});
return marker;
}
for (var i = 0; i< TabPoints.length; i++)
{
geocoder.getLatLng(
TabPoints[i],
function(point)
{
if (!point) {
alert(TabPoints[i]+"not found");
} else {

map.addOverlay(createMarker(point,i,TabNoms[i]));
}
});

}
}
}
Mon problème est que dans la fonction point (en gras) dans le code ne reconnai pas l'indice "i" de ma boucle plus précisement il me le met a 5 ( nombre d'élément dans mon tableau ).
J'ai un peu de mal a comprendre la, si quelqu'un pouvait m'expliquer ce serai gentil.
merci d'avance