How do I set the bounds of an existing object (Like a ground overlay, rectangle, etc.) in Google Maps API v3?
For example:
// Assuming a map and a rectangle have already been created.
var newBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(-20,-10),
new google.maps.LatLng(50,30)
);
rectangle.setBounds(newBounds);
Is there an equivalent to setBounds()?
Note: I could change the recangle's bounds array directly, but as Google keeps changing their variable keys for bounds this would eventually break the script.
I have found the solution by taking a look at the
GroundOverlayconstructor: