1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
for( var i = 0; i < tab.length; i++)
{
if((tab[i][1])&&(tab[i][2]))
{
// Définition de la position du pointeur
var point = new google.maps.LatLng(tab[i][1], tab[i][2]);
//alert(point);
}
else
{
/* Appel au service de geocodage avec l'adresse en paramètre */
geocoder.geocode( { 'address': tab[i][3]}, function(results, status)
{
/* Si l'adresse a pu être géolocalisée */
if (status == google.maps.GeocoderStatus.OK) {
point = new google.maps.LatLng(results[0].geometry.location.lat(),results[0].geometry.location.lng());
//alert(point);
}
});
}
alert(tab[i][0]);
alert(point); |
Partager