Thank you, thank you! Your hint lead me to the solution. Yes, my polygon click function was expecting a point: ...function(point)... It took me forever to figure out what to do. I looked at the event listener you wrote for the polylines, and adapted it for the polygons. I don't see the ".getBounds().getCenter()" described in the documentation, so I can only hope it will remain legitimate.
When I was reading the documentation, wondering if .getBounds ().getCenter() would work for my polygons, I saw that I could supposedly also change the opacity of stuff when rolled over. Man, that made me think. When I added event listeners for that, they seemed to work fine on the map. But of course I had two different listeners, so I couldn't add them to the sidebar. The one for the polylines doesn't work for the polygons and vice versa. Eventually I managed to write the make_sidebar so that it contains three definitions for HTML: one for iconed markers, one for polylines and one for polygons. No doubt the experts here will chuckle at my brute force way of keeping all that separate, but for my small number of markers it seems to work well: ( http://lovebunnies.luckypro.biz/01_stuff/roman_holiday/romanholidaymap.html ) function makeSidebar() { var oldheader; var html = ""; for (var i=0; i<basemarkerslinespolys.length; i++) { if (!basemarkerslinespolys[i].isHidden()) { var header = basemarkerslinespolys[i].myheader; if (oldheader != header) html += "<p><b>" + header+ "</b></ p>"; if (!colorrollovermarkers[i]) { if (basemarkerslinespolys[i].mytype == "marguttaGon") { html += '<p><a href="javascript:myBaseMarkerclick(' + i + ')" onmouseover="basemarkerslinespolys['+i+'].setFillStyle ({opacity:1})" onmouseout="basemarkerslinespolys['+i+'].setFillStyle ({opacity:0.2})">' + basemarkerslinespolys[i].myname + '<\/a><\/p>'}; if (basemarkerslinespolys[i].mytype == "marguttaLine") { html += '<p><a href="javascript:myBaseMarkerclick(' + i + ')" onmouseover="basemarkerslinespolys['+i+'].setStrokeStyle ({opacity:1})" onmouseout="basemarkerslinespolys['+i+'].setStrokeStyle ({opacity:0.5})">' + basemarkerslinespolys[i].myname + '<\/a><\/p>'}; } else { html += '<p><a href="javascript:myBaseMarkerclick(' + i + ')" onmouseover="map.addOverlay(colorrollovermarkers['+i+'])" onmouseout="map.removeOverlay(colorrollovermarkers['+i+'])">' + basemarkerslinespolys[i].myname + '<\/a><\/p>'; } oldheader = header; } } document.getElementById("side_bar").innerHTML = html; } >From my amateur point of view, this is pretty slick! Thank you again and again for pointing me to the solution! On Mar 12, 4:58 pm, "geocode...@gmail.com" <geocode...@gmail.com> wrote: > On Mar 12, 1:27 pm, "geocode...@gmail.com" <geocode...@gmail.com> > wrote: > > BTW - the error when clicking on the sidebar for the polygons was > because the click listener doesn't return a point in that case. > > -- Larry --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to Google-Maps-API@googlegroups.com To unsubscribe from this group, send email to google-maps-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---