Shading and highlighting

Discussion created by fraxinus on Jun 7, 2012

In a Javascript API application of mine we originally had the functionality where the user drew a box on the map, and I set up a little thingie to create four boxes around it with a semi-transparent gray fill. That shaded out the area around that box very nicely.

Now my client has asked for the functionality where the user draws any irregular polygon, and we are interested in creating a similar effect (shading everything around the polygon). Any tips on how to create that?

See attachment for a simple view how it works with a rectangle/box.