google.maps.Marker对象可以听下面的用户事件,例如:
'click''dblclick''mouseup''mousedown''mouseover''mouseout'
These events may look like standard DOM events, but they are actually part of the Maps API.这些事件可能看起来像标准的DOM事件,实际上却是在地图API的一部分。
google.maps.Marker对象可以听下面的用户事件,例如:
'click''dblclick''mouseup''mousedown''mouseover''mouseout'These events may look like standard DOM events, but they are actually part of the Maps API.这些事件可能看起来像标准的DOM事件,实际上却是在地图API的一部分。
1.JavaScript的API现在已经升级到V3,官方建议使用V3格式的
2.V3的JavaScript不再需要KEY
The “Hello, World” of Google Maps v3
<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=set_to_true_or_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>