Vorrei far apparirer una infowindow tramite dei link esterni alla mappa.
E' possibile?
Codice PHP:
htmlText="testo";
marker.infoWindow = new google.maps.InfoWindow({content: htmlText});
/* now inside your initialise function */
google.maps.event.addDomListener(marker, 'click', function () {
// where I have added .html to the marker object.
if (infowindowprec) {infowindowprec.close(); //chiude la precedente infowindow
}
this.infoWindow.open(speedTest.map,this); //apre la nuova infowindow
//this.infoWindow.setPosition(myLatlng);
infowindowprec = this.infoWindow; //assegna l'attuale infowindow alla variabile globale
});
se applico la infowindows al marker tutto funziona.
Ma se invece al posto del marker provo a metterla su un link
Codice PHP:
var title = document.createElement('A');
htmlText="testo";
title.infoWindow = new google.maps.InfoWindow({content: htmlText});
/* now inside your initialise function */
google.maps.event.addDomListener(title , 'click', function () {
// where I have added .html to the marker object.
if (infowindowprec) {infowindowprec.close(); //chiude la precedente infowindow
}
this.infoWindow.open(speedTest.map,this); //apre la nuova infowindow
//this.infoWindow.setPosition(myLatlng);
infowindowprec = this.infoWindow; //assegna l'attuale infowindow alla variabile globale
});
non funziona nulla. Come posso ovviare?