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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
function CreationMarker(lati, longi)
{
var d = tab[i][1];
var sous_chaine=troncature(d,90);
// sous_chaine =
var point = new google.maps.LatLng(lati, longi);
/**************** Définition des options du marqueur*******/
optionsMarqueur =
{
position: point,
map: carte,
icon: tab[i][10],
title: tab[i][1]
};
// Création du marqueur
marqueur = new google.maps.Marker(optionsMarqueur);
markers.push(marqueur);
// Définition du contenu de l'infobulle<img src="' + tab[i][9] + '" title="Logo Fournisseur" style=" width:30px;height: 30px;" />
contentString =
'<div class="text_infobulle" >'+
' <img src="' + tab[i][4] + '" height="80px"><a href="deal-'+tab[i][11]+'-'+tab[i][0]+'-'+tab[i][12]+'" title="'+tab[i][1]+'"><b> '+sous_chaine+'...</b></a></br> '+
'<span id= nouveau_prix>' +tab[i][3]+'€</span> au lieu de <span id="ancien_prix"> '+tab[i][2]+'€</span></br>'+
'<a href="deal-'+tab[i][11]+'-'+tab[i][0]+'-'+tab[i][12]+'" title="'+tab[i][1]+'">Plus d\'infos ></a>'+
'<span class="img_infobulle"><img src="' + tab[i][9] +'" height="20px"></span>'+
'</div>';
// Création de l'infobulle
var infowindow = new google.maps.InfoWindow ({
content: contentString,
position: point,
});
// Association de l'infobulle au marqueur
marqueur._infowindow = infowindow;
// Création de la fonction Clic
google.maps.event.addListener(marqueur, 'click', function ()
{ alert(infowindow.position);
//alert('appel ouverture ok');
//call_fermeture(this);
if(marqueur_courant){
//alert('ici ok');//alert(marqueur_courant);
marqueur_courant._infowindow.close();
}
/**/
marqueur_courant = this;
// ! IMPORTANT on utilise this et non pas marqueur
this._infowindow.open( carte, this);
});
} |
Partager