Each marker you must push into custom markervar eachcustom = {
MARKER: googlemarker, // marker of google map
CONTENT: data // string
};
Each custom marker, you push into array. Declare that array and infowindow on global
var info = new google.maps.InfoWindow({
content: ""
});
var markerlist = new Array();
markerlist.push(eachcustom );
Now, you have a datasource(markerlist) to access when requested. Next step, you must add listener for each custom marker in markerlist.
google.maps.event.addListener(markerlist[i].MARKER , 'mouseover', function (event) { _overMarker((markerlist[i]); });
google.maps.event.addListener(markerlist[i].MARKER , 'mouseout', function (event) { _outMarker((markerlist[i]); });
or you can add listener for each custom marker when them created
google.maps.event.addListener(eachcustom.MARKER , 'mouseover', function (event) { _overMarker(eachcustom); });
google.maps.event.addListener(eachcustom.MARKER , 'mouseout', function (event) { _outMarker(eachcustom); });
function _overMarker(mak)
{
this.info.close();
this.info.setContent(mak.CONTENT);
this.info.open(googlemap, mak.MARKER);
}
function _outMarker(mak)
{
this.info.close();
}