Creating Custom Overlays with the Google Maps API

Creating Irregularly Shaped Overlays

Of course, circles are just one of innumerable shapes you can create using the Google Maps API. For instance, you can create a triangle-shaped overlay that bounds three cities simply by identifying a set of four coordinates and then passing that set to the GPolyline class, as demonstrated here:

The Google Maps API's powerful overlay capabilities, however, go far beyond the simple addition of markers and routes that I've discussed in the past. You can create any conceivable shape, offering new ways to visually describe your spatial data. If you do anything interesting with what you've learned in this tutorial, I'd love to hear about it!