On Jul 13, 11:41 am, ShaneMcC <[email protected]> wrote:
>
> Is there anyway to center the infowindow when a sidebar entry is
> clicked?
Yes, but not in your code snippet.
You need to change what happens when the marker is clicked (which is
what the sidebar link does: it "clicks" the marker automatically), so
the bit you need to change is that listener:
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
Set the map centre before opening the infoWindow, in order that the
marker is in view but the infoWindow will scroll the map so it all
fits:
GEvent.addListener(marker, "click", function() {
map.setCenter(marker.getLatLng());
marker.openInfoWindowHtml(html);
});
If you can't get that to work, post a link to *your* map, not to one
which works.
--
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.