一直以为应用map这个很难,很神秘,今天看到一个js加载的例子,发现如此简单,当然如果在此之上再做应用,就有难度了,存在此处!
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(34.397, 108.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
</script>
</head>
<body οnlοad="initialize()">
<div id="map_canvas" style="width:100%; height:100%">
</body>
</html>
直接用浏览器打开即可