Jump to content

kbellis

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by kbellis

  1. RE: http://www.w3schools.com/googleapi/google_maps_basic.asp

     <!DOCTYPE html>
    <html>
    <head>
    <script src="http://maps.googleapis.com/maps/api/js"></script>
    <script>
    function initialize() {
      var mapProp = {
        center:new google.maps.LatLng(51.508742,-0.120850),
        zoom:5,
        mapTypeId:google.maps.MapTypeId.ROADMAP
      };
      var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
    }
    google.maps.event.addDomListener(window, 'load', initialize);
    </script>
    </head>
    
    <body>
    <div id="googleMap" style="width:500px;height:380px;"></div>
    </body>
    
    </html> 
    

    In the above example, the container's size is controlled with

    style="width:500px;height:380px;"
    

    Substituting 100% in place of 500px, the width of the map can effectively be altered; however, the same is not true for the height of the map. Why is this true, and how else might its height be controlled without an explicit dimension in pixels?

×
×
  • Create New...