O'Reilly logo

Google Maps JavaScript API Cookbook by Balkan Uraz, Alper Dincer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required