Can someone please advise how I could add this animated marker to the below google maps API.
The below is the standard google maps api code with option to give image source for the marker (icon).
function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 4,
center: myLatlng
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
icon: marker.png, //Option for setting the marker source
title: 'Hello World!'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…