<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div id="googft-mapCanvas"></div>
// This example displays a marker at the center of Australia. // When the user clicks the marker, an info window opens. // The maximum width of the info window is set to 200 pixels. 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('googft-mapCanvas'), mapOptions); var contentString = '<div id="content">hello</div>'; var infowindow = new google.maps.InfoWindow({ content: contentString, maxWidth: 200 }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Uluru (Ayers Rock)' }); google.maps.event.addListener(marker, 'mouseover', function () { infowindow.open(map, marker); }); google.maps.event.addListener(marker, 'mouseout', function () { infowindow.close(); }); } google.maps.event.addDomListener(window, 'load', initialize);
html, body, #googft-mapCanvas { height: 100%; margin: 0; padding: 0; }