[GIS] How to achieve an “inner glow” effect on polygons drawn using the Google Maps v3 javascript API

google mapsgoogle-maps-apipolygon

Is it possible to produce an "inner glow" effect on polygons drawn using the Google Map v3 javascript API?

If not possible using the vanilla Google Maps API, is there a 3rd party tool that can do it? Or perhaps some other technique I could use to accomplish my goal?

The inner glow effect I desire would resemble this:

http://i.imgur.com/7Lla7.png

Thanks!

Best Answer

No, it is not possible using the regular API. It may be possible with a third-party library, but not likely for all browsers. Google Maps uses (or at least used to) multiple ways of drawing geometry (e.g. SVG, HTML canvas, etc.) depending on the browser, so even if you could hook into those geometry functions, one solution for inner glow would likely not work in all browsers.

Your best bet would probably be to find (if it exists) a third-party library that has its own geometry functionality and use it on top of Google Maps.

Alternately, if you can live without inner-only glow, you could use the API and create multiple polygons with various opacities, which should give you a (inner and outer) glow effect.