I have a website using the Google-maps Javascript API V3.
I would like to highlight the region of interest by placing a semi-transparent color on top of the map with a hole cut in the middle. See image attached.
The position of the cut-out could be anywhere. I am able to calculate the pixel (or lat/lng) coordinates of the cut-out, but what I’m struggling with is how best to create a mask. I’ve had a look at Google’s image tile overlays and polygons but couldn’t see a simple way to achieve this. Can anybody offer any pointers on the best way to proceed?

Figured it out. Incase anyone else needs to do this …
To use it…