I ran into the following problem. On a Google map, I want to add tabbed info windows where content is loaded from an external file using the GDownloadUrl method. The code works fine, but with two problems. a) The first time I click a marker, nothing happens. I need to double click to get the info window. After that it works fine. b) When I close the information window and open it again, the tabs are repeated. Each time I open the info window again, these tabs are repeated. So, if you use the code below and open the information block 3 times, I get 6 tabs (information, photos, information, photos, information, photos). Any idea on what I'm doing wrong here?
I also tried this with the jQuery $ .get method, but the results were exactly the same.
function createREMarker(lat,long,reID)
{
var reMarker = new GMarker(rePoint,iconRE);
GEvent.addListener(reMarker, "click", function()
{
GDownloadUrl('testcontent.php?reID='+reID+'&what=info', function(data) {
content1 = data;
});
GDownloadUrl('testcontent.php?reID='+reID+'&what=photos', function(data) {
content2 = data;
});
tabs.push(new GInfoWindowTab('Info', '<div id="mapOverlayContent" style="width:375px; height:220px; overflow:auto;">'+content1+'</div>'));
tabs.push(new GInfoWindowTab('Photos', '<div id="mapOverlayContent" style="width:375px; height:220px; overflow:auto;">'+content2+'</div>'));
reMarker.openInfoWindowTabsHtml(tabs);
});
return reMarker;
};