title: Clip Google Maps JS API ImageMapType to a polygon
body: <p>How can I clip a MapType in Google Maps to an arbitrary polygon. For example, if I have a custom <a href="https://developers.google.com/maps/documentation/javascript/maptypes#ImageMapTypes" rel="noreferrer">ImageMapType</a> that covers a large area (i.e. all the world), but I want to show it only inside a given polygon (i.e. one country).</p>
  
  <p>Is there a way to clip the ImageMapType to a given polygon, or to implement a custom MapType to achieve this behaviour? It should allow for zooming and panning normally.</p>
  
  <p>The rest of the map should stay the same, and there would be a MapType covering only a specific area. Therefore, it is not possible to simply overlay a polygon to cover the areas outside the polygon to display just what is needed.</p>
  
  <p>Like so:</p>
  
  <p><img src="https://i.stack.imgur.com/OMTRR.png" alt="Australia map with a clipped overlay on South Australia"></p>
  
  <p>Server-side clipping is not an option.</p>