Ok, I see now. I just discovered that I have one problem remaining.
I've just tested with a larger XML file and am finding that I get the
same infowindow contents regardless of which marker I clicked on.
It's always the infowindow contents that were generated last. Do you
know how I can modify so that I'm referencing the correct marker?
In egeoxml.js I have this code:
var title = "<div class='popup' style = 'width:250px'>"
+ "<h4>There are "+contentItemsForThisPoint.length+"
articles at this location for your selected category. Click next to
view them all!</h4>";
nextButton = '<div id="nexButton" style="width:
60px;cursor:pointer;border:1px solid gray;padding-left: 4px;"
onclick="nextPage()">Next >></div>';
previousButton = '<div id="prevButton" style="width:
60px;cursor:pointer;border:1px solid gray;padding-left: 4px;"
onclick="previousPage()"><< Previous</div>';
iwContent = Array();
for (i=0;i<contentItemsForThisPoint.length;i++) {
if (i ==0) {
iwContent[i] = new GInfoWindowTab('',title +
contentItemsForThisPoint[i] + "<table style='margin-bottom:
0px;'><tr><td>" + nextButton + "</td></tr></table>");
} else if (i == contentItemsForThisPoint.length-1) {
iwContent[i] = new GInfoWindowTab('',title +
contentItemsForThisPoint[i] + "<table style='margin-bottom:
0px;'><tr><td>" + previousButton + "</td></tr></table>");
} else {
iwContent[i] = new GInfoWindowTab('',title +
contentItemsForThisPoint[i] + "<table style='margin-bottom:
0px;'><tr><td>" + previousButton + "</td><td>" + nextButton + "</td></
tr></table>");
}
}
GEvent.addListener(m, "click", function() {
// eval(myvar+".lastmarker = m");
m.openInfoWindowTabsHtml([iwContent[0]],iwoptions);
});
In map-page-functions.js I added this:
function nextPage(marker){
pageIndex++;
if (iwContent[pageIndex]) {
map.updateInfoWindow([iwContent[pageIndex]])
}
}
function previousPage(marker){
pageIndex--;
if (iwContent[pageIndex]) {
map.updateInfoWindow([iwContent[pageIndex]])
}
}
Thanks,
Jennifer
On Oct 9, 3:37 pm, marcelo <[EMAIL PROTECTED]> wrote:
> On Oct 9, 9:45 pm, Jennifer Strahan <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for the great example! I have it working now. I wish I could
> > understand more how it's working. I'm confused about how we're able
> > to use marker.openInfoWindowTabsHtml but not have any tabs visible.
> > Was there a setting somewhere that made that happen?
>
> Well, apparently, when you pass only one tab to
> openInfoWindowTabsHtml, no tabs are created at all.
> I only used GInfoWindowTab objects because that's what the
> GMap2.updateInfoWindow() method requires according to the
> documentation.
>
> --
> Marcelo -http://maps.forum.nu
> --
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---