I just want to display a default info window with the content The 123456789
.
So I am using the maps example from google, and changing the infowindow content. Simple as that.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"><meta charset="utf-8">
<title>Info windows</title>
<style>html, body, #map-canvas {height: 100%;margin: 0px;padding: 0px}</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {zoom: 4,center: myLatlng};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var infowindow = new google.maps.InfoWindow({
content: 'The 123456789'
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Uluru (Ayers Rock)'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head><body><div id="map-canvas"></div></body></html>
I am getting this in both Firefox and Chrome (expected The 123456789
). Only in IE I have the desired result. The rest of the text is wrapped and in chrome the scrollbar is also visible.
Now, as per the documentation, the InfoWindow should be expanded to fit my text, which it does if the content is a bit longer than the one I am testing. Is this a google maps styling issue and how can I simply display that text without custom InfoWindows and without hackish css?
edit
Tested the abode code again. The first time the infowindo is shown its problematic, the following times it's displayed as it should.