Hello Everyone, I have some markers that have too many tabs in the info window and am working on a solution to this problem.
I found a thread where Mike Williams suggests the idea of having an array of contents strings for each marker and then use a regular info window and include links that allow the user to view the other contents. I'm having trouble implementing this and am hoping that someone can provide some pointers. I've been able to create the array of content items (contentItemsForThisPoint) but I'm not sure how to write the onclick function to load the content item for the selected index value. Any suggestions would be much appreciated. Please let me know if additional info is required. Mike's suggestion (in his words) is at the bottom of this post. Thanks, Jennifer My test page is here: http://www.parkinfo.org/TEST/bn_map/map/map.htm The relevant section of code I have so far is: if (tabbed == "false"){ //there is just one content item for this marker GEvent.addListener(m, "click", function() { // eval(myvar+".lastmarker = m"); m.openInfoWindowHtml(html1 + "</div>",iwoptions); }); } else { //there are multiple content items for this marker. include links to other content html1 += contentItemsForThisPoint[0]; for (i=0;i<contentItemsForThisPoint.length;i++) { html1 += "<a href='#' onclick='javascript:openNewTab(" + i + ");'> " + i + " </a>"; } GEvent.addListener(m, "click", function() { // eval(myvar+".lastmarker = m"); m.openInfoWindowHtml(html1 + "</div>",iwoptions); }); } if (!!this.opts.addmarker) { this.opts.addmarker(m,name,desc,icon.image,this.gmarkers.length) } else { //this.map.addOverlay(m); clusterer.AddMarker(m, name); Mike's suggestion: I'd suggest preparing the data almost as if you were going to be using tabs - i.e. for each marker there's an array of contents strings. Display a tabless info window, but if the array has length greater than one, add an extra bit to the contents that says that there are N results at this location and has [Next] and [Prev] buttons. When the user clicks on one of those buttons, the onclick() function reopens the infowindow with the next or previous set of contents from the array. Or instead of [Next] and [Prev] buttons you could display one button for each of the entries using the name of the entry, but passing the index number the onclick() function. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
