We have already created popups or infoboxes in Chapter 3, Adding Vector Layers. As it is stated there, almost every mapping application has the ability to display information that is related to the features shown on it. This information can be related to a marker or a map. Instead of showing all the information on the map, popups or info boxes are used only when needed.
The Google Maps JavaScript API has a google.maps.InfoWindow
class to create a default infobox for developers. In some cases, you need custom infoboxes to show information. There are two ways to do this:
The first way is to create a custom class that inherits from the
google.maps.OverlayView
class and fill the methods to show/hide infoboxes with custom CSS styles.The other, easier way is to use a library created for you. There is a project on Google Code named
google-maps-utility-library-v3
that holds the number of libraries extending the Google Maps JavaScript API. Here's the link: