edited
code
//array store the markers
var googleMarker = [];
//this function get json object with the marker data
//place name,place id,place address.
function AjaxGetUserToPlaces(res)
{
var l = res.value.length;
for(var i=0;i<l;i++)
{
var point = new GLatLng(res.value[i].lng,res.value[i].lat)
map.addOverlay(createMarkerInfo(i,point,res.value[i].placeName,res.value[i].placeId));
polylineArray.push(point);
}
}
//the function create the openWindow for the marker.
function createMarkerInfo(i,latlng , placeName,placeId)
{
var marker = new GMarker(latlng);
marker.value = placeId;
GEvent.addListener(marker, 'click', function()
{
marker.openInfoWindowHtml(''+
'<a href='+baseUrl+'ui/pages/place/place.aspx?plid='+placeId+'>'+placeName+'</a>');
});
googleMarker[i] = marker
return marker;
}
//this function occur when user click on one of the result.
//it gets the number in the array googleMarker.
function showMarkerInfoWindow(i)
{
//here i want to open the marker info window.
//pay attention, i dont have the html to put inside the infowindow
//i want just to show the infowindoe with the exising html
//that created prevusly from the function createMarkerInfo
googleMarker[i].openInfoWindowHtml();
}
i hope u ll understand me better thank very much