GoogleMap control rectangle polygon sample.
Events can be handled same way as the polygon events. Check out client and server polygon events handling.