Recently I needed to add icons and circles to a Google Map. My colleague Jan Sipke did a nice write up on this topic a couple of years ago. Unfortunatly things did change since then. Google released a new version of the Maps API (3.8 at the time of writing) and the resources that were used in his writeup moved to new locations. That why I decided to write an update on his story.
I wanted to achieve something like this:
I downloaded the icon from the same source as Jan Sipke did: The Map Icons Collection.
Only the site moved to a new location. The site features a great set of nice icons you can use on Google Maps. Check them out!
I used Matt Williamson’s Google Maps Circle Overlays to draw the circles. This script uses miles for the radius of the circle. I wanted to use kilo meters and made a simple function that converts kilo meters into miles.
The following code wraps this all up into the result I was looking for:
After I wrote this code I found that Google also offers a way to create circles on a map in the Maps API. You might want to check out their example as well.