I have the following code for placing several markers on a google map.
What I now want to do is when the user clicks on a marker it zooms in and then centers the map to
marker is left pointing to the last marker added. Either use function closure or "this" like you did for the infowindow:
google.maps.event.addListener(marker, "click", function () { infowindow.setContent(this.html); infowindow.open(map, this); map.setCenter(this.getPosition()); map.setZoom(10); });