Once again, I have a strange minor issue with Google Map API v3. I'm sure I've over-looked something easy, but after looking for an answer for hours, I'm ready to ask for help.
I have a polygon shape that I finally figured out how to zoom into on a click... except that now instead of it zooming into the polygon on a single click, it takes a double-click. What is baffling me is that the script is for a single click. Here is the portion of the script I'm referring to:
// Add a listener for the click event
google.maps.event.addListener(zone1, 'center_changed', function() {
window.setTimeout(function() {
map.panTo(marker.position());
}, 1000);
});
google.maps.event.addListener(zone1, 'click', function() {
map.setCenter(marker.position(29.737, -95.394),
map.setZoom(18)
);
});
Here is a link to a working page: http://www.conleym.com/map/google_maps_code_9_zoom.html *The only polygon currently set up to zoom is polygon1 - the blue shape at the top of the map.
I've tested it on Firefox(23), IE(9) and Chrome(16) all with same results.