Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size of infoWindow in google maps api v3. What is the right solution?

I have need to change width and height of google maps infoWindow and I saw this topic Google Map .InfoWindow Set Height and Width. I found that the solutions from it doesn't work. Even standart infoWindow = new google.maps.InfoWindow({maxWidth: '50px'}) isn't going to work.

So what is a solution? How to change width and height of infoWindow?

like image 225
Alexandre Avatar asked Aug 24 '12 19:08

Alexandre


People also ask

What is InfoWindow in Google map?

An InfoWindow displays content (usually text or images) in a popup window above the map, at a given location. The info window has a content area and a tapered stem. The tip of the stem is attached to a specified location on the map. Info windows appear as a Dialog to screen readers.

How do I open multiple Infowindows in Google Maps?

By assigning the infowindow to a marker property, each marker can have it's own infowindow. This was how I approached the problem, with the relevant sample code. //create a marker object first, or instantiate it by passing a JSON to the constructor. //this can be done inside a for loop var infowindow = new google.


1 Answers

This works for me:

new google.maps.InfoWindow({ maxWidth: 320 });

Remove the ' ' and the px specifier and I believe it will work for you too.

like image 78
Loudenvier Avatar answered Sep 21 '22 17:09

Loudenvier