Info Window of Google Maps - Google Maps

What is Info Window of Google Maps?

Apart from markers and different shapes, an Info Window can also be drawn on Google Maps. Info Window is a popup window that appears at a given location above the map. This chapter explains in detail how to use the Info Window in maps.

How to use Info Window in Google Maps?

If you require adding any kind of information on the map, Info Window serves the purpose. It basically displays text or images. It has two parts - the text area and a narrow stem. The stem is attached to the location specified on the map. Content, Position and maxWidth are the different properties of Info Windows.

How to add an Info Window?

Info Window usually comes attached to the marker. Info window can be added by representing google.maps.InfoWindow class. The properties are meant for:

  • Content – content can be passed through this option in string format.
  • Position – this option facilitate to select the position of the Info Window.
  • MaxWidth – this option helps in restricting the size of the window horizontally. Basically the width of the window is stretched to wrap the text provided in the window.

This concept is best understood by the illustration below, which shows setting of Info Window.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Google Maps Topics