Make sure you set the width and height on the map (both in the div style and in Mapoptions passed to the map constructor). It is not possible to verify it yourself, but try the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script type="text/javascript">
function GetMap() {
var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),
{ credentials: "BingMapsKey",
center: new Microsoft.Maps.Location(52.6, 1.26),
mapTypeId: Microsoft.Maps.MapTypeId.road,
zoom: 7,
height: 480,
width: 640
});
}
</script>
</head>
<body onload="GetMap();">
<div id="mapDiv" style="position:relative; width:640px; height:480px;"></div>
</body>
</html>
source
share