无法添加标记,可能非常简单,但我是新手。谢谢。
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?&sensor=true"></script>
<script type="text/javascript">
function addMarker() {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(-34.397, 150.644),
title:"Hello World!"
});
}
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
$(document).ready(function() {
addMarker();
})
</script>