toolman Posted November 8, 2013 Share Posted November 8, 2013 Hi there,I have a map in which displays a marker.How can I add multiple markers to the map?This is my code: var doncaster = new google.maps.LatLng(53.47921, -1.00201); var parliament = new google.maps.LatLng(53.47921, -1.00201); var marker; var map; function initialize() { var mapOptions = { zoom: 14, mapTypeId: google.maps.MapTypeId.ROADMAP, center: doncaster }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); marker = new google.maps.Marker({ map:map, draggable:true, animation: google.maps.Animation.DROP, position: parliament }); google.maps.event.addListener(marker, 'click', toggleBounce); } function toggleBounce() { if (marker.getAnimation() != null) { marker.setAnimation(null); } else { marker.setAnimation(google.maps.Animation.BOUNCE); } } google.maps.event.addDomListener(window, 'load', initialize); Thanks Link to comment https://forums.phpfreaks.com/topic/283720-addming-multiple-markers-on-google-map/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.