Polygon mask with dynamic styling
This sample shows how to dynamically style a polygon mask to align with the current style of the map. This sample also monitors the 'styledata' event of the map and change the color of the mask polygon based on the style of the map to create a more seamless experience. Alternatively, any fill color and opacity value can be set on the polygon layer itself without the 'styledata' event if desired.