编辑下面的代码:【加编码】
<html> <head> <script src="http://maps.googleapis.com/maps/api/js"> </script> <script> function initialize() { var mapOpt = { 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"),mapOpt); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="googleMap" style="width:500px;height:380px;"></div> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂