How to get the center of a polygon in google maps v3?

It doesn’t need to be 100% correct, it can be the center of the bounding rectangle. Run through all the points in the polygon. For all the points find;

Source