September 13, 201313 yr Hi Gang, Hit a real snag with the width of google.maps.InfoWindow and it's inconsistency of appearance. In IE and FireFox some of the html content decides to have vertical scrolls yet others (often with more content) do. It appears to make no difference how many pins, length of data, which order the array is in, whether I use div, p or a ul the only consistency appears to be the inconsistency. Screens attached (top IE 10, bottom FF). Has anyone else seen / had this problem? Edit: Forgot to say works fine in Chrome.
September 13, 201313 yr Quick Google came up with these two related issues (with 'answers'), which may or may not fix your issue. Does seem to be a bug on Google's end. http://stackoverflow.com/questions/7769765/why-is-a-scroll-bar-coming-out-in-my-maps-infowindow-in-chrome http://stackoverflow.com/questions/1554893/google-maps-api-v3-infowindow-not-sizing-correctly/11125793#answer-11125793
September 13, 201313 yr Author Thanks andy, been to those though and none seem to work. The bit I cannot fathom is why some of the info windows behave like this and some do not yet nothing sets them apart as special. Since posting and I've tested further, it's IE 10+ and FF 23.0.1+ ... strange the old browser behave.
September 13, 201313 yr Author Aha! IE 10+ and FF 23+ didn't like spaces and wanted me to stuff anywhere that had space.
September 16, 201313 yr Author OK so my investigation so far has taught me. [ "Elvetham Hotel", 51.3012030447, -0.8800231553, "<div class=\"map-info\"><ul><li><b>Elvetham Hotel</b></li><li>Hook, RG27 8AR</li><li>Distance: 7.64 Miles</li><li><a href='#'>View Details</a></li></ul></div>" ] This causes the vertical scroll on 'some' of the pins, whereas ... [ "Elvetham Hotel", 51.3012030447, -0.8800231553, "<div class=\"map-info\"><ul><li><b>Elvetham Hotel</b></li><li>Hook, RG27 8AR</li><li>Distance: 7.64 Miles</li><li><a href='#'>View Details</a></li></ul></div>" ] fits to the window. Jamming into the spaces fixes this issue and has no detrimental effect to the current working browsers. There is one exception now which is any hyphenated words e.g. stoke-on-trent. For this I have tried using – based on the bug fix however this does not work and it still gives vertical scroll bars as it 'sometimes' breaks down a line on a hyphenated word. FYI the class .map-info is ... .map-info { overflow: hidden; line-height: normal; } .map-info li { overflow: hidden; } Anyone any ideas?
September 17, 201313 yr Author OK cheated with word-wrap: none but this only works if you know roughly the max size of data, not an ideal resolution but it will pass for this use.
September 17, 201313 yr Have you sent a bug report?! You seem to be making a lot of workarounds here, and it's not your problem!
September 17, 201313 yr Have you been adding !important to override Google's styles? The alternative would be to use the Google Maps API and create a custom info window and marker. http://jsfiddle.net/jEhJ3/597/
Create an account or sign in to comment