It seems that drawing of polygons is asynchronous in google maps api v3. Try to click the \"Load\" button in this example:
http://jsfiddle.net/rmXXF/
the tex
By triggering a small recentering of the map after drawing all the polygons this is added to the same internal google maps event queue as can be seen in this example: http://jsfiddle.net/rmXXF/40/
google.maps.event.addListener(map, 'idle', function() {
document.getElementById('status').innerHTML = 'DONE';
});
and
my_map.setCenter(new google.maps.LatLng(my_map.getCenter().lat(), my_map.getCenter().lng() + .000000001));
You should use an overlay and listen to the drawing manager's 'rectanglecomplete' event. I can code up an example after lunch.
David is right. I misread the documentation. Apologize. He should get the bounty.