嗨我有這個代碼,每次我點擊添加標記按鈕時都會在地圖上添加一個標記。任何有關如何在地圖上添加標記時更改標記圖標的建議?非常感謝。Android標記圖標
function initialize() {
var myLatlng = new google.maps.LatLng(40.779502, -73.967857);
var myOptions = {
zoom: 7,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map"), myOptions);
TestMarker();
}
google.maps.event.addDomListener(window, 'load', initialize);
function addmarker(location) {
marker = new google.maps.Marker({
position: location,
draggable:true,
map: map
for()
});
}
// Testing the addMarker function
function TestMarker() {
CentralPark = new google.maps.LatLng(40.779502, -73.967857);
addmarker(CentralPark);
}