出于某种原因,每当我尝试为我的地图使用自定义标记图像时,它只显示默认值。这是我的代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Google Maps JavaScript API v3 Example: Marker Simple</title>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" type=
"text/javascript"></script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
zoom: 3,
center: new google.maps.LatLng(-25.363882,131.044922),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map'), mapOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(-25.363882,131.044922),
map: map,
title: 5,
icon: new google.maps.MarkerImage('http://www.gettyicons.com/free-icons/108/gis-gps/png/24/needle_left_yellow_2_24.png',
new google.maps.Size(24, 24),
new google.maps.Point(0,0),
new google.maps.Point(0, 24))
});
}
</script>
</head>
<body onload="initialize()">
<div id="map" style="width: 780px; height: 480px"></div>
</body>
</html>