https://developers.google.com/maps/documentation/javascript/examples/marker-simple?hl=pt-br中的 Google 文档示例
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple markers</title>
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(43.485505,16.261093);
var mapOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas" style="width: 500px; height: 500px;"></div>
</body>
</html>