<script type="text/javascript">
function initialize() {
changeSize();
var map = new BMap.Map('map');
var point = new BMap.Point(116.404844, 39.923125);
map.centerAndZoom(point, 15);
map.addControl(new BMap.NavigationControl());
map.enableScrollWheelZoom(true);// 允许鼠标滑轮放大缩小 }
function loadScript() {
var script = document.createElement("script");
script.src = "http://api.map.baidu.com/api?v=1.3&callback=initialize";
document.body.appendChild(script);
}
function changeSize() {
var showMap = document.getElementById("map");
showMap.style.width = document.documentElement.clientWidth + "px";
showMap.style.height = document.documentElement.clientHeight + "px";
}
window.onresize = changeSize; //改变大小的时候,div也占满全屏
window.onload = loadScript;
</script>