Creating custom popups/infoboxes

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 ...

Get Google Maps JavaScript API Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.