So by now we’re familiar with adding shapes to a Google map with the v3 API:
$j('#map').gmap('addShape', 'Circle', {
'strokeWeight': 0,
'fillColor': "#008595",
'fillOpacity': 0.25,
'center': result[0].geometry.location,
'radius': 1500,
'clickable': false
});
The above code will create a circle and shade it with fill #008595. Is there any way to inversely shade a map? I would like the entire world to be shaded/filled at half opacity except for a hole where my markers are. Possible?
you need to define a polygon that covers the whole world and has a hole in it, you can’t do it with the "Circle" or "Rectangle" shapes, it has to be a polygon with (at least) two paths.
here is an example
related questions:
code snippet: