This is a basic demo of how to implement a WMS layer and clip it. Code has been exracted from our earthimages library and is not optimised for use/reading for a standalone piece of code. Pull requests are welcome ;-)
To test the feature, please go to the following URL, wait for the map and WMS layer to load and grab the round icon on the right of the layer on the white line.
https://leforthomas.github.io/GoogleMapsSnippets/WMSClippedMap.html