Here you will find some basic examples that might be useful for you.
How to add a custom button to my map
How to get if a clicked area is within polygon in Google Maps
How to access Google Maps object
How to add custom controls
How to open or close an Info window on event
Using custom renderer function and clustering algorithm