Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Map InfoWindow displays scroll bars in Google Chrome

Tags:

google-maps

For some reason InfoWindow is displaying scroll bars along with the content, I tried to have custom width and height to InfoWindow but it is not showing up. I tried the solution from here Google Map Infowindow not showing properly

Please refer following link http://server.ashoresystems.com/~contacth/index.php?option=com_business&view=categoryresult&catid=2

  • Click on 1 (has scroll bars)
  • Click on 3 (even disturbed)

Thanks for any help.

like image 827
Dan Avatar asked Nov 13 '13 13:11

Dan


People also ask

How do I make the scrollbar always visible in Chrome?

Open a Chrome window. In the address bar, enter "chrome://flags," and navigate to that page. Scroll down to Overlay Scrollbars, and set the field to "Disabled." Restart your browser window, and your scrollbars should work again in PicMonkey.

How do I change the width of InfoWindow on Google Maps?

maps. InfoWindow({ content: some_text, maxWidth: 200 }); The documentation notes that the "value is only considered if it is set before a call to open. To change the maximum width when changing content, call close, setOptions, and then open."

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.


2 Answers

I found a workaround here.

I made this JSfiddle, displaying the bug and a workaround.

If you do not want to visit external links, here is the workaround description:

Add a wrapping div to your info window content:

var infoWindow = new google.maps.InfoWindow({     content: '<div class="scrollFix">'+infoWindowContent+'</div>',     [...] }).open(map); 

And use CSS definitions to avoid scrollbars:

.scrollFix {     line-height: 1.35;     overflow: hidden;     white-space: nowrap; } 
like image 79
Philipp Gächter Avatar answered Sep 28 '22 02:09

Philipp Gächter


To hide the scrollbars, give your content a high z-index stack order, eg.:

var infowindow = new google.maps.InfoWindow({     content: '<div style="z-index:99999">Message appears here</div>', }); 

Or, add the following style:

.gm-style-iw {     overflow:hidden!important;     height:55px!important; //for 3 lines of text in the InfoWindow } 
like image 23
David C Avatar answered Sep 28 '22 04:09

David C