<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize()
{
var latlng = new google.maps.LatLng(-34.397, 150.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 onload="initialize()">
<div id="map_canvas" style="width: 100%; height: 100%">
</div>
</body>
</html>
http://code.google.com/intl/zh-CN/apis/maps/documentation/javascript/reference.html
本文提供了一个使用谷歌地图API创建简单网页地图的应用实例。通过JavaScript调用谷歌地图API,设置了初始视图、缩放级别及地图类型,展示了如何在网页上嵌入交互式地图。
3万+

被折叠的 条评论
为什么被折叠?



