Custom image map points with the Google API

April 2nd, 2006 by Paul

Want a different icon for each map point??
Here’s a quick technique for those that are interested:

  • Add an argument to the API function createMarker(), mine is called ‘newicon’.
  • Set the value of icon.image = newicon in the function to use a custom image for each map point.
  • Be sure to set the default icon size and make a shadow image (not shown).
  • Last, set the value of icon ie. var icon = “url to image”.
  • The snippet:
    snippet
    That’s it!