Can we make a Googlemap heart attack by reacting so that its size changes depending on the size of the browser window?

I put the map on a responsive html page. He has a marker and info industry. I use code like this

My map_canvas has a width that will adjust according to the width of the medium. This is a style using the @media tag.

I want to increase or decrease the size of the information window depending on the size of the medium.

Is it possible?

+4
source share
1 answer

InfoWindow always has a fixed size calculated before it opens. Thus, the CSS solution will not work here.

What you can try: Listening to the window resize event and reopening the info window:

google.maps.event.addDomListener(window, 'resize', function() { infowindow.open(map); }); 
+2
source

All Articles