I got around that by setting a flag value then adding my markers and
calling fitBounds. Inside my zoom_changed listener, if the flag value
was set, I reset it then called another function to continue
processing.
Hope that helps,
Chad Killingsworth
On Jan 12, 6:54 am, Chad Killingsworth
var FindCorrectZoom = false;
function AddMarkers() {
for(var i = 0; i < 10; i++ {
AddMarker(i);
}
FindCorrectZoom = true;
map.fitBounds(MarkerBounds);
}
function processFitBoundsZoomChanged(currentZoom) {
//do something here
}
function zoom_changed_listener() {
if(FindCorrectZoom) {
FindCorrectZoom = false;
processFitBoundsZoomChanged(this.getZoom());
}
}
google.maps.event.addListener(map, 'zoom_changed',
zoom_changed_listener);
I used this technique in my code to limit the maximum zoom level a
call to fitBounds could use.
Chad Killingsworth
On Jan 12, 1:16 pm, Chad Killingsworth
On Jan 12, 1:16 pm, Chad Killingsworth
<chadkillingswo...@missouristate.edu> wrote:
--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.